Sign in to follow this  
Bejan0303

MS3D skeletal animation shader

Recommended Posts

Ok, I post of here a couple months back complaining about frame rate hits when doing skeletal animations. Everyone said I should do it on the GPU instead of in software. OK! sounds like a plan.

I had only wrote simple shaders, per pixel lighting, and things like that. I looked at what others did and some hlsl examples. I couldnt really find any good demos for gl.

Anyway, my problem: I understand how the process of using the shader for skinning works, but for the MS3D model, I think the vertices are stored differently. For one thing you have to transform the vertices with the inverse of the initial bone transforms, before transforming with the current. Is this normal, the examples in hlsl i saw didnt do this. The just passed the initial verts into the shader. Is it possible to inversely transform the verts first, and save that an my vertex buffer. and then not have to worry about the inverse transforms later?

Thanks,
Bejan

Share this post


Link to post
Share on other sites
I messed with md2or3 not sure, but it stored the verts relative to the bones. So you had to apply weighting for the vertex (which had different coords for each bone) then you have the 3d position afterwards. Save that and then you would just apply the transforms.

Share this post


Link to post
Share on other sites
Sorry I haven't got a t ge back till now, busy with school.
So you're saying if a vert was connected to 3 bones, you'd store 3 vertices in bones space (on for each bone) then combined later? How does that work on a shader, I don't hink you can combine vertices can you?

Share this post


Link to post
Share on other sites

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