Do I need to rebuild VAO if I need to change VBO?

I create my scene by creating or modifying the buffer that I pass glBufferData. My understanding of Vertex Array objects is that they allow me to skip the manual binding of all the VBOs that I use. Is this still the case when I keep updating my buffer?

Can I link my VAO, call glBufferDatato update the vertices and indexes (only the two VBOs that I have at the moment), and then render?

Can I use memory mapping with VBO? Then could I link the VAO, change the buffer, and then render?

What exactly does VAO do? Is its function just a shortcut function that stores and automates the binding of vertex attributes to my VBOs? Does it get ownership of data or bindings?

+5
source share
1 answer

You will probably have to test this, but from my understanding of VBOs, identifiers are assigned when generating, and VAO refers only to every vertex associated with the VBO identifier it uses. You should be able to call glBufferDataor glBufferSubData. I'm not sure that displaying the memory immediately before the draw call will work, but you could certainly do something between binding to a VAO and a drawing. VAO does not block or restrict access to VBOs.

, VAO ( VBO, , ..) . glBindVertexArray(0);, VAO.

+3

All Articles