Answer by gman for WebGL Stencils, How to use a 2D sprite's transparency as a...
It's not clear why you want to use the stencil for this. Normally you'd just setup blending and use the transparency to blend. If you really wanted to use the stencil you'd need to make a shader that...
View ArticleWebGL Stencils, How to use a 2D sprite's transparency as a mask?
if (statuseffect) { // Clearing the stencil buffer gl.clearStencil(0); gl.clear(gl.STENCIL_BUFFER_BIT); gl.stencilFunc(gl.ALWAYS, 1, 1); gl.stencilOp(gl.REPLACE, gl.REPLACE, gl.REPLACE);...
View Article