View Full Version : shadow

09-09-2003, 11:52 PM
how would i go about tagging areas of a scene as shadowed so I can build up the lit areas easily. Im using shadow maps and the most obvious answer to me would be to use the stencil buffer but how do would i get the shadowed areas from the depth map comparision?

09-10-2003, 02:26 AM
I am also interested in this since I would like to do shadow mapping and light projection.
For shadow mapping, I will investigate a bit in the next few days, I have a line of code which takes something like...


As soon as I understand what's going on I will tell how to do it in the fixed function pipe.

Errm, how to do shadow mapping in programmable fragment pipes?

09-10-2003, 03:23 AM
i already have shadows and my illumination model implemented, im not concerned with those details....im just trying to extend what i have to include multiple lights and a single ambient pass....but i cant put the shadow info into the stencil buffer

Tom Nuydens
09-10-2003, 03:32 AM
If your lighting model (including shadows) won't otherwise fit in a single pass, you can put the shadows for each light into destination alpha. You then render the light with (GL_DST_ALPHA, GL_ONE) blending.

If your entire lighting model does fit in a single pass, you have no problem. Just render all lights with (GL_ONE, GL_ONE) blending and you're done.

-- Tom

09-10-2003, 03:56 AM
mmm, my entire lighting model is not one pass (in general) but ill try the alpha thing...thanks.