Explorar el Código

WebGLRenderer: Do not upload MorphTargets with 0 influence.

Mr.doob hace 10 años
padre
commit
d736c5e4fa
Se han modificado 1 ficheros con 8 adiciones y 3 borrados
  1. 8 3
      src/renderers/WebGLRenderer.js

+ 8 - 3
src/renderers/WebGLRenderer.js

@@ -1051,11 +1051,16 @@ THREE.WebGLRenderer = function ( parameters ) {
 				var influence = activeInfluences[ i ];
 				morphInfluences[ i ] = influence[ 0 ];
 
-				var attribute = geometry.morphAttributes[ influence[ 1 ] ];
 
-				objects.updateAttribute( attribute );
+				if ( influence[ 0 ] !== 0 ) {
 
-				geometry.addAttribute( 'morphTarget' + i, attribute );
+					var attribute = geometry.morphAttributes[ influence[ 1 ] ];
+
+					objects.updateAttribute( attribute );
+
+					geometry.addAttribute( 'morphTarget' + i, attribute );
+
+				}
 
 			}