View Full Version : shadow volumes

11-20-2002, 06: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.


11-21-2002, 01: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.

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

11-22-2002, 01:53 AM

11-22-2002, 11:55 AM
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.