Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Vertex & Index Buffer


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Nickie   Members   -  Reputation: 322

Like
0Likes
Like

Posted 30 July 2012 - 09:45 AM

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)

Sponsor:

#2 MJP   Moderators   -  Reputation: 11617

Like
0Likes
Like

Posted 30 July 2012 - 12:21 PM

So is direct3d checking if there are more then one buffers with same content and is there memory which is being waste?


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.

#3 Nickie   Members   -  Reputation: 322

Like
0Likes
Like

Posted 30 July 2012 - 12:32 PM


So is direct3d checking if there are more then one buffers with same content and is there memory which is being waste?


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.


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!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS