Browse Source

Implemented fix in #4152.
All the skinning examples seem to be working fine still.

Mr.doob 11 years ago
parent
commit
c9f5f1e458
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/renderers/shaders/ShaderChunk.js

+ 5 - 1
src/renderers/shaders/ShaderChunk.js

@@ -1270,6 +1270,8 @@ THREE.ShaderChunk = {
 
 
 			"mat4 boneMatX = getBoneMatrix( skinIndex.x );",
 			"mat4 boneMatX = getBoneMatrix( skinIndex.x );",
 			"mat4 boneMatY = getBoneMatrix( skinIndex.y );",
 			"mat4 boneMatY = getBoneMatrix( skinIndex.y );",
+			"mat4 boneMatZ = getBoneMatrix( skinIndex.z );",
+			"mat4 boneMatW = getBoneMatrix( skinIndex.w );",
 
 
 		"#endif"
 		"#endif"
 
 
@@ -1290,7 +1292,9 @@ THREE.ShaderChunk = {
 			"#endif",
 			"#endif",
 
 
 			"vec4 skinned  = boneMatX * skinVertex * skinWeight.x;",
 			"vec4 skinned  = boneMatX * skinVertex * skinWeight.x;",
-			"skinned 	  += boneMatY * skinVertex * skinWeight.y;",
+			"skinned      += boneMatY * skinVertex * skinWeight.y;",
+			"skinned      += boneMatZ * skinVertex * skinWeight.z;",
+			"skinned      += boneMatW * skinVertex * skinWeight.w;",
 
 
 		"#endif"
 		"#endif"