PDA

View Full Version : [Shadow Volume] Why models should be closed?



greg2
01-14-2004, 12:54 AM
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?

DopeFish
01-14-2004, 02:14 AM
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.

SeskaPeel
01-14-2004, 03:03 AM
DopeFish : how do you overcome this so simply ?

greg2
01-14-2004, 04:07 AM
But what's the source of the problem?

tfpsly
01-14-2004, 05:07 AM
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.

greg2
01-14-2004, 06:07 AM
Ok.
Thanks.

cass
01-14-2004, 06:22 AM
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 -
Cass