XNA Creators Club Online
Page 1 of 1 (5 items)
Sort Posts: Previous Next

ID3DXMesh with Skeletal Animations

Last post 04-26-2008 11:11 PM by jwatte. 4 replies.
  • 04-25-2008 8:54 PM

    ID3DXMesh with Skeletal Animations

    Ok, so I am looking at loading an ID3DXMesh and using skeletal animations with it. The skeletal animation will more than likely be used with an ID3DXSkinInfo and using the ID3DXMesh::CloneMeshFVF() method.  Now, the mesh will be a skinned mesh, so I can manipulate it with the bone matrices from the skeleton. Now, my question is, does using skeletal animations with D3DX helper functions and all that use the fixed function pipeline, or does it render skeletal animations based on manipulating the Vertex buffer of the ID3DXMesh on the CPU, then rendering the modified vertex buffer with the FFP?

    Help would be greatly appreciated.
  • 04-25-2008 11:19 PM In reply to

    Re: ID3DXMesh with Skeletal Animations

    Generally you supply the update method.

    If you use ID3DXSkinInfo::UpdateSkinnedMesh() then you'll more than likely want to add a mesh to recieve the updated data, if you're using D3DXMESHCONTAINER then just inherit, add the mesh, then when loading just clone. The nice thing about this method is that the maths is done for you and you can have as many bones as you like. The bad thing is you use two meshes, but with memory sizes these days a doubt that'll be too much of a problem, and that you're copying data from one mesh to the other.

    If you use a vertex shader to do the animation you'll need to use something like ID3DXSkinInfo::ConvertToBlendedMesh() to get a usable mesh. The nice thing here is that you're using only one mesh, the vertices are being transformed in the shader, so there's no copying. The bad thing is you supply the maths and you're limited to the number of bones allowed, 60 odd, I've forgotten, for shader 2.

  • 04-26-2008 1:17 PM In reply to

    Re: ID3DXMesh with Skeletal Animations

    Ok, thanks for the info. One more thing, I was running a demo of skeletal animations in direct x( the SkinnedMesh sample from the DXSDK ), and then a demo of the Irrlicht 3d engine, and irrlicht had double the fps that the dxsdk had. Why would this be? Irrlicht does its skeletal animations by manipulating the meshes vertex buffer in real time, and doesn't use two meshes, but I wouldn't expect that to have such a great performance hit.
  • 04-26-2008 9:40 PM In reply to

    Re: ID3DXMesh with Skeletal Animations

    The dx samples aren't a game engine, they're there to show you how to use the components that come with dx so theres definitely room for optimisations so you can get the speed up. As for using one mesh, yes of course you can, you just have use a different starting transform rather than the original, I was showing something that's just general.
  • 04-26-2008 11:11 PM In reply to

    Re: ID3DXMesh with Skeletal Animations

    The performance of UpdateSkinnedMesh() actually depends on how you choose to create the mesh (streaming, default, managed, etc), as well as the CPU performance.
    Typically, what you'll want to do for skinned meshes is to make sure that you bind the index and blend weight channels to the vertex shader, and do the blending in the shader. This will leave the CPU for other things. Except on Intel Extreme hardware.

    Jon Watte, Direct3D MVP kW X-port 3ds Max .X exporter kW Animation source code
Page 1 of 1 (5 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG