Cycles shadow catcher improvements #71253

Open
opened 2019-10-31 21:22:14 +01:00 by Dalai Felinto · 25 comments
  • Indirect light support
  • Option to include/exclude lights
  • Dedicated shadow catcher pass
  • Dedicated compositor node for easier setup
  • Separate shadow and reflection passes
  • Shadow catcher behind sharp reflection and refraction?
  • Optimization to share more shader evaluation and sampling until path diverges?

devtalk thread with user feedback

- [x] Indirect light support - [x] Option to include/exclude lights - [x] Dedicated shadow catcher pass - [ ] Dedicated compositor node for easier setup - [ ] Separate shadow and reflection passes - [ ] Shadow catcher behind sharp reflection and refraction? - [ ] Optimization to share more shader evaluation and sampling until path diverges? [devtalk thread ](https://devtalk.blender.org/t/lets-finally-fix-the-shadowcatcher/691) with user feedback
Author
Owner

Added subscriber: @dfelinto

Added subscriber: @dfelinto

Added subscriber: @xdanic

Added subscriber: @xdanic

Added subscriber: @Piquituerto

Added subscriber: @Piquituerto

Added subscriber: @SteffenD

Added subscriber: @SteffenD

Added subscriber: @frameshift

Added subscriber: @frameshift

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.

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.

Added subscriber: @cschumann

Added subscriber: @cschumann

Added subscribers: @Sergey, @brecht

Added subscribers: @Sergey, @brecht

This comment was removed by @frameshift

*This comment was removed by @frameshift*

Added subscriber: @Nicistarful

Added subscriber: @Nicistarful

Added subscriber: @Striletsky

Added subscriber: @Striletsky

Added subscriber: @MarkSutton

Added subscriber: @MarkSutton

Added subscriber: @juang3d

Added subscriber: @juang3d

In #71253#806621, @frameshift wrote:
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 :)

> In #71253#806621, @frameshift wrote: > **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 :)

Added subscriber: @SamGreen

Added subscriber: @SamGreen

Added subscriber: @BetaMovement

Added subscriber: @BetaMovement

Added subscriber: @BeckersC

Added subscriber: @BeckersC

Added subscriber: @ReinhardK

Added subscriber: @ReinhardK

Added subscriber: @theJesusHorse

Added subscriber: @theJesusHorse

Added subscriber: @Dragon.Studio

Added subscriber: @Dragon.Studio

Added subscriber: @blownchunks

Added subscriber: @blownchunks

Just for the record, the shadow catcher has been refactored in the cycles-x branch and the support of indirect light should be there. There are still some remaining topics about the shadow catcher mentioned in #87837. We are working on them.

Just for the record, the shadow catcher has been refactored in the cycles-x branch and the support of indirect light should be there. There are still some remaining topics about the shadow catcher mentioned in #87837. We are working on them.
Brecht Van Lommel changed title from Shadow catcher refactor to support indirect light to Cycles shadow catcher improvements 2021-08-20 16:55:11 +02:00

Added subscriber: @ioioiofilip

Added subscriber: @ioioiofilip

Added subscriber: @Memento

Added subscriber: @Memento

Added subscriber: @JamesBarrie

Added subscriber: @JamesBarrie
Brecht Van Lommel added this to the Render & Cycles project 2023-02-07 19:08:06 +01:00
Thomas Dinges added this to the 2.90 milestone 2023-02-08 16:25:01 +01:00
Philipp Oeser removed the
Interest
Render & Cycles
label 2023-02-09 14:01:34 +01:00
Brecht Van Lommel removed this from the 2.90 milestone 2023-03-23 18:21:06 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
21 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#71253
No description provided.