I use glVertexAttribPointer to load my vertex data each frame(~242kb) it takes about 8ms.
Will I gain any performance increase by employing VBO?
I think the answer is NO since I still have to load whole data.
The only way it can get performance gain is if glBufferData loads data faster than glVertexAttribPointer
Is this is the case?
Asked
Active
Viewed 755 times
1

undefined
- 623
- 7
- 27
1 Answers
2
If you have static vertex data then VBO has very clear performance advantage because data is kept in GPU accessible memory.
When you use glVertexAttribPointer without VBOs driver has to copy your vertex data to GPU accessible memory every frame. There is two reason why client arrays require copy
- GPU doesn't have access to all your memory. It can only see pages that GPU driver has mapped to it.
- OpenGL promises that you are free to change client array memory after glDraw* returns but GPU rendering happens asynchronously after return.
VBO data is allocated by driver and mapped to GPU. That avoids copies if you keep same vertex data. Updates also can be optimized if you only update part of vertex array with glBufferSubData. (eg. only update texture coordinates without vertex position update)

Pauli Nieminen
- 1,100
- 8
- 7
Does this mean that glBufferData doesn't actually copy data to gpu memory and I can modify my vertex data on client side and then call glBufferData which will be extra fast? – undefined Oct 27 '16 at 15:16