unreal
December 16, 2004, 3:30am
1
well… I was trying to make two_side_stencil EXT work…
Until now I was doing this for rendering shadow volumes:
http://rafb.net/paste/results/IKd7B616.html
and is was working perfectly.
now i try to do this:
http://rafb.net/paste/results/PBFUPf60.html
but I can’t see the shadow! the shadow does not appear!
My card(well its not mine. I must give it back in 3 days! ) is an nVIdia 6800. It supports GL_EXT_stencil_two_side and GL_EXT_stencil_wrap extensions.
I also have setup the extension correctly.
what i do wrong?
thanks in advance
You probably still have backface culling on or something.
Twixn
December 16, 2004, 7:18pm
3
Try swapping:
glActiveStencilFaceEXT(GL_FRONT);
glStencilOp(GL_KEEP, GL_DECR_WRAP_EXT, GL_KEEP);
and
glActiveStencilFaceEXT(GL_BACK);
glStencilOp(GL_KEEP, GL_INCR_WRAP_EXT, GL_KEEP);
so that GL_FRONT is the active face when rendering volumes, that solved a problem i had that resembled yours.
Twixn
unreal
December 16, 2004, 11:16pm
4
guys thank you!
thats it!
I must have the GL_FRONT to be active when render the shadow volumes. thank you.
I have a little speed boost now. for the shadow volumes for 20 spheres, I had 33fps and now I get 38fps. Pretty good “optimization”.
Twixn
December 18, 2004, 12:09am
5
Are you using a Vertex shader/program to extrude the shadow object on the hardware?
Twixn
unreal
December 18, 2004, 12:23am
6
No I don’t.
But I will if I can and when i finish everything else in the engine.
Twixn
December 18, 2004, 1:21am
7
Well, its another way to squeese more fps out of two sided stencil, and its something to consider. Post a Question here anyway when u feel like it, someone will point u in the direction of some tuts.
Twixn
Just FYI, the ATI_separate_stencil (no ATI cards as far as I know support EXT_stencil_two_side) path for the same thing is…
glStencilFuncSeparateATI(GL_ALWAYS, GL_ALWAYS, 0, ~0);
glStencilOpSeparateATI(GL_BACK, GL_KEEP, GL_INCR_WRAP_EXT, GL_KEEP);
glStencilOpSeparateATI(GL_FRONT, GL_KEEP, GL_DECR_WRAP_EXT, GL_KEEP);