View Full Version : I'm sure it's already somewhere...

11-17-2005, 09:12 PM
But I hit the 200 result limit, even when I refined my search as much as possible.

I just wanted to verify what I think is the correct way to handle multiple lights with stencil shadow volumes.

Render to z-buffer
for each light source
<font size="2" face="Verdana, Arial">calculate shadow volumes draw them to stencil buffer draw lighting with depth test at GL_EQUAL, blended with (GL_ONE,GL_ONE)
</font> draw final texture pass
<font size="2" face="Verdana, Arial">The only bit that I wanted to verify was the lighting pass. Is that the right way to handle that, or am I mixing bits and pieces together the wrong way?

11-17-2005, 10:11 PM
You can transport a step_3 in a step_1.

11-17-2005, 10:18 PM
The plan was to add all of the lighting contributions, then use GL_MODULATE for the final texture pass, I left it out to simplify the flow chart.

But the chunk for the lighting contributions is correct? That's really the only bit I was worried about.

My only other question is in regards to fragment shaders. Will blending still work correctly if I use a shader, or will I have to implement that on my own as well?

11-17-2005, 10:46 PM
I think what the chunk for the lighting contributions is correct. And blender would be working correct.

11-18-2005, 01:14 AM

11-18-2005, 02:52 AM
If number of lights is one, then the object who shadowed is black. But ambient or emission light?

11-18-2005, 06:21 AM
The ambient will go in the first pass, if it's needed. It'll be determined per-scene, depending on the environment.

Thanks for the replies everyone, I'll probably be back with more questions later, but ta-ta for now.