浏览代码

WebGLRenderer: Clean up.

Mr.doob 3 年之前
父节点
当前提交
50e62ab421
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      src/renderers/WebGLRenderer.js

+ 4 - 4
src/renderers/WebGLRenderer.js

@@ -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 );