Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Vertex Buffers

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

Alright, I have a fairly simple question. Until now, I've always been putting every single 3D object in my scene into a different vertex buffer. This works well, because after initialization, I will never have to lock/unlock any of the buffers. Just transform and render. This actually isn't problematic, and works very well for my purposes, but vertex buffers are optimized for much larger chunks of vertex data (not 3-4 vertices, as many of my vertex buffers are). Also, this does require a lot of vertex buffer switching. Now, an alternative to this would be a large dynamic buffer, right? Fill a chunk, render the chunk, add another chunk, render that chunk, if the buffer's full, empty and start at the beginning, wash rinse repeat. I've seen this done, and it would require just one vertex buffer, and I could fill it as I go along, and just store the vertex data elsewhere (which could also be dynamic vertex data, now). Another alternative that occured to me is to use one giant vertex buffer and store all my vertex data at different sections, and just render the apropriate sections where necessary (separately). This would just require one giant lock/unlock, and keeping track of where each chunk of vertex data is in the buffer... It's a bit of a pain to create a test that would sufficiently and impartially test all 3 methods against eachother, so I was just wondering if anybody had a fairly good idea which would be better... Thanks! ----------------- The Goblin (madgob@aol.com) ----------------- "Before critisizing somebody, walk a mile in their shoes. That way, when you do critisize them, not only will you be a mile away, but you'll also have their shoes!" Edited by - Goblin on July 17, 2001 10:33:16 PM

Share this post

Link to post
Share on other sites
Locking and relocking VBs would be more inefficient than dealing with the small buffers - continually locking and refilling seems horribly inefficient.

Could you create a large vertex buffer for a group of objects and then deal with separate objects as different index buffers?

However, I *think* the inefficiencies with small buffers has to do with short calls to DrawPrimitive, not the VBs themselves. Therefore, whether you deal with several VBs or one VB, your DrawPrimitive calls will involve small numbers of vertices and many matrix changes. There''s a good chance that you won''t be able to do better by simply gluing VBs together...

If you do any testing, post your results!

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!