Vertex buffer for each mesh?

Started by
0 comments, last by rubberkidney 21 years, 2 months ago
Would it be unwise to create a vertex buffer for each mesh that I have in a scene? Or would it be better to just keep a buffer of my own design..then when the time comes concatonate them all into one big vertex buffer?
Advertisement
if you are just starting out, keep it simple, i.e. as many VBs as there are objects - or for example make an array of the class.

Later you can optimize it and stuff it into one big vertex buffer or into several ones depending on FVF structure and just change the starting vertex and amount being rendered.

The reason for not optimizng from the very beginning is that it is easier to debug and later you shall find out that simple nonindexed vertex buffers are not enough and you`ll switch to indexed vertex buffers. Basically the best (and easiest to implement) is One big vertex Buffer and several dynamic Index Buffers - especially for terrain, or if you have objects placed in 2d grid throughout whole level.

The difference in speed is however tremendous. When I had my terrain divided in about 100 VBs and later did one Big VB with IB, the framarate rose about 200%. So it`s up to you how comfortable are you currently with VBs and IBs.

VladR My 3rd person action RPG on GreenLight: http://steamcommunity.com/sharedfiles/filedetails/?id=92951596

This topic is closed to new replies.

Advertisement