Sign in to follow this  

Smooth Skinning/Skeletal animation

This topic is 4714 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

Hi, I was curious about how most games handle skeletal animation. I tried putting in smooth skinning (i.e. each vertex is influenced by a number of bones) in my game and it slowed the game way down. So I was wondering how everyone does it? So far i have 3 possible theories: 1) Skeletal animation itself is not used in the game itself. Every vertex position for every frame is stored in a file. 2) Skeletal animation is used but restricted to one bone per vertex. 3) Skeletal animation is used with multiple influences but is implemented in some way that i don't know about. Anyone have any information/insight on this? Let me know. Thanks.

Share this post


Link to post
Share on other sites
A lot of games implement the skinning in a vertex shader, which means you don't have to do any transformation on the CPU aside from computing the matrices for the bones, and you don't have to lock/unlock the vertex buffer (D3D) or update your VBOs or whatever you might be using (OpenGL).

Another way is the skinning process is a very good canidate for SSE optimizations if you must do it in software.

How many vertices is the model?
Are you compiling a release version?

Share this post


Link to post
Share on other sites
Hi, I used software vertex blending for my skeletal animation in my game. Can you elaborate more on your technique? My application is fill-rate bound, you might want to run it through a profiler and see. Maybe there's somethings going on behind the scenes that you're not aware of.

1) My system has a limitation of 4 bones per vertex influence.
2) I used Slerp interpolation, you can also use linear interpolation.
3) There must be lots of way to do this, I think a lot of them are using hardware skinning nowadays, but I used software because my video card does not support shaders.

Are you doing an initial pass to get the inverse matrix? How about construction/destruction of objects in your forEveryVertex loop?


hope that helps.

Ken

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I believe it's normal to have each vertex influenced by 2-4 bones. It would indeed slow things way down to use every bone in calculating every vertex.

Share this post


Link to post
Share on other sites
We do vertex shader skinning. During preprocessing, we check each model's vertices to see the maximum number of bones that affect a vertex. We use 1, 2, 3, or 4 bone skinning depending on the mesh. The artists aim to make each mesh use only 2 bones at a time. We can also drop to a lower number of bones at any point, which is useful for LOD.

Share this post


Link to post
Share on other sites
Hi thanks everyone for the help. A little more about what I do every update:
1.)Every time the model's frame is updated:
Compute a "skin" matrix for every joint. The skin matrix is basically the joint's bindpose matrix (stored in memory) times the joint's current matrix.

2.)Now in drawing:
For each vertex {
Matrix mat;
for each bone influence {
mat += weight * boneMatrix;
}
vertex = mat * original position;
}

I tried setting max influences to 1 and it runs at normal speed. So obviously this is what's slowing it down.
So computing in hardware might be the best option?

Share this post


Link to post
Share on other sites

This topic is 4714 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this