Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenGL : Bone Animation, Why Do I Need Inverse of Bind Pose When Working with GPU?

I implemented an MD5 Loader with software skinning. Bind pose in md5 is final, absolute position and rotations, you just need to do computations for weights which are joint dependent.

I tried to implement GPU skinning but i am stuck at a point. Since these coordinates are final, why can't i just convert my 3d vectors and quaternions into a matrix and just upload it to the shader ? As I have read here : http://3dgep.com/?p=1356 , i need to multiply my skeleton with inverse of the bind pose. But I don't understand this part because I always thought that only thing I need to do is upload the final matrices to the GPU and calculate the rest there (sum of weights etc. etc.)

Can you explain me the behavior of inverse bind pose ?

like image 780
deniz Avatar asked Jun 15 '13 21:06

deniz


2 Answers

As the original author of that article, I will try to explain what multiplying by the inverse bind pose does:

The "inverse bind pose" basically "undoes" any transformation that has already been applied to your model in its bind pose.

Consider it like this: If you apply the identity matrix to every joint in the model then what you will get is your model in the bind pose (you can try this by sending a skeleton frame filled with identity matrices. If what results is the bind pose, then you are doing it right).

If you apply the bind pose matrices (uninverted) to every joint in the model then what you will get is spaghetti because you would be applying the bind pose twice!

So to fix the spaghetti model, you simply multiply the resulting joint transformations by the inverse bind pose to "undo" the transformation that have already been applied to your model.

I hope this clears it up a bit...

like image 56
Jeremiah Avatar answered Nov 10 '22 07:11

Jeremiah


Honestly, the article is a bit much to completely work through. It seems that the inverse bind pose matrices are used to transform vertices to the bones' local coordinate systems.

This is necessary, because the bones' transformations are local (relative to their parent joints). So in order to animate a vertex, you have to transform it to a bone's local coordinate system, calculate the bone's local transforms and transform it back to the world system.

like image 11
Nico Schertler Avatar answered Nov 10 '22 08:11

Nico Schertler