Browse Source

WebGLRenderer: MorphTargets starting to work again.

Mr.doob 10 years ago
parent
commit
01ffeb7df6
2 changed files with 8 additions and 2 deletions
  1. 6 2
      src/renderers/WebGLRenderer.js
  2. 2 0
      src/renderers/webgl/WebGLObjects.js

+ 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 = {};