Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

BrianH

Managing geometry for skinned meshes

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

Hello, I was just thinking about how to manage the geometry for skinned meshes in my engine and I had some questions. First of all, how do you handle instances of the same skinned mesh? Lets say you have 20 goblins.. Each looks identical and uses the same vertices and indices. However, the deformation of the skin can be different for each instance. Therefor you either have to: A) have separate vertex arrays for each instance. B) have 1 vertex array for all the instances and deform it just before drawing each instance. Now, (A) seems to allow batching... but (B) saves memory. I am leaning towards (B) because it just seems more robust and you dont have to worry about how many instances you have. What do you all think? How do you all manage geometry for instances of skinned meshes? Thanks, -Brian

Share this post


Link to post
Share on other sites
Advertisement
I would keep one vertex buffer for the untransformed mesh, and an array of bone matrices for each instance.
Then you can deform the mesh using the bone matrices in a vertex shader program when you call draw(indexed)primitive. The vertex shader can adjust the x,y,z for each point while it transforms the mesh. You just load the bones as matrices in the constant registers, for each point you put the weights in the vertex struct.

Share this post


Link to post
Share on other sites

  • 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!