I know it is possible to control what is written to the depth buffer in GLSL by writing to gl_FragDepth, but is it possible to write to the stencil buffer?
Also, can I cancel a pixel write completely from within the fragment-shader, as if the pixel had failed a stencil or depth test?
Thanks