Hi there,
i’m currently playing with Stencil Shadows. So far it works fine, if i render my shadow volume to the screen it looks right.
if i render it to the stencil buffer and render the stencil buffer nothing happens.
Although i’m quite sure the stencil setup is ok. Even if i’m writing to the stencil buffer directly via glDrawPixels nothing happens
Any ideas?
Yeah at one time I had this problem when I wrote my first shadow volume program demo. I was sure I requested 8 bits of stencil. I just KNEW I was doing so. Well turns out I really WASN’T! My OpenGL framework class was broken and I wasn’t aware of it. So make certain you are requesting 8 stencil bits. Also check and make sure you really are getting the pixel format you are requesting. If all that is ok, then there must be a problem with your stencil funcs somewhere.
hi. i get 8 bit for the stencil buffer.
so : if i render my shadow volume and it looks right, and i can see it, and it is cutting other objects : so my geometry is right?
hi again.
so, now stecil buffer works. but i still have problems with the shadows =)
(here’s a pic: www.code-guru.de/pics/debug_shot.jpg )
it looks like the light if moving if i rotate the object, although i’m reversing the rotate-calls before calculation light position in world space (via light_obj_pos * MODELVIEW_MATRIX )