Page MenuHome

Glass surfaces are treated as opaque by shadow rays
Closed, ArchivedPublic


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.



Event Timeline

Brecht Van Lommel (brecht) closed this task as Archived.
Brecht Van Lommel (brecht) claimed this task.

Unidirectional path tracers are not good at rendering these types of caustics, and for that reason the transparent trick is the suggested workaround.

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

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.