2
0
Эх сурвалжийг харах

WebGLRenderer: MorphTargets starting to work again.

Mr.doob 10 жил өмнө
parent
commit
01ffeb7df6

+ 6 - 2
src/renderers/WebGLRenderer.js

@@ -1047,9 +1047,13 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 			for ( var i = 0, l = activeInfluences.length; i < l; i ++ ) {
 
-				morphInfluences[ i ] = activeInfluences[ i ][ 0 ];
+				var influence = activeInfluences[ i ];
+				morphInfluences[ i ] = influence[ 0 ];
+
+				var attribute = geometry.morphAttributes[ influence[ 1 ] ];
+
+				objects.updateAttribute( attribute );
 
-				var attribute = geometry.morphAttributes[ activeInfluences[ i ][ 1 ] ];
 				geometry.addAttribute( 'morphTarget' + i, attribute );
 
 			}

+ 2 - 0
src/renderers/webgl/WebGLObjects.js

@@ -194,6 +194,8 @@ THREE.WebGLObjects = function ( gl, properties, info ) {
 
 	};
 
+	this.updateAttribute = updateAttribute;
+
 	this.clear = function () {
 
 		objects = {};