Exemplo n.º 1
0
func (r *EffectsRenderer) EnableOutput() {
	gl.ColorMask(true, true, true, true)
	gl.StencilMask(0x00)              // No more writing
	gl.StencilFunc(gl.EQUAL, 0, 0xFF) // Only pass where stencil is 0
}
Exemplo n.º 2
0
func (r *EffectsRenderer) DisableOutput() {
	gl.ColorMask(false, false, false, false)
	gl.StencilFunc(gl.NEVER, 1, 0xFF)                // Never pass
	gl.StencilOp(gl.REPLACE, gl.REPLACE, gl.REPLACE) // Replace to ref=1
	gl.StencilMask(0xFF)                             // Write to buffer
}