* Fixed bug where verts uninfluenced by bones would not work correctly in hardware skinning

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10633 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
sha..RD 12 years ago
parent 04196e40ea
commit 725fb33983
  1. 6
      engine/src/core-data/Common/ShaderLib/Skinning.glsllib

@ -11,6 +11,7 @@ attribute vec4 inBoneIndex;
uniform mat4 m_BoneMatrices[NUM_BONES];
void Skinning_Compute(inout vec4 position){
if (inBoneWeight.x != 0.0) {
#if NUM_WEIGHTS_PER_VERT == 1
position = m_BoneMatrices[int(inBoneIndex.x)] * position;
#else
@ -22,8 +23,10 @@ void Skinning_Compute(inout vec4 position){
position = mat * position;
#endif
}
}
void Skinning_Compute(inout vec4 position, inout vec3 normal){
if (inBoneWeight.x != 0.0) {
#if NUM_WEIGHTS_PER_VERT == 1
position = m_BoneMatrices[int(inBoneIndex.x)] * position;
normal = (mat3(m_BoneMatrices[int(inBoneIndex.x)][0].xyz,
@ -41,8 +44,10 @@ void Skinning_Compute(inout vec4 position, inout vec3 normal){
normal = rotMat * normal;
#endif
}
}
void Skinning_Compute(inout vec4 position, inout vec3 tangent, inout vec3 normal){
if (inBoneWeight.x != 0.0) {
#if NUM_WEIGHTS_PER_VERT == 1
position = m_BoneMatrices[int(inBoneIndex.x)] * position;
tangent = m_BoneMatrices[int(inBoneIndex.x)] * tangent;
@ -62,5 +67,6 @@ void Skinning_Compute(inout vec4 position, inout vec3 tangent, inout vec3 normal
normal = rotMat * normal;
#endif
}
}
#endif
Loading…
Cancel
Save