so i "sort of" figured out my issue with the stencil... http://i.imgur.com/v4abqYA.png
the yellow is the stencil rendering of a sphere, so only the pixels it hit are processed by fragment shader
The problem is where rendering multiple spheres close to eachother... the stencil setup is slightly incorrect and part of it gets
Any idea what i might need?
This is the current setup:
glDepthFunc( GL_LESS ); glStencilMask( 0xFF ); glCullFace( GL_FRONT ); glStencilFunc( GL_ALWAYS, 1, 0xFF ); glStencilOp( GL_KEEP, GL_REPLACE, GL_KEEP ); renderSpheres(); glCullFace( GL_BACK ); glStencilFunc( GL_EQUAL, 1, 0xFF ); glStencilOp( GL_KEEP, GL_ZERO, GL_REPLACE ); renderSpheres();