[Shadow Volume] Why models should be closed?

I have read “Practical and Robust Stenciled Shadow Volumes for Hardware-Accelerated Rendering”.

And they wrote: “Unless specially handled, such polygonal models must be closed (2-mainifold)…”

Why? Where is the problem?

You’ll end up with irregularities in the shadows, and long lines of shadow which shouldnt exist appearing in places.

It is very simple to overcome this though, so dont let it bother you too much.

DopeFish : how do you overcome this so simply ?

But what’s the source of the problem?

The pb is what’s called a T-junction. See this picture : http://tfpsly.planet-d.net/Files/Tjunction.gif

Even if the edges AE,EC and AC are aligned, due to computation roundup, the planes that you cast through these edges will not be exactly the same and they won’t compensate themselves.


The critically important thing is that the shadow volume be closed.

It’s convenient to make this happen if the models from which shadow volumes are generated are closed, but as DopeFish points out, it’s easy to work around if that’s not the case.

Note: You might think that shadow volumes need not be closed in the case of zpass since you don’t render the caps. However, it’s better to think of that of an optimization, since the caps simply wouldn’t affect the stencil count in zpass.

T-junctions are an issue only insofar as they cannot be guaranteed to produce closed (water-tight) shadow volumes.

Thanks -