Vertex Arrays still useful?
I've just learned OpenGL for nearly two months on my own and my guidebook is <OpenGL Programming Guide seventh edition>(based on OpenGL 3.0&3.1). where Vertex Arrays are mentioned. But in some other newly published textbooks there is not a single word about Vertex Arrays?! How come? Is Vertex Arrays not useful any more? Or OpenGL4 has abandoned Vertex Arrays?
By no means have they been abandoned. In fact, they are REQUIRED in core profiles in OpenGL 3.2+. That's odd that they aren't mentioned, perhaps they just never really put a name to it in the book.
More info about them here
Right. Vertex arrays are core to the OpenGL implementation. Tutorial books aside, the key thing is what the GL Spec says, and it clearly describes vertex arrays. They contain arrays of data values used to populate vertex attributes on the GPU.
Vertex arrays can be stored in:
- server-side memory (i.e. GL driver-side memory) in vertex buffer objects (VBOs), or
- client-side memory (i.e. your application's memory) in what's termed client arrays.
The former is the more modern approach, while the latter is "the way it used to be done" (which is obsoleted in OpenGL "core" profiles, but still available in OpenGL "compatibility profiles).
So I suspect for any modern GL book that doesn't explicitly mention vertex arrays, it clearly talks about vertex buffer objects. Just keep in mind these are just server-side containers for vertex arrays and the element (index) arrays.
I'd add to this is that another reason why is because there is no other way of drawing.
Originally Posted by Dark Photon
With old OpenGL there were multiple ways of drawing: immediate mode, display lists, vertex arrays, vertex arrays with VBOs, and a few weird mixed cases (such as immediate-mode-indexing via glBegin/glArrayElement/glEnd), so it made sense to call out vertex arrays explicitly.
With modern OpenGL there is only one way of drawing - vertex arrays with VBOs - so it no longer makes the same kind of sense. But when you read material on modern OpenGL you should always understand that it's using vertex arrays with VBOs, even when it doesn't explicitly say so.
vertex arrays are basically like vertex buffer objects used with GL_STREAM_DRAW_ARB as usage hint.
[EDIT]not vertex array objects but vertex buffer objects, hope I didn't confuse anyone[/edit]
Last edited by Osbios; 12-24-2013 at 05:40 AM.