Improve Cascaded Shadows in corners

Hello guys,

I am struggling with cascaded shadows again :frowning:

I am still not able to fix the shadows for corners. There is always some space left from being effected by the shadow so the light goes through the object. Decreasing the bias helps but the corners are still not completely covered by the shadow and decreasing the bias leads to more artifacts (I forget the name of this weird pattern all the time :sweat_smile:) at the illuminated parts.

Is there a way to fix this and to use shadows without illuminated corners and without artifacts?

I already narrowed the camera range, set autoCalcDepthBounds = true, etc.

I created a pg: https://playground.babylonjs.com/#0ZII1T#8

Best

I don’t know other solution for light leaking than having thicker walls.
It happens because of float precision and geometry.
Basicaly, in the corners, the depth value is almost the same for the wall and the ground.
Tweaking bias is not helpful in this case. It mostly meant for reducing acne effect.

5 Likes

@Evgeni_Popov might have some crazy tricks but like @Cedric I am not sure there are a lot to do :frowning:

@Cedric That’s smart! Works like a charm. Good to know, this will fix a lot of my shadow issues. :slight_smile:

2 Likes

Yes, @Cedric solution is the right one I think, I don’t see how to fix that otherwise.

2 Likes