stencil buffer question


i have a few questions about the stencil buffer and his attitude.

I have delete my stencil buffer with 0 and a stencil mask 0xff. Now i decrement some values. Now what happens?
is the value there 255,-1, 1 or something else?

i have a problem with this in combination with shadow volumes.

thank you for your replys


It depends on what function you use to decrement the index. With GL_DECR, decreasing zero results in zero. With GL_DECR_WRAP, decreasing zero results in the maximum representable value.

Read the specification for more info.

thank you for the answer, i think this will help me!