2

Are OpenGL's Vertex Array Objects stored in VRam?

What I'm really asking: If I load a model, using Assimp for example, then read the vertex and indice data into Vertex Array Objects; will I be duplicating data in Ram, or copying it to the GPU?

Justin Meiners
  • 9,345
  • 6
  • 44
  • 90
Ignoreme
  • 193
  • 1
  • 2
  • 11

1 Answers1

10

There seems to be a lack of understanding of OpenGL terminology here.

You cannot read "vertex and indice data" into Vertex Array Objects. They don't actually store the data; the arrays of data are stored in buffer objects. VAOs only reference them. VAOs describe how the data in those buffers is formatted so that OpenGL can understand what they mean.

If you are asking about client-side vertex arrays (note the lack of the word "object", though you can use client-side vertex arrays with VAOs), then by definition they are not stored on the GPU. The "client" of client-side vertex arrays is the user's code. IE: memory you allocated, own, and manage.

If you're asking about the use of buffer objects, yes, buffer object storage resides on the "server" (ie: memory owned by the OpenGL implementation). Whether it's actually physically on the GPU at any particular point in time is not something you can determine. But after you call glBufferData, glBufferSubData, or other such functions that update buffer objects, the server has copied that data.

Nicol Bolas
  • 378,677
  • 53
  • 635
  • 829
  • Yes there is a lack of understanding about terminology. I've just starting to look at openGL. I'm glad you understood what I was asking though. I was wondering if by allocating Buffer Objects and populating them with data I already had in the Assimp Scene struct, that I would be duplicating data and wasting my time. – Ignoreme Oct 13 '12 at 01:12
  • @Kronos25: You'll be duplicating data, but not "wasting time". Runtime performance is what you're after, so getting the data onto the GPU is important in achieving that. Besides, you should *delete* your scene struct after you're done uploading it. – Nicol Bolas Oct 13 '12 at 01:21