Skeletal animation : Normals and tangents

Started by
9 comments, last by Code-R 18 years, 4 months ago
what's the best way to handle normals and tangents in skeletal animation? should I skin the normals in the same way I do with the vertices? will they need to be re-normalized? should I calculate the tangents once and then skin them accordingly or should I skin the normals then calculate tha tangents again using something like NVIDIA's NVMeshMender? I'd appreciate any ideas. TIA
Advertisement
If you keep your skeletal matrices as affine transformations ( only rotations and translations ), there is no need to re-normalize the normals and tangents.

If your matrices are 3x4 like this:
R11 R12 R13 T1
R21 R22 R23 T2
R31 R32 R33 T3
You'd only need to multiply normals by the rotational component of the matrices (Those marked with 'R'), and avoid 'T's.
"Technocracy Rules With Supremacy" visit: http://gimpact.sourceforge.net
what about tangents?
Tangents have the same treatement that normals!
Also, on Cg shaders, you can use the type, float3x3, for rotations.

However, I think that you've watched the skinning theory from NVidia:
http://developer.nvidia.com/object/skinning.html

There it does mention to something about provide bone matrix inverses for fast normal and tangets calculations. What do you think?
"Technocracy Rules With Supremacy" visit: http://gimpact.sourceforge.net
yes, I read it, the thing i I was wondering if there was a way to skip the inversion of the matrix, as it's pretty expensive. will taking the mere 3x3 upper left part do it?
There is no need to invert the matricies per frame. In my engine I simply multiply the normals/tangents/bitangents by the upper 3x3 matrix for each bone and it works splendidly.

Where you DO need to invert can depend on your setup. If you're doing things Doom 3 style (seperate vert for each weight) then you don't need it at all, but if you're doing things the way I do, where you start out with a "bind pose" mesh and skeleton, you do need to do some inverting in the pre-processing. You have your pind pose skeleton, and then the skeleton in the pose you wish to achieve, right? Well, in order to get the verts to rotate around the correct pivot point, you would have to basically undo the bind pose transform, then apply the new posed transform. We can simplify that by instead multiplying the inversed bind-pose matrix by the normal posed matrix, and then multiplying the verticies by the result. The nice thing about this is that you only have to invert the bind pose once, since it never changes. A small price in load time to pay for some really nice animation effects.
// The user formerly known as Tojiro67445, formerly known as Toji [smile]
normals should always be transformed by the inverse-transpose of what you multiply the vertices by....

Simply transforming the normals by the rotation part of a transform matrix is wrong.
yes, but in the case of an orthogonal matrix the inverse and the transpose matrices are the same, meaning that the inverse transpose matrix of A is A;

you need to be sure that your worldview matrix is orthogonal, then you should be able to use the simplification (the 3x3 matrix).
Gregory Jaegy[Homepage]
how can I guarantee that?
If your matrix is built from translation, rotation, and uniform scales only (ie: scalex==scaley==scalez), you can use the upper 3x3 of the world matrix.

If you have non-uniform scales, shears, or other strange transformations you'll need to use the inverse transpose of the world matrix.

This topic is closed to new replies.

Advertisement