As the Cycles compositing process is almost the same as it was for Blender Render, in this section we’ll focus on the different steps for setting up the shadows. In Figure 14.10, you can see another numbered node tree that shows how the shadows are composited. At the end of this section, Figure 14.11 shows the completed node tree for reference, but once you’ve composited the shadows, the rest of the process is exactly the same as for Blender Render.
1. Set the Render Layers node to show the Floor Shadows Render Layer.
2. Create a Dilate/Erode node from the Filter nodes category and connect the Alpha from the Floor Shadows Render Layer to the Dilate/Erode node’s input. The Dilate/Erode node takes an image (in this case the Alpha channel of the Floor Shadows Render Layer) and either makes the lighter areas spill over the dark areas or makes the dark areas spill over the lighter areas, depending on the Distance value of the node. This is a very useful feature when you need to increase or reduce the edges of a mask. For now, keep its Distance value at 0.
3. Create a Mix node and connect the Shadow output of the Floor Shadows Render Layers node into the Mix node’s second Image input, and then connect the Mask output of the Dilate/Erode node into its Fac input.
The Shadow pass includes only the shadows of the floor, but the background is not transparent, it’s completely black. To fix that, mix the Shadow pass with a white-colored background, but input the Alpha of the Floor Shadows Render Layer into the factor of the Mix node.
The factor of the Mix node defines which areas of the top image will be visible, so it will make the background of the Floor Shadows Render Layer transparent and show instead the color of the first Image input of the Mix node.
Usually, you’ll get the white background, but at the edges, because they are not completely solid, you’ll see a little black border. Set the Distance in the Dilate/Erode node to -1 and the floor’s Alpha will shrink one pixel; then you won’t see those ugly borders anymore.
4. To give you the chance to learn something new, let’s use a different method to tint the shadows than the one you used for Blender Render. Add a new Mix node and plug the previous Mix node’s output to one of the new node’s Image inputs. The other Image input should have a white color. Make sure the Mix node’s blending mode is Mix. Now, when you change its factor value, you’ll mix a completely white image with the shadows, making them brighter. With this node, you’ll be able to control the brightness of the shadows.
5. Now add another Mix node. Connect the previous Mix node’s output to the new node’s first Image input and, in the second image input of the new Mix node, pick a blue color in the color selector. Set the blending mode to Overlay to mix the blue only in the dark areas. Now play with the factor to apply the desired amount of blue to the shadows.
6. Add the Movie Clip node to load the footage in the compositing.
7. Create another Mix node and set its blending mode to Multiply. Now connect the shadows’ resulting mix that was finished in step 5 to its second Image input, and the footage to its first Image input.
To add Jim to the equation, the process is exactly the same as in Blender Render. In Figure 14.11, you can see the whole node tree.
3.15.239.209