Wednesday, February 18, 2015

3D Compositing / ShadowCatcher / ShadowsOnly in CYCLES


Want to know how to composite 3D Objects over a Photograph/Video?
This Cycles Compositing nodes setup gives you a good amount of control over the 3D, shadow layer and backdrop of your scene.

Download the HIGH RESOLUTION version of this visual explanation.

To download the Blender File (used v 2.73a)

Written description of what's happening:
This blender nodes setup used Render Layers to achieve a good amount of control over the 3D layer and shadows as they fall onto a photograph.

1) Moved the ground plane to layer 2 (M key). Moved camera and light to be on layers 1 AND 2 (M key, shift click on multiple layers).

2) Created new render layers, one for 3D layer (Monkeys), one for the Shadows (ShadowLayer) and the Ground Plane without the shadows (Plate). The trick here is to use the 'exclude' button for layer 1 for this to work well.

3) In the nodes setup, we have a different 'Render Layer' node per layer, plus a fourth 'Image' node for the background image.

4) The real trick here is the use of the Mix Node set to subtract. This will remove the shadow from the groundplane. The 'Invert' node then flips the alpha of that setup andshows only the shadows without the rest of the ground plane.

5) All layers are then sandwiched to create a final composite. Note that filtering each layer is fully allows (RGB Curves for example allows you to change curves of each layer individually). Blur or other options work well.

If all else fails, watch this YouTube video: https://www.youtube.com/watch?v=k7gKzgvFiGM