I\'m having issues when drawing using the stencil test in OpenGL on mac. When I first draw the scene, the stencil works fine. I draw a semi-transparent black rectangle in th
The clearing of the stencil buffer does indeed not work (except for the very first time that funtion is called) as you might expect it.
What you missed is that the glStencilMask
will also affect glClear(... | GL_STENCIL_BUFFER_BIT)
.
You should move the glStencilMask(0xFF)
up a bit, before doing the clear call.