Having multiple VBOs is ok if they are of a certain size. What you want to avoid is to have many small callbacks and very often bind different buffers.
How large the buffers are to avoid excessive overhead depends on many factors, which are almost impossible to even give an empirical rule. Factors that come into play include:
- Characteristics of equipment performance.
- Driver efficiency.
- The number of vertices relative to the number of fragments (triangle size).
- The complexity of shaders.
As a rule, it makes sense to store similar / related objects that you usually draw simultaneously in the same vertex buffer.
Putting just one buffer seems extreme and can have negative consequences. Say you have a large βworldβ where you only render a small subset in any given frame. If you go to extremes, you have all the vertices in one giant buffer, this buffer should be available for the GPU for every draw call. Depending on the architecture and method of allocating the buffer, this may mean:
- Trying to save a buffer in dedicated GPU memory (e.g. VRAM), which can be problematic if it is too large.
- Map memory to GPU address space.
- Pin / connect memory.
If any of the above requirements needs to be applied to a very large buffer, but you end up using only a small portion of it to render the frame, there is significant waste in these operations. On a VRAM system, this can also prevent other distributions, such as textures, from being embedded in VRAM.
If rendering is performed with calls that can only access the subset of the buffer specified in the arguments, for example, glDrawArrays() or glDrawRangeElements() , the driver may not be able to make the entire buffer GPU available. But I would not count on it.
source share