Yet Another Buffer Question

Well I have another question about buffers i was thinking about setting up a global vertex buffer for my terrain grids, the only thing is they are set up in quadtrees so basically there are vertexbuffers setup for each quadtree leaf. So that is alot of vertexbuffers which in my understanding means bad. So i was wondering how many vertices can i put into a single buffer And if setting up a buffer for a whole gird is a good idea.


Answer this question

Yet Another Buffer Question

  • Vikram

    Vertex buffers can contain a large number of vertices. At least 64k, and possibly a lot more. However, you may not want to create VBs that large. If these are dynamic VBs, you'll want to lock them and fill them - locking very large VBs that are currently in-use by the card may not be the fastest path - in that case, it's better to have smaller VBs, so that you can lock one this is not currently be in use.

    But whatever the real virtues of small or large VBs, I think you're prematurely optimising. Just write the algorithm using whatever size of VB is most natural. You can always change it later IF you find that is a performance win. But if it's not - don't. There's not point worrying about something that probably won't be a problem.

    TomF.

  • Yet Another Buffer Question