Page MenuHome

Shadow catcher refactor to support indirect light
Confirmed, NormalPublicTO DO

Assigned To
None
Authored By
Dalai Felinto (dfelinto)
Oct 31 2019, 9:22 PM
Tokens
"Love" token, awarded by psychoboy852."Love" token, awarded by danilo_dias."Love" token, awarded by proulxpl."Like" token, awarded by theJesusHorse."Love" token, awarded by Malmqvist."Like" token, awarded by Guido."Love" token, awarded by ReinhardK."Love" token, awarded by thecoda."Like" token, awarded by Floatharr."Love" token, awarded by MrMargaretScratcher."Like" token, awarded by Striletsky."Love" token, awarded by GageChristopherRenn."Like" token, awarded by Arkhangels."Love" token, awarded by Nicistarful."Burninate" token, awarded by 3Rton."Like" token, awarded by Schamph."Love" token, awarded by Chrischan."Like" token, awarded by Fracture128."Like" token, awarded by Piquituerto."Love" token, awarded by aliasguru."Love" token, awarded by xdanic."Love" token, awarded by dpdp."Love" token, awarded by sam_vh."Like" token, awarded by dark999."Love" token, awarded by juang3d."Like" token, awarded by EAW.

Description

More details here:
https://devtalk.blender.org/t/lets-finally-fix-the-shadowcatcher/691

If any developer from the Render & Cycles team is interested on this, please bring the content from devtalk to here, in a tangible way. If not we can just remove this task, honestly.

Small note: "An efficient GPU implementation is not straightforward, though it can be solved probably" -- Brecht

Event Timeline

I've attempted summarising the DevTalk post. Of course the original article and its reactions contain much more information - and a bit of sidetracking - but I've tried to condense the gist of it as best I could. With just a hint of personal opinion here and there.

Primary and secondary rays on the shadow catcher

  • The shadow catcher obviously appears to capture occlusion and shadows, but ignores any colour contributed to by scene lights and the World.
  • Emission shaders and secondary bounces from other objects are ignored as well. This includes diffuse colour bleeding and glossy reflections.

Shadow catcher as seen in secondary rays on other objects

  • In secondary rays on other objects, the shadow catcher is seen with its original material, instead of a camera mapped backplate or environment map.
  • This camera mapping is necessary on a per frame basis and therefore can't be expected to be done by the user.

Suggestion: Shadow Catcher BSDF

  • Basically a Principled BSDF whose primary rays are invisible to the camera.
  • Automatic camera mapping of the backplate or environment texture, and usage of this when seen in secondary rays on other objects.

Storage
The render result of a shadow catcher layer is quite complex as it needs to contain all of the above in a single image. This means that a pixel's colour and its opacity are not at all guaranteed to be aligned. A popular workaround is to split shadows/occlusion and emission/GI, and respectively multiply and add those layers onto the backplate, but I believe it's easily possible to store the complete result with premultiplied alpha, and composite without a hassle.

Suggestion: Shadow Catcher BSDF

  • Basically a Principled BSDF whose primary rays are invisible to the camera.
  • Automatic camera mapping of the backplate or environment texture, and usage of this when seen in secondary rays on other objects.

The Shadow Catcher BSDF could be interesting, but it's not the best Shadow Catcher implementation, because with shadow catcher you still need the light bounces affecting the objects.

Don't think about the shadow catcher just for plate compositing, shadow catcher is useful in many situations, think of a scene with an animated background and a character moving, you can render the animated background in render pass, and the characters in another pass, with all the set being enabled as shadow catcher, you get the character (together with it's shadow and how it affects the environment) in a separate pass, if you have to modify the character it's easy, just re-render the character pass and recompose it. Right now that's not possible at all, because the shadow catcher don't catch reflections, or light contribution from the character to the scenario.

As you said in the original devtalk thread is very well explained, but the BSDF, while could be good as an option, is not the desirable behaviour in general. The "Shadow Catcher" tag for the object is much more useful :)