Jump to content
  • Advertisement
Sign in to follow this  
helix

Shader based skeletal animation + IK?

This topic is 4645 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 am in the design stage of an ambitious game idea that I've been kicking around for the past few years. It's going to be heavily reliant on a fast and robust animation system as that's going to be at the core of the gameplay. Inverse Kinematics will also be extremely important. These are both advanced topics that still mystify me somewhat so I'm in search of some advice. I'm wondering if in the current or next generation hardware there is any GPU support for this type of animation system? I would like to build this myself but if there is something open source already (or an example at least), that would be great. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Well, there are two steps to skeletal animation. First all the bones get arranged... this is generally from animation data, but could also be from IK solving. Then (this is the shader part), the vertices that correspond to all the bones are "skinned" by applying a series of transformations.

If your idea is IK-based you don't need to worry about shaders, it's a totally different step in the process.

Share this post


Link to post
Share on other sites
Ok, I thought so since the bones don't really ever make it onto the gpu. I forgot to mention in my original post that the heart of my animation system will have to be strong blending. Is this also off the gpu (ie, not part of the skinning at all)?

Share this post


Link to post
Share on other sites
Yeah, blending is off the GPU also. The only thing that gets sent to the GPU is the final bone transformations after animating/blending/IK/etc. Those bone transforms are arranged in like an array, and each of the vertices has the indexes of the bones affecting it and the corresponding bone weight, and just skinning is done in a shader.

Share this post


Link to post
Share on other sites
My best advise is: learn skeletal animation! This will give you a lot of insight. You will get a hard time learning Inverse kinematics if you havent learned the basics first.
I have been strugling with the concepts of skeletal animation the last 2-3 weeks and it has been up hill most of the time. Im closing in now. Seems like a translation bug thats yet to be discovered!

Anyways here is what I sugest:

step1: choose a 3dformat (ask your designer what he prefers - ask your self if you are the designer...=)) that supports skeletal animation. My designer has chosen b3d (blitz3d).

step2: find the file-specifications on the net.

step3: build a simpel file-writer that prints out the most interesting stuff to the console or a txt file. Interesting stuff is: Quaternions (rotation), vectors(positions for translation), dump vertices to a txt-file for example. Having the file specification next to you, its not that hard. I wrote one in a couple of hours!

step4: Find all the sites you can explaining topics like Matrix and vector math, matrix palette skinning, how to build worldspace and inverse bindpose matrices, how to intopolate between keyframes etc.

step5: Ask your designer to make a simple exaple you can practice on. 3 joints for example with animation only on joint2. Like an arm with rotation in the elbow. Bad idea to begin testing on a fullblown animated model!

step6: Read Brett Porters "Skeletal Animation tutorial", read my thread "Problems with skeletal Animation" in the game physics forum.

Good luck with it...

Share this post


Link to post
Share on other sites
Well, the entire team consists of myself. :D But I do have an existing engine that I'm comfortable with that I can use to start out (to ultimately be replaced) so hopefully that will prevent me from losing my motivation (as I usually do when I bite off more than I can chew). I will attempt to follow your steps. I've always considered this to be the most technically challenging and most important part of my game idea so I'm looking forward to tackling it. The whole thing mystifies me so I might need to get a book on it.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!