WebGLRenderer.preRender now calls gl.clearColor in order to restore the background clear color in case something, like a Render Texture, has changed it.

This commit is contained in:
Richard Davey 2018-12-18 13:04:26 +00:00
parent 8ec71c7bd1
commit 4b1ea8db9b

View file

@ -1781,6 +1781,10 @@ var WebGLRenderer = new Class({
if (this.config.clearBeforeRender)
{
var clearColor = this.config.backgroundColor;
gl.clearColor(clearColor.redGL, clearColor.greenGL, clearColor.blueGL, 1);
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
}