Advertisement

Stencil shadow volumes

Started by November 06, 2020 12:30 AM
11 comments, last by taby 4 years, 3 months ago

taby said:
@JoeJ Those sound like good ideas to try, but I'm not sure how to implement them. :(

Shadow bias is very important, but also a matter of manual tweaking, sadly.

It aims to prevent quantization artifacts that come with rasterizing to a discrete grid of SM texels. Tutorial and images here: https://learnopengl.com/Advanced-Lighting/Shadows/Shadow-Mapping​

If all your objects are closed manifolds like your quaternion fractals, you can use either the front faces or the back faces:

Both the red front faces and the green back faces create the same shadow volume (outside of the object interior which we are not interested in).

But the front faces create shadow akne on themselfs, so you need a bias to smooth that out (and accept some peter panning and leakage).

When using back faces to cast the shadow, the akne happens on the other side, which becomes invisible because we know the back faces are not visible from the light so they must be in shadow. This way you might get away with no or a smaller bias.

Ofc, if your scene contains non manifold geometry (grass, leaves, cloth, partial facades of buildings… in practice often pretty much everything), this becomes much less attractive to use. I guess games use this backface trick very rarely nowadays.

I also think many current games do screenspace contact shadows to resolve peter panning, which seems the best way to deal with unavoidable SM imperfection.

 

 

 

Thanks for all of the help, you guys. I appreciate the transfer of knowledge!

This topic is closed to new replies.

Advertisement