In a nutshell, what’s the difference between a vertex buffer object and a vertex array object? If I understand correctly (or this is where you come in), a VBO contains a single array of data (though it can be interleaved with different things, like normals, uv, etc.). A VAO is an aggregation of multiple VBO? So if you wanted to render a mesh, typically, you’d have multiple VBO for vertices, indices, texture coordinates, normals, and any other generic vertex attributes, respectively, and you can bind all of these simultaneously by binding a given VAO that references all of its VBOs?
Kip
Here’s a great description from http://www.songho.ca/opengl/gl_vbo.html.
GL_ARB_vertex_buffer_object extension is intended to enhance the performance of OpenGL by providing the benefits of vertex array and display list, while avoiding downsides of their implementations. Vertex buffer object (VBO) allows vertex array data to be stored in high-performance graphics memory on the server side and promotes efficient data transfer. If the buffer object is used to store pixel data, it is called Pixel Buffer Object (PBO).
Using vertex array can reduce the number of function calls and redundant usage of the shared vertices. However, the disadvantage of vertex array is that vertex array functions are in the client state and the data in the arrays must be re-sent to the server each time when it is referenced.
[snip]
Vertex buffer object (VBO) creates “buffer objects” for vertex attributes in high-performance memory on the server side and provides same access functions to reference the arrays, which are used in vertex arrays, such as glVertexPointer(), glNormalPointer(), glTexCoordPointer(), etc.
The memory manager in vertex buffer object will put the buffer objects into the best place of memory based on user’s hints: “target” and “usage” mode. Therefore, the memory manager can optimize the buffers by balancing between 3 kinds of memory: system, AGP and video memory.
Unlike display lists, the data in vertex buffer object can be read and updated by mapping the buffer into client’s memory space.
Another important advantage of VBO is sharing the buffer objects with many clients, like display lists and textures. Since VBO is on the server’s side, multiple clients will be able to access the same buffer with the corresponding identifier.
Hope that helped!
Hey Alfonse. VertexAttribute == VertexAttributeState ? in the C struct analogy?
Kip
Hey Alfonse. VertexAttribute == VertexAttributeState ? in the C struct analogy?
Yeah, sorry. That was a copy&paste error.
No problem. Thanks for fixing that. Wasn’t absolutely certain.
Kip