Quantcast
Channel: WebGL Stencils, How to use a 2D sprite's transparency as a mask? - Stack Overflow
Browsing latest articles
Browse All 2 View Live

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 Article



Image may be NSFW.
Clik here to view.

WebGL 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
Browsing latest articles
Browse All 2 View Live


Latest Images