Question concerning animation:
in a lot of samples (even in the official sample "Local Deformable PRT" of the SDK of DX ), I see something like that for animation in vertex shader:
struct VS_INPUT {
float4 Position : POSITION;
float3 Normal : NORMAL;
float3 Tangent : TANGENT;
float4 BlendWeights : BLENDWEIGHT;
float4 BlendIndices : BLENDINDICES;
.....
};
VertexShader
{
....
for (i = 0; i < 4; ++i)
{
blendPos += float4( mul( boneMatrix[blendIdx] , position).xyz, 1.0) * blendWgt;
normal += mul( (float3x3)boneMatrix[blendIdx] , normal) * blendWgt;
.......
}
......
}
My question is about the normal transformation:
I have studied boneMatrix[], and I found that all matrices of this array aren't always orthogonal (certainly because of not uniform scaling).
So they should transform the normal with the transpose of the inverse of the matrix.
Why in every samples (that use BLENDWEIGHT/BLENDINDICES) that I found, nobody use the inverse of transpose for the normal/tangent transformation?
My theory is that it's a big cost to compute/transfert/stock all the inverse matrices, so it's better to have a normal slightly false rather than an exact normal but a lower FPS.
Is my theory true? or am I missing something?
Thanks!