Take the 2-minute tour ×
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
3  
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 1

up vote 12 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
    
read opengl.org/sdk/docs/man/xhtml/glDrawElements.xml and opengl.org/wiki/GlDrawElements - Vertex Arrays AREN'T deprecated nor removed, they are still supported as of OpenGL 4.x; get your facts straight, mate, because what you're spreading is just misinformation –  vaxquis Jan 15 at 14:26
1  
@vaxquis Client side vertex arrays are deprecated. Server side vertex arrays are not. VAOs are different thing and are meant to save state. Nothing was wrong in the post, though could be more accurate if it state client side. But I guess that was implicit. –  concept3d Jan 15 at 15:27
1  
Plus, before saying something "is deprecated", specify the source of such statement, preferably in official document. Pointing from StackExchange to StackOverflow as a proof is NOT the way science works, and defending with "I guess that was implicit" is not an argument. Nobody asked about client/server arrays, the question was about vertex array in the broadest sense, as compared to VBO. Btw, I haven't said anything about VAO, where's that idea from? –  vaxquis Jan 15 at 20:59

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.