Glass surfaces are treated as opaque by shadow rays #54006

Closed
opened 2018-02-05 21:53:39 +01:00 by Mircea Kitsune · 7 comments

Over the course of using the Cycles engine, I've constantly come across a major yet highly obvious issue. I'm not even sure if this is a bug per say, but I see no reason why it would be intentional so I'd have to assume it's a problem that deserves discussion.

Neither GlassBSDF nor PrincipledBSDF (with transmission) count as transparent surfaces to shadow rays. This results in glass surfaces casting shadows like fully opaque objects, even when the render option for transparent shadows is enabled. In my opinion this radically compromises realism by default and is an incorrect behavior of light rays.

Thankfully a simple workaround is possible: You can pipe shadow rays into a TransparentBSDF shader using a multiplier, which can be adjusted to match the strength of the shadow to the density of the glass. While this fixes the problem and offers the desired functionality, it still requires user intervention and many artists might not even be aware that it's needed and Cycles doesn't do it automatically.

I'll attach a render demonstrating this, as well as the node setup I used, with blend file included. All of the balls have the same shader and transmission value and roughness and opacity, only the multiplier for redirecting the shadow rays differs. As you can see, the rightmost ball has a dark shadow whereas the leftmost one has no shadow at all. I believe that by default, Blender should automatically estimate the shadow strength based on the settings of the material and achieve a similar result on its own.

Over the course of using the Cycles engine, I've constantly come across a major yet highly obvious issue. I'm not even sure if this is a bug per say, but I see no reason why it would be intentional so I'd have to assume it's a problem that deserves discussion. Neither GlassBSDF nor PrincipledBSDF (with transmission) count as transparent surfaces to shadow rays. This results in glass surfaces casting shadows like fully opaque objects, even when the render option for transparent shadows is enabled. In my opinion this radically compromises realism by default and is an incorrect behavior of light rays. Thankfully a simple workaround is possible: You can pipe shadow rays into a TransparentBSDF shader using a multiplier, which can be adjusted to match the strength of the shadow to the density of the glass. While this fixes the problem and offers the desired functionality, it still requires user intervention and many artists might not even be aware that it's needed and Cycles doesn't do it automatically. I'll attach a render demonstrating this, as well as the node setup I used, with blend file included. All of the balls have the same shader and transmission value and roughness and opacity, only the multiplier for redirecting the shadow rays differs. As you can see, the rightmost ball has a dark shadow whereas the leftmost one has no shadow at all. I believe that by default, Blender should automatically estimate the shadow strength based on the settings of the material and achieve a similar result on its own.
Author

Added subscriber: @MirceaKitsune

Added subscriber: @MirceaKitsune
Author
![shadows_render.png](https://archive.blender.org/developer/F2134555/shadows_render.png) ![shadows_nodes.png](https://archive.blender.org/developer/F2134557/shadows_nodes.png) [shadows.blend](https://archive.blender.org/developer/F2134559/shadows.blend)

Added subscriber: @brecht

Added subscriber: @brecht

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Brecht Van Lommel self-assigned this 2018-02-05 21:58:48 +01:00

Unidirectional path tracers are not good at rendering these types of caustics, and for that reason the transparent trick is the suggested workaround.
https://docs.blender.org/manual/en/dev/render/cycles/optimizations/reducing_noise.html#glass-and-transparent-shadows

We would like to have an automatic builtin solution for this, but it's not considered a bug.

Unidirectional path tracers are not good at rendering these types of caustics, and for that reason the transparent trick is the suggested workaround. https://docs.blender.org/manual/en/dev/render/cycles/optimizations/reducing_noise.html#glass-and-transparent-shadows We would like to have an automatic builtin solution for this, but it's not considered a bug.
Author

I'd still be curious why shadow rays can't be probabilistically terminated upon touching a glass shader, based on the transparency value of the glass at that pixel. Even if it's based on estimation and not fully realistic, couldn't at least an option for that be added in the meantime?

I'd still be curious why shadow rays can't be probabilistically terminated upon touching a glass shader, based on the transparency value of the glass at that pixel. Even if it's based on estimation and not fully realistic, couldn't at least an option for that be added in the meantime?

The automatic solution I was referring to would likely work something like that, it's just not a bug not to have that feature.

The automatic solution I was referring to would likely work something like that, it's just not a bug not to have that feature.
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 project
No Assignees
2 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#54006
No description provided.