8
$\begingroup$

Is it possible to distinguish between shadows viewed directly from the camera, and shadows seen in the reflection of an object?

For example, the shadows circled here:

enter image description here

From the cameras's perspective, I'd like the tile to disappear (along with its shadow, diffuse effects, etc).

If I make the tile transparent for camera rays, shadow rays, and diffuse ray, I get this:

enter image description here

I'd like the shadow to be visible in reflections though. If I remove shadow rays from my transparency condition, I get this:

enter image description here

So here's what I'm trying to achieve:

enter image description here

Is there a way to determine whether the shadow is viewed directly from camera, or if it's being viewed through a reflection?

$\endgroup$
  • $\begingroup$ I'm pretty sure the only way I can do this is with by duplicating my scene, tweaking the materials for the two transparency conditions, render twice, and combine in the compositor.. I find this sort of thing very difficult to maintain, so I'd love if someone can come up with a different solution! $\endgroup$ – ajwood Apr 1 '14 at 17:49
2
$\begingroup$

So for this I would use render layers. This means you can't really view the effect 'live' in the viewport, but it will be applied when rendered and composited.

I have 2 render layers:

  • Render layer 1, called 'Main', renders layer 1 which holds the sphere and light only.

enter image description here

  • Render layer 2, called 'Floor', renders layer 2 which is the floor object and excludes layer 3, which is the red plane.

enter image description here

'Transparent' must be enabled in film section of the Render tab to allow layers to be composited together.

enter image description here

Note: All 3 scene layers should be made visible before rendering. All 3 layers are required, the render layers take care of what appears in the render.

'Main' render layer will only include the sphere, but will still be effected by the other layers, so will include the plane and floor in the reflection.

'Floor' render layer will only include the floor object and will only be effected by layer 1 because red object is excluded on layer 3.

These render layers can then be combined in the compositor:

enter image description here

Which results in:

enter image description here

$\endgroup$

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.