* 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
This commit is contained in:
parent
04196e40ea
commit
725fb33983
@ -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…
x
Reference in New Issue
Block a user