Skip to main content
12 of 17
added 141 characters in body
user avatar
user avatar

UPDATE:

As of Version 2.79 Cycles has an option to make an object a shadow catcher.

enter image description here

From the release notes

This option will make object to only receive shadows in a way that it could be alpha-overed onto another image.

So just make the plane a shadow catcher and render!

enter image description here

OLDER ANSWER:

You can do a shadow catcher using a shadow pass and different render layers to create an alpha channel for the scene:

enter image description here

  • Move the plane object (shadow catcher) to layer2.

  • Make a copy of the other objects and move them to layer 2.

The idea is that on layer 1 you only have your objects but not the plan, and on layer 2 a copy of your objects and the plane that will act as shadow catcher.

enter image description here

  • On all of the objects in layer 2, except for the shadow catcher plane, disable Ray visibility for camera. You want the plane to be visible, but the other objects should be transparent to camera and projecting shadows on the plane:

enter image description here

  • Make sure your lamps and camera are active in layers 1 and 2.

enter image description here

  • Set up two render layers:

    One for the objects in layer 1 that excludes information from layer 2.

    A second render layer for the shadows that includes a shadow pass and excludes layer 1.

enter image description here

  • Enable Transparent on the Film section.

enter image description here

  • In the compositor you can use the shadow pass to alter the values of the alpha channel of the object's layer.

Add an invert node to shadow pass and plug the result as factor on a mix node (in add mode). Plug the alpha channel of the object's layer to the top socket and leave the lower socket empty.

enter image description here

You can control the transparency of the shadows by changing the color on the empty socket of the mix node. If you make that color white the shadows will be fully opaque, if you make it black you'll have no shadows.

Alternatively you can use the values from the shadows layer and the transparency of the shadows will be set using the values from the original scene:

enter image description here

For softer shadows you can add some blur:

enter image description here

user1853