|
|
|
@ -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 |