Jump to content
  • Advertisement
Sign in to follow this  
janoside

DIP Error with SoftwareVertexProcessing

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

I have a terrain object that consists of a square grid of vertices which I render using DrawIndexedPrimitives. This works fine when I create my D3D device using CreateFlags.HardwareVertexProcessing. However, when I create the device using CreateFlags.SoftwareVertexProcessing (which is necessary for my skeletal animation code) an exception is thrown: "System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt." The only potential problem I could think of given the nature of the exception description was that I had forgotten to unlock a buffer. I checked and I am sure that I unlock both the vertex and index buffers after locking and writing to them. If anyone has any ideas as to why this might be happening, I would appreciate hearing them. Thanks in advance, janoside

Share this post


Link to post
Share on other sites
Advertisement
Could it be a problem of trying to do some software processing on a buffer that is created in video memory? When using software vertex processing, make sure that the vertex and index buffers you use are created in system memory and not in the default pool. Other than that, it's pretty hard to tell, especially since it is working with HWVP.

You can also use hardware vertex processing and use dynamic vertex buffers for your skinned meshes. That way, everything will benefit from HW processing and you will still be able to do skeletal animation in software.

Share this post


Link to post
Share on other sites
Hey Aldenar,

Thank you very much for the response. You inadvertently partially answered another more pressing question of mine: can skeletal animation be done using hardware vertex processing? If what you say about dynamic vertex buffers is right it would help me tremendously. I don't have a lot of experience with skeletal animation (just looking at the Dx samples "SimpleAnimation" and "SkinnedMesh") and the "SkinnedMesh" sample seems to say that skeletal animation can only be done under software vertex processing.

If you could point me to some info about using dynamic VBs for hardware processing of skeletal animation I would really appreciate it.

Thanks again,
janoside

Share this post


Link to post
Share on other sites
You can do skeletal anim in hardware. Software needs to compute the matrices for each bone, but you can put these into constants and transform a mesh (sitting in a static buffer on card) in the vertex shader. Some ATI cards can do this in the fixed pipeline, setting D3DTS_WORLDn matrices.

Share this post


Link to post
Share on other sites
Sign in to follow this  

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