Archived

This topic is now archived and is closed to further replies.

iwaskia

stencil buffer problem

Recommended Posts

i am confused with the things i have read....... as i understand(or misunderstand), pixel of the color buffer will be draw only when the stencil value is even, then what is the different between GL_INCR, GL_DECR and CL_INVERT ? they are just the same. except 0 and max clamped.

Share this post


Link to post
Share on other sites
the determination whether the pixel will be drawed to the color buffer can be set by glStencilFunc. With glStencilOp you can set the operation that is done when writing to the stencil buffer. So usually you want to draw to the stencil buffer first and then draw to the color buffer depending on the values in the stencil buffer and your stencil mask.

eloso

Share this post


Link to post
Share on other sites