Jump to content
  • Advertisement
Sign in to follow this  
sepul

CloneMesh question ...

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

when using CloneMesh method, what is the exact work of D3DXMESH_VB_SHARE flag ? what is written in sdk help is "Forces the cloned meshes to share vertex buffers", but does it mean that only clones meshes share VB together and not with the current mesh ? so if the source mesh is created in system memory, does cloning the source with (D3DXMESH_WRITEONLY | D3DXMESH_VB_SHARE) flags make all cloned VBs in hardware ?

Share this post


Link to post
Share on other sites
Advertisement
I believe that the D3DXMESH_VB_SHARE flag tells D3D to just AddRef() the meshes vertex buffer, and not create a new one. That means you have one vertex buffer instead of two. Specifying the D3DXMESH_WRITEONLY flag shouldn't cause the vertex buffer to be moved into the default pool (unless it's already there), since that would cause performance issues if you tried to read from the vertex buffer with the original (non-writeonly) mesh.
I don't quite understand what you mean by "but does it mean that only cloned meshes share VB together and not with the current mesh?". A mesh usually owns its own vertex buffer, so unless you tell them to share the buffer with another mesh, each mesh will have its own VB.

Share this post


Link to post
Share on other sites
the problem is, that I made a progressive mesh out of a normal mesh created in system memory, so I guess that the progressive mesh's VB is in system memory, and I want to generate for example 5 LOD meshes out of it, and store them in hardware for fast rendering.
but for efficiency I have to share all VBs, if D3D does AddRef, then there will be performance loss, cuz all VBs are still in system memory.
so what should I do to make all the VBs in default pool and they could be shared in this case ?

thanks

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!