In this tutorial we will be making use of renderlayers for compositing various elements in a scene.


Setting up the scene:

Place objects in different layers.

Plane, Cube/Monkey, Lamp1, Lamp2, Hemi-Lamp in layers 1-5 respectively

Add materials/textures.


Setting "Ambient Occlusion" settings:

I have chosen "Both" option and raised the energy level to 3.0

You could raise the number of samples to more than 6 to avoid noisy shadows.



Setting up render-layers:


From the render-layers panel we will now be setting up 3 layers. One for the Plane with shadows, one for Cube and Monkey and the third for contact shadows of the Cube and Monkey on the Plane.

First thing in the Render Layers panel are 20 layer-buttons, which when selected signal the renderer to utilize objects present in there.

 

ScnContactShad render-layer:                                       

In the layer-set buttons below the render-layer name entry we choose the Plane and the hemi-light layer (holding SHIFT-KEY to select multiple layers) and enable the ambient-occlusion pass (AO).


Scene contact shadows with the objects masked out.





GroundShadows render-layer:

For this layer we choose layer 1 (with the plane) and layers 3 & 4 with the two lamps.



















Base render-layer:























Compositing all the layers:
 
Finally using the above node network we composit all the rendered layers. Layers are post-processed (blurred, enhanced, color-corrected using appropriate nodes )
 

Darken the contact shadows using RGB-Curves node.
 
 
 
 
 
 
 
 
 
 
Blur the shadows using a Blur node. 
 
 
 
 
 
 
 
 
 
 
Mix the previous 2 images
 
 
 
 
 
 
 
 
 
 
Use a HSV node  to control saturation and value.
 
 
 
 
 
 
 
 
 
And finally by composting the previous two images we get the output composite.
 

 
After writing this report, i realized there are better ways to composit the image. Will post the results shortly.
 
Thank you for reading so far. :)
 
Tips and tricks: 

NOTE: Under construction. 

  • Saving the render buffers to .exr files.
  • Using the partial-composit feature in the Image editor window.