View Full Version : Stencil Buffer Problem
02-19-2003, 07:55 AM
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
02-19-2003, 07:57 AM
Did you remember to request a pixel format with a stencil buffer?
02-19-2003, 08:03 AM
02-19-2003, 08:55 AM
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.
02-19-2003, 09:28 AM
hmm, i'm using GLUT with GLUT_DOUBLE... and GLUT_STENCIL
reading the stencil buffer using glReadPixels(...) showed something was written.
02-19-2003, 09:43 AM
What does glGetIntegerv(GL_STENCIL_BITS, &val) return?
02-20-2003, 02:31 AM
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?
02-20-2003, 02:56 AM
Using the right stencil operations?
02-20-2003, 05:50 AM
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 (http://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 )
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.