Skip to content

Commit 1ac7c96

Browse files
authored
Don't set gl.clearColor when no clearBeforeRender
Unless I'm missing something, the `gl.clearColor` command is unnecessary when you have `this.config.clearBeforeRender` set to `false`. This simply moves that into the config check to eliminate an unused command in those situations.
1 parent c944049 commit 1ac7c96

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/renderer/webgl/WebGLRenderer.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,11 +1636,9 @@ var WebGLRenderer = new Class({
16361636
var color = this.config.backgroundColor;
16371637
var pipelines = this.pipelines;
16381638

1639-
// Bind custom framebuffer here
1640-
gl.clearColor(color.redGL, color.greenGL, color.blueGL, color.alphaGL);
1641-
16421639
if (this.config.clearBeforeRender)
16431640
{
1641+
gl.clearColor(color.redGL, color.greenGL, color.blueGL, color.alphaGL);
16441642
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
16451643
}
16461644

0 commit comments

Comments
 (0)