Jump to content
  • Advertisement
Sign in to follow this  
greyroot

Skinning Theory...

This topic is 4250 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm looking for help wrapping my head around a specific aspect of skinning and was hoping someone here could enlighten me. I get the idea in general, and have bones exporting properly and all, but now when looking at implementing the skinning part (in hardware especially) I'm getting kind of confusing and losing myself. Basically, each bone has a position and quaternion for the rotation. They are all relative to the parent bone. So my main issue is, as I understand it, for me to do things in hardware, each bone has to be the total transformation right? Also the bone data I'm passing in should be a difference from the root pose, not the final total transformation? Having trouble to even explain this issue... any help is appreciated.

Share this post


Link to post
Share on other sites
Advertisement
For (weighted) skinning, the vertexes are in model space in the bind pose. Each bone in the animation data is relative to its parent. The bones in the both the animated and bind pose skeletons are in model space (or world space). To animate a vertex:
For each vertex:
  1. For each bone the vertex is weighted by:
    1. Multiply it by the inverse of the bone's bind pose transform to put it into the bone's space.
    2. Multiply it by the animated bone (in the skeleton) to animate it and put it back into model space (or world space).
    3. Multiply by the weight
  2. Sum the results to get the vertex's animated and weighted position in model space (or world space).
As a major optimization, you can concatenate the bone's animated and bind pose transforms once per frame so you don't have to do two transformations for every vertex and weight.

Share this post


Link to post
Share on other sites
That much I get, and has added some clarity.
Still not sure about how the bones I pass into the GPU should be formatted though. You say the bones should be animated relative to parent, but when I pass the bones in I can't maintain that relationship.

Share this post


Link to post
Share on other sites
you should first go trough the bones and transform them all on cpu back to object space (wich is, sort of, the master parent, the root, of your bone-model). then they are all in the same space, and you feed that to the vertexshader..

don't know if you can do the first part in hardware?.... (of course, doable is everything, but if there is an easy and fast way, dunno)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!