PDA

View Full Version : shadow volumes



helda
11-20-2002, 07:36 AM
Hello guys,
i have a little problems with shadow volumes. I have drawn my shadow volumes and the shadow is ok, but my object who throws the shadow is in the shadow too. I think i have to close the shadow volume.
I have drawn the object with incrementing the stencil buffer after i have drawn the shadow volumes, but it has no effect.
Later i have test to render the scene with lighting (shadow volumes without closing) and the stencilfunc
glStencilFunc(GL_EQUAL, 1, 0xff);
and my object is in the light. But normally the stencil value of my object should have a value like -1 or 255 or something like that.

perhas someone can help me, thanks.

helda

dawn
11-21-2002, 02:10 AM
I guess you should draw the beginning and ending caps of the volume (to close it). So, if you want that the obj not to be in the shadow you close the volume with the faces that are oppossite to light.

rgpc
11-21-2002, 07:39 PM
Just a suggestiong but gamasutra has an excellent article on shadowing (probably still on the front page...).

dorbie
11-22-2002, 02:53 AM
http://www.gamasutra.com/features/20021011/lengyel_01.htm

PH
11-22-2002, 12:55 PM
Yes, that's an excellent paper. I implemented the algorithm presented in the scissor section. We've had discussion about just that - using a sphere to calculate the scissor rectangle. The section does contain a few errors ( typos in the formulas ). I ended up doing all the calculations which I would recommend for others who plan on implementing it ( it helps to understand it ).

Anyway, Cass and Kilgards paper also contains everything you need to get started.