Update RenderWebGL.js

This commit is contained in:
peabrainiac 2019-03-03 18:42:10 +01:00 committed by GitHub
parent 3d373571f8
commit 5fb9346036
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1621,8 +1621,12 @@ class RenderWebGL extends EventEmitter {
twgl.setUniforms(currentShader, uniforms);
/* set blend function to not use premultiplied alpha anymore */
gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
/* adjust blend function for this skin */
if (drawable.skin.hasPremultipliedAlpha){
gl.blendFuncSeparate(gl.ONE, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
}else {
gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
}
twgl.drawBufferInfo(gl, this._bufferInfo, gl.TRIANGLES);
}