Browse Source

WebGLState: Added setScissorTest.

Mr.doob 10 years ago
parent
commit
cdc97e1511
2 changed files with 15 additions and 1 deletions
  1. 1 1
      src/renderers/WebGLRenderer.js
  2. 14 0
      src/renderers/webgl/WebGLState.js

+ 1 - 1
src/renderers/WebGLRenderer.js

@@ -532,7 +532,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 	this.enableScissorTest = function ( boolean ) {
 
-		state.set( _gl.SCISSOR_TEST, boolean );
+		state.setScissorTest( boolean );
 
 	};
 

+ 14 - 0
src/renderers/webgl/WebGLState.js

@@ -357,6 +357,20 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
 
 	};
 
+	this.setScissorTest = function ( scissorTest ) {
+
+		if ( scissorTest ) {
+
+			this.enable( gl.SCISSOR_TEST );
+
+		} else {
+
+			this.disable( gl.SCISSOR_TEST );
+
+		}
+
+	};
+
 	// texture
 
 	this.activeTexture = function ( webglSlot ) {