Skip to content

Commit

Permalink
WebGLRenderer: Clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Feb 13, 2022
1 parent 0946935 commit 50e62ab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/renderers/WebGLRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -522,13 +522,13 @@ function WebGLRenderer( parameters = {} ) {

};

this.clear = function ( color, depth, stencil ) {
this.clear = function ( color = true, depth = true, stencil = true ) {

let bits = 0;

if ( color === undefined || color ) bits |= _gl.COLOR_BUFFER_BIT;
if ( depth === undefined || depth ) bits |= _gl.DEPTH_BUFFER_BIT;
if ( stencil === undefined || stencil ) bits |= _gl.STENCIL_BUFFER_BIT;
if ( color ) bits |= _gl.COLOR_BUFFER_BIT;
if ( depth ) bits |= _gl.DEPTH_BUFFER_BIT;
if ( stencil ) bits |= _gl.STENCIL_BUFFER_BIT;

_gl.clear( bits );

Expand Down

0 comments on commit 50e62ab

Please sign in to comment.