Merge pull request #4286 from gomachan7/fixup/apply_transparent_bg_on_webgl_renderer

Fix WebGLRenderer to apply transparent bg in config
This commit is contained in:
Richard Davey 2019-01-23 22:22:08 +00:00 committed by GitHub
commit f8f81a06f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -566,7 +566,7 @@ var WebGLRenderer = new Class({
gl.enable(gl.BLEND);
gl.clearColor(clearColor.redGL, clearColor.greenGL, clearColor.blueGL, 1);
gl.clearColor(clearColor.redGL, clearColor.greenGL, clearColor.blueGL, clearColor.alphaGL);
// Initialize all textures to null
for (var index = 0; index < this.currentTextures.length; ++index)
@ -1813,7 +1813,7 @@ var WebGLRenderer = new Class({
{
var clearColor = this.config.backgroundColor;
gl.clearColor(clearColor.redGL, clearColor.greenGL, clearColor.blueGL, 1);
gl.clearColor(clearColor.redGL, clearColor.greenGL, clearColor.blueGL, clearColor.alphaGL);
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
}