zhugh
05-11-2011, 03:11 PM
Hi all,
I understand that VBOs store vertex data and that attributes define how VBO data should be interpreted. I've read that VAOs store the bindings between VBOs and attributes, but I'm still having trouble with them.
1. How do you decide which VBOs/attributes should be placed in one VAO and which should be placed in another? Is it a good idea to create one VAO per model object?
2. For performance purposes, it seems like a good idea to place a lot of data in one VBO (colors, coordinates, normals, etc.) and associate the VBO with multiple attributes. In this case, should this large VBO have its own VAO? Or should multiple VBOs be placed in a VAO?
3. My OpenGL code compiles with and without VAO code (i.e. glGenVertexArrays, glBindVertexArray). Does this mean that I'm using a single VAO? Is this bad?
4. I've read that VAOs allow you to reuse attribute data for multiple VBOs. Does that mean that every VBO associated with a VAO has to use the same attributes?
5. At what point in the application does VAO data get transferred to the GPU?
Thanks in advance. I've read the OpenGL SuperBible and the OpenGL wiki, but I'm still pretty confused on the VAO subject.
Zack
I understand that VBOs store vertex data and that attributes define how VBO data should be interpreted. I've read that VAOs store the bindings between VBOs and attributes, but I'm still having trouble with them.
1. How do you decide which VBOs/attributes should be placed in one VAO and which should be placed in another? Is it a good idea to create one VAO per model object?
2. For performance purposes, it seems like a good idea to place a lot of data in one VBO (colors, coordinates, normals, etc.) and associate the VBO with multiple attributes. In this case, should this large VBO have its own VAO? Or should multiple VBOs be placed in a VAO?
3. My OpenGL code compiles with and without VAO code (i.e. glGenVertexArrays, glBindVertexArray). Does this mean that I'm using a single VAO? Is this bad?
4. I've read that VAOs allow you to reuse attribute data for multiple VBOs. Does that mean that every VBO associated with a VAO has to use the same attributes?
5. At what point in the application does VAO data get transferred to the GPU?
Thanks in advance. I've read the OpenGL SuperBible and the OpenGL wiki, but I'm still pretty confused on the VAO subject.
Zack