From 0370ebf15e5180a8fd6087ebfa1eedc7dd11b0eb Mon Sep 17 00:00:00 2001 From: Felipe Alfonso Date: Fri, 7 Apr 2017 02:06:55 -0300 Subject: [PATCH] Fixed clearing render target issue --- v3/src/renderer/webgl/WebGLRenderer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/v3/src/renderer/webgl/WebGLRenderer.js b/v3/src/renderer/webgl/WebGLRenderer.js index 3cf48fd27..4e3a27da2 100644 --- a/v3/src/renderer/webgl/WebGLRenderer.js +++ b/v3/src/renderer/webgl/WebGLRenderer.js @@ -247,6 +247,7 @@ WebGLRenderer.prototype = { // Call at the start of the render loop preRender: function () { + this.setRenderTarget(null); // No point rendering if our context has been blown up! if (this.contextLost) { @@ -279,8 +280,8 @@ WebGLRenderer.prototype = { // Could move to the State Systems or MainLoop var gl = this.gl; var scissor = (camera.x !== 0 || camera.y !== 0 || camera.width !== gl.canvas.width || camera.height !== gl.canvas.height); - this.setRenderTarget(null); + this.setRenderTarget(null); if (scissor) { gl.enable(gl.SCISSOR_TEST);