Ver código fonte

WebGLState: Code clean up. See #6637.

Mr.doob 10 anos atrás
pai
commit
7954889f2f
1 arquivos alterados com 4 adições e 2 exclusões
  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;
 
 		}