View Full Version : Stencil Buffer values

10-21-2003, 09:26 AM
If the stencil test passes in the following stencil function what value is written to the stencil buffer 4 or 0?


4 right? because the mask just affects the comparison between the present stencil buffer value.

10-21-2003, 01:56 PM
The value is 4 because you have your stencil op for when the stencil test passes set to GL_REPLACE. GL_REPLACE simply replaces the current value in the stencil buffer with the reference value.

10-21-2003, 02:08 PM
Thanks, ioquan.

I have another question that I posted in the advanced forum and no one has given me feedback, perhaps you could.

10-21-2003, 02:30 PM
I saw your question there but wasnt sure what you were trying to ask. Can you restate/simplify your question?

edit: I looked at the link to the .txt file. That is using the two sided stencil extension. Is there a reason why you want to use the two sided stencil extension?

[This message has been edited by ioquan (edited 10-21-2003).]

10-22-2003, 04:46 AM
I wasn't looking into using the two sided stencil extension. I was just trying to understand how to set the stencil values. So I followed the logic and it didn't work like it said it should work. Hope that makes sense.

Basically, I found an error in the documentation and I wanted to share and make sure I was not wrong.

10-23-2003, 06:16 PM
No, you didnt find an error. You found documentation on the two sided stencil, and expected to operate the same way as normal one sided stenciling.