Explorar el Código

WebGLState: Added setScissorTest.

Mr.doob hace 10 años
padre
commit
cdc97e1511
Se han modificado 2 ficheros con 15 adiciones y 1 borrados
  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 ) {