• Advertisement
Sign in to follow this  

Vertex & Index Buffer

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

Hello,
So I've recently been writing my scene graph and one question came in my mind...
All books I have ever read use directly LPDIRECT3D.....BUFFER objects in the node. But what will happen if there are 2 node with the same mesh?
So is direct3d checking if there are more then one buffers with same content and is there memory which is being waste?
Shoud I create my own mesh manager? (I have already got resource cache which can load zip files and manage used memory for assets)

Share this post


Link to post
Share on other sites
Advertisement
[quote name='Nickie' timestamp='1343663114' post='4964521']
So is direct3d checking if there are more then one buffers with same content and is there memory which is being waste?
[/quote]

No. If you make the 2 vertex buffers with the same contents, you'll waste memory. It's up to you to somehow share the mesh data among the different objects in your scene. Having the objects reference a mesh and using a resource manager to make sure each mesh only gets loaded once is a pretty common way of solving this sort of problem.

Share this post


Link to post
Share on other sites
[quote name='MJP' timestamp='1343672497' post='4964571']
[quote name='Nickie' timestamp='1343663114' post='4964521']
So is direct3d checking if there are more then one buffers with same content and is there memory which is being waste?
[/quote]

No. If you make the 2 vertex buffers with the same contents, you'll waste memory. It's up to you to somehow share the mesh data among the different objects in your scene. Having the objects reference a mesh and using a resource manager to make sure each mesh only gets loaded once is a pretty common way of solving this sort of problem.
[/quote]

Thats what I needed. Thanks.
Now I just need to make a std::list of all meshes and link them with a string(the name of the file). My resource cache is optimized for getting resources from name so I can easily locate the original data and build when needed or just access. Thanks, again!

Share this post


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

  • Advertisement