Shadow casters are rejected earlier if their shadow casting is disabled

From the Unity 2021.2.0a17 release notes:

What’s not clear to me is whether it improves performance when I disable shadow casters that are outside the Shadow Drawing Distance (option found in Player Settings > Quality)?

Because of the heavy impact of shadow caster / renderer culling, we wrote our own system that would just disabled the objects based on placement, distance and our own culling groups. I’m interesting to see if this would improve the situation for us.

Which reminds me… a few years ago I reported that Occlusion Culling does not cull shadow casters. The Camera is in-front of a wall, but Unity renders all the shadows behind that wall which aren’t visible. Basically Occlusion Culling “works 50% only”.

At the time I reported the issue, you choose to not fix it:

However, since you’re working on Shadow Caster Culling now, perhaps you can reconsider to fix this issue too. Use the opportunity.

1 Like

To be fair, shadow caster culling is pretty complicated: depending on the position of the light you would have to extrude the bounding box of the object and then check that against the occlusion data. That’s way more complicated than just simple box intersection check. It’s doable but I guess it’s not the focus for them right now.

We did this manually for our game objects with Culling groups as we knew what the light’s angle was, so we could just approximate if the object’s shadow is visible in the camera or not. At the end of the day, you have way more information about the composition of your scene and how the objects move, so you can enforce a better culling system. Unity has to paly it safe and avoid any rendering errors whatever the objects’ positions are.