View Full Version : Size of VBO
05-07-2007, 06:31 AM
i have a simple question:
Is there a limit for the size of a vbo ?
If i have to store 1000 vertices from several different meshes (1000 is just an example), is it possible to have enough space to store it in 4 differents VBO of 250 vertices, but not enough space to store it in 1 VBO of 1000 vertices ?
05-07-2007, 06:50 AM
There is no "real" limit (the limit depends on your RAM and VRAM). Still, it may be possible that the driver fails to allocate the memory, then you will get an error when creating the VBO.
IMHO, you can safely allocate VBOs under several megabytes.
05-07-2007, 07:09 AM
is it possible to have enough space to store it in 4 differents VBO of 250 vertices, but not enough space to store it in 1 VBO of 1000 vertices ?
Yes - due to memory fragmentation, but it's more likely that least recently used resource will be dropped to system memory and your VBO will be created.
Although with just 1000 vertices you should be fine.
If you're not developing an application with high security and reliability requirements you shouldn't bother.
If you do develop such application then you shouldn't rely on what people say and assume every operation can fail anyway :)
05-07-2007, 08:07 AM
Acctually, i want to display a 3d scene fom Anim8or ( a free modeler).
A scene has several instance of an object. And one object can have 1 or more meshes. But all meshes are static in the objects spaces (i just need position and orientation matrices for objects but not for meshes).
I wonder if the best thing to do is to store the vertices of meshes in one vbo per object or one vbo per meshes (using index buffer to select the good chunk for each materials).
Because i have read that it is slow to bind a ressource in OpenGL or D3D (texture, VBO, ...).
If i have understood, if i use several VBO, the "bind" operation will slows down my application.
But if i use just one VBO, and if there is not enought space in video memory, it will be store in system memory and it will also be slow.
05-07-2007, 08:26 AM
But if i use just one VBO, and if there is not enought space in video memoryAnd how large would that VBO have to be?
A good approach is to use one VBO for multiple objects (let's say you application will store minimum 10k vertices per VBO) and when you run out of space in one VBO you create another and so on.
That's for viewing. For modelling it's best to use one VBO per mesh since it's easier to manage.
05-07-2007, 08:51 AM
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.