Best way to modify verticies in Dx10

Started by
4 comments, last by ET3D 14 years, 8 months ago
I need modify mesh verticies every frame for my skeletal animation class. In opengl you can just modify the vertex array and pass it as is. however, in Dx10, you setup an ID3D10Buffer. Is it reasonable to use ID3D10Buffer::Map (ie. vertex buffer lock/unlock) to perform the vertex updates? Would this cause a performace issue with the vertex access being so frequent? Thanks, Velik
Advertisement
Quote:Original post by Velik
I need modify mesh verticies every frame for my skeletal animation class. In opengl you can just modify the vertex array and pass it as is. however, in Dx10, you setup an ID3D10Buffer. Is it reasonable to use ID3D10Buffer::Map (ie. vertex buffer lock/unlock) to perform the vertex updates? Would this cause a performace issue with the vertex access being so frequent?

Thanks,
Velik

Why are you not using hardware skinning? Your GPU is built exactly for this sort of thing, your CPU isn't as much. This is really the only way to go if you're interested in performance-- the DX SDK has a pretty comprehensive example of the topic if you're interested in the nitty-gritty of how it works.

EDIT: On a thoroughly unrelated note, props for using 'vertices' instead of the sadly ubiquitous 'vertexes.' I'm a grammar/spelling Nazi.
clb: At the end of 2012, the positions of jupiter, saturn, mercury, and deimos are aligned so as to cause a denormalized flush-to-zero bug when computing earth's gravitational force, slinging it to the sun.
You could modify a vertex buffer directly, just make sure you set the usage to D3D10_USAGE_DYNAMIC upon creating the buffer. However, I, like InvalidPointer, would also recommend using the GPU to do this.

More info here: http://msdn.microsoft.com/en-us/library/bb172499(VS.85).aspx
Thanks!!

This is an initial effort at skeletal animation, so its not obvious to me as to how everything fits together, including how it should be done. I will research using the gpu to do the work.
Quote:Original post by Velik
Thanks!!

This is an initial effort at skeletal animation, so its not obvious to me as to how everything fits together, including how it should be done. I will research using the gpu to do the work.

In general, it likely won't look any different code-wide (outside of the usual differences between shader and app-side code) than your CPU implementation anyway, which is certainly a blessing.
clb: At the end of 2012, the positions of jupiter, saturn, mercury, and deimos are aligned so as to cause a denormalized flush-to-zero bug when computing earth's gravitational force, slinging it to the sun.
A vertex array in OpenGL simply hides the transfer of data to the GPU. A more modern use of the API would be vertex buffer objects, which would be closer to what you'd do in D3D10. In terms of performance, there shouldn't be much of a difference. Especially if this is just an initial implementation, don't worry about it.

This topic is closed to new replies.

Advertisement