14
$\begingroup$

I composite 3 individually rendered and saved files to achieve the look of an object isolated on white with a proper shadow:

  1. image file of object floating with alpha background
  2. image file of a render of the empty background plane
  3. image file of the background plane containing the object with the object's camera visibility unchecked (so it's an empty plane that also has the object's shadow)

I use the compositor to divide the shadowed plane by the empty plane to get a white image containing only the shadow, then alpha over the object with the transparent background

Compositing setup

This is not ideal, because I'd rather not have to open a new blend file just to do a simple divide and alpha over. I would prefer to build this functionality into the original blend file using scenes and render layers. Yet every time I try this, as described in the wiki here, I misunderstand and configure my multiple scenes/render settings improperly.

How do I setup my scenes and render layers properly to achieve the above image without having to save separate files?

$\endgroup$
16
$\begingroup$

Cycles

Here is an example file for you to inspect.

The wiki page for Renderlayers in cycles:

Render layers are used to render different objects in the scene into different images. This way they can, for example, be color corrected or otherwise manipulated separately and then recomposed in compositing later.

Which objects contribute to which render layers are defined by these layer settings:

  • Scene Layers: only objects on these layers will contribute to the image.
  • Camera Layers: objects on these layers are directly visible to the camera. When an object is in the scene layers but not camera layers, it will still cast shadows or be visible in reflections, so it's still indirectly visible. This is equivalent to disabling the Camera in the Ray Visibility panel for the object. The way this works may be somewhat confusing at first, but it's designed such that render layers can be recomposed to give the full render, without any missing shadows or reflections.
  • Mask Layers: objects on these will mask out other objects appearing behind them. This is equivalent to assigning a Holdout shader for camera rays to the objects on such layers.
  • Exclude Layers: scene layers are shared between all render layers; however sometimes it's useful to leave out some object influence for a particular render layer. That's what this option allows you to do.

The object is on Scene layer 2, the lights are on Scenelayer 3, and the background is on Scene layer 4.

Transparent is enabled in Properties > Film:

enter image description here

And RGBA is enabled in Output:

enter image description here

The settings for each Renderlayer:

For the Renderlayer to result in only the object, we need to include the lights and the object layers, and disable the background layer (we don't want to exclude entirely, because we want the bounce lighting on the bottom of the object):

Object layer Object Result

For the Background, the lights and background layers are enabled, and we exclude the object layer entirely, as we do not want shadows:

BG layer BG result

This one is the same as BG, except we don't exclude the object layer, so shadows cast by our object will be visible:

enter image description here enter image description here

Compositing

Replace the image inputs in your setup with the appropriate Renderlayers:

Composite setup

Result:

final result

$\endgroup$
  • 1
    $\begingroup$ This is an exceptionally clear example and explanation, Gandalf. Thank you :) Most of my confusion came from the shared scene layers/exclude functionality, this cleared it up. $\endgroup$ – Qutorial Sep 20 '13 at 3:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.