PDA

View Full Version : Shadow volumes



davekerr
11-17-2002, 10:57 AM
Hi, I have an OpenGL app that I want to add shadows to. I have got it so that at any time I have an array of polygon objects that represent the shadow volumes (calculated for each light) but where do I go from here? How do I draw the scene so that anything whithin one of these volumes is darker? I've looked around the net for info, but haven't found anything that seems to work.

SirKnight
11-17-2002, 01:10 PM
Nvidia's dev site has many many docs on this. Take a look at their infinite shadow volume paper. From reading that paper it didn't take me long to understand this technique better and implement.

-SirKnight

rIO
11-19-2002, 04:01 AM
Shadows algho explaination for dummies. :P

Imagine to have a SPHERE, then the stencil shadows works like :

1) Pick a paper sheet.
2) Roll it on the sphere to form a cylinder.
3) Imagine this cylinder is the extrusion of the silouette of the sphere. (visible borders of the sphere seen from the light source).
4) Then look at the paper cylinder from the camera point and imagine to draw only the visible side in a buffer (sides facing you).
5) Now imagine to delete the old buffer using the hidden faces of the same cylinder.
6) What still remains is in the buffer is exactly the shape of the shadow cast from the sphere.

Fill that shape with your preferred method...
using stencil buffer could be helpfull...

http://www.opengl.org/discussion_boards/ubb/smile.gif

ok, ok, this is just really to have an idea on how it all works....