Explorar el Código

WebGLState: Code clean up. See #6637.

Mr.doob hace 10 años
padre
commit
7954889f2f
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      src/renderers/webgl/WebGLState.js

+ 4 - 2
src/renderers/webgl/WebGLState.js

@@ -423,10 +423,12 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
 
 		for ( var i = 0; i < enabledAttributes.length; i ++ ) {
 
-			if ( enabledAttributes[ i ] ) {
+			if ( enabledAttributes[ i ] === 1 ) {
+
 				gl.disableVertexAttribArray( i );
+				enabledAttributes[ i ] = 0;
+
 			}
-			enabledAttributes[ i ] = 0;
 
 		}