Page MenuHome

Shadow, Reflection, and Refraction passes misbehaving when used together
Closed, ArchivedPublic

Description

*Takes a bit of detail and demonstration to describe, but the short answer is that separation of shadow, reflection, and refraction passes (at the same time) does not work.

Setup of the .blend file:

3 distinct scenes:

1 has an opaque uv sphere placed over a plane with ray mirror reflection.

2 has a ray-transparent uv sphere placed over a plane WITHOUT reflection

3 has a ray-transparent uv sphere placed over a plane WITH ray mirror reflection

(scene 3 is a combination of 1 and 2)

Also note that when separating render passes from the Combined pass, I AM omitting those passes from the combined pass.

My naming convention for the scenes is such that the enabled render passes are in parenthesis after the scene name.

Any time I enabled transparency, I set alpha to 0.5. And reflectivity set to 0.5 when enabled.

I'll go through each scene one-by-one to demonstrate the problem(s).

In the compositor for each scene, I compare my composite with Blender's composite using the Difference operator.

***1 ReflOnly (Refl)***
(meaning reflection is enabled on plane and reflection pass is enabled)

Adding reflection pass to Combined pass produces black after the Difference node (Great! This works! Image is identical to Blender's composite.)

***1 ReflOnly (Shad)***
(same "scene" but now ONLY the shadow pass is separated)

Combined pass is multiplied by the shadow pass. Difference node is NOT black. This is OK actually! It can be shown that if you want to use the shadow pass, you also must separate the specularity pass and add it to the composite AFTER multiplying the shadow. This works fine then.

***2 RefrOnly (Refr)***
(2nd "scene" with only the refraction pass separated from Combined)

Refraction pass is Added to the Combined pass. Result from Difference node is black. Great! Refraction works by itself. (I'll prove the point soon. Just control tests here.)

***3 Both (ReflRefr)***
(3rd "scene" with both reflection and refraction activated. Refl and Refr are the only passes separated)

The passes are Added in sequence and Difference yields black. So Refl and Refr passes work if they are the only ones extracted. Good!

***3 Both (ReflRefrShad)***
[This is just present to prove the point about needing to separate the specularity if you want a shadow pass. Compare with the scene below for proof.]

***3 Both (ReflRefrShSp)***
(3rd "scene" with reflect, refract, shadow, and specularity passes separated)

Shadow multiplied, Specularity added, Reflection and Refraction added.

PUNCHLINE: Difference node shows blue area in the sphere's shadow area! The composite of this scene should be identical to the result from "3 Both (ReflRefr)" but it is not.

***3 Both (Shad)***
(This scene has only the shadow pass separated)

Inspect this result and you will see that it is not adequate to only separate out the shadow pass (and spec) IF there is reflection and refraction in your scene. You MUST also separate reflection and refraction passes as in the scene above. This is fine, but what does this mean? The above scene, "3 Both (ReflRefrShSp)" should be the proper way to separate the render passes if you have reflection and refraction in your scene _AND_ you wish to alter the shadow pass. Yet this does not work.

THE BOTTOM LINE is that it should always be possible to separate all render passes and recombine in a way that does not change the original image. At the moment some compositing operations are useless since the result is not predictable.


***OS***
32 bit Ubuntu 10.04

***Hardware***
Intel Core Duo
2048 MB RAM
nVidia GeForce Go 7400

***Blender Version***
v 2.53 Beta and also r30426

Event Timeline

It's impossible to separate shadow + reflection/refraction correctly, the question is which of two suboptimal solutions do you pick. Either you let the reflection/refraction include shadows even if shadow is set to be excluded, or you exclude shadows there as well and are no longer are able to recombine the image using passes. Which of the two is the better solution can be debated, and the pass exclusion/combination math could be reviewed once, but currently Blender simply does the latter and this is not considered a bug.

Brecht Van Lommel (brecht) changed the task status from Unknown Status to Archived.Jul 26 2010, 12:14 PM