Sign in to follow this  
DRowe

Direct3D 9: Skinned animation questions.

Recommended Posts

I'm trying to optimize my current animation system by sharing as much data as possible between members. I aim for my game world to have several skinned objects that share the same mesh but do not animate on the same intervals. In the game I am updating all of my objects first (including advancing their animation time) and then rendering, which means that advancing and rendering one object, advancing and rendering the next object, etc is not an option. I haven't found any material that addresses this problem, but I'm sure it's very common. I've given the MSDN documentation a thorough reading, but none of the functionality seems obvious for this situation. How much data can I share between them to reduce memory used? Is it possible to have one mesh shared by several different animation controllers, or will I have to cowboy up and call D3DXLoadMeshHierarchyFromX ten times for ten different entities? Thanks in advance, D. Rowe

Share this post


Link to post
Share on other sites
I'm not using the D3DX stuff for my animation, so I'm not sure how relevant this is to your situation, but: I currently render multiple skinned meshes using the same shared geometry. I just do the bone calculations per instance, set the vertex shader constants, and fire off a rendering of the mesh. The bone calculations could be done separately (at animation time) or at rendering time.

Share this post


Link to post
Share on other sites
I posted about this a little while back - I have one copy of the animation data, one copy of the mesh and a "mesh instance" which is effectively a matrix array that gets animated by the animation system (custom written, no DirectX). So, my memory overhead is the number of bones/transforms in a hierarchy for each instance. This allows for easy attachments, separation of animating, updating the transform hierarchy and rendering. We use this on consoles too, so its not that "expensive".

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