Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

i'm trying to learn about vertex array and vertex buffer object, but i don't understand the differences in term of:

  • case-of-use (static geomerty like terrains, geometry that change every frame like particle systems, etc)
  • performance
  • portability (old graphics card, consolle, devices like android or iphone, etc)

some clarifications?

share|improve this question
1  
For anyone else that arrives here, check out the most up voted answer here.... stackoverflow.com/questions/430555/… – afuzzyllama Jan 8 '12 at 22:39

1 Answer

up vote 10 down vote accepted

Here is a decent writeup about VBOs.

Performance

Here is a good overview of the calling semantics.

Here here is another good overview of performance issues; in it we see that VBOs are more performant than arrays.

The reason we prefer VBOs is that the data is loaded onto the card, and so you don't have to transfer it every frame. Depending on the type of VBO created, you can give the graphics driver hints on the usage (write-many, read-many vs. write-many, never-read, etc).

Usage

VBOs are really good for static geometry like terrain that you don't expect to change, or for instanced geometry.

Vertex arrays are good for data that changes frequently but that also is read by the host machine--so, for directly rendering data that is being manipulated (laser rangefinder data buffers, for example, are where I've used them) frequently. If you can get away with never reading the data on the host device (so, just pushing it out onto the card), VBOs in write-only mode are a good option.

Portability

Vertex Arrays These are available in OpenGL prior to 3.0, deprecated in 3.0, and gone in 3.1+. OpenGL ES supports them (OpenGL ES 2 does not).

VBOs These are available after OpenGL 1.5. These are the only way to store geometry data in OpenGL ES 2 (and so, WebGL).

share|improve this answer
I'm pretty sure OpenGL ES 2 does support vertex arrays. They use them in "OpenGL ES 2.0 Programming Guide", also see section 2.8 in the spec: khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf – sidewinderguy Apr 25 '12 at 17:45
2  
In that PerformanceTuning.pdf, it says that VBOs "Can hurt performance in non-optimal cases"... but it doesn't elaborate. Any idea what those cases are? I have a case where I need to update the geometry every frame, so I'm wondering if a vertex array would be better or worse than a VBO in that case. Thx. – sidewinderguy Apr 25 '12 at 18:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.