Does binding VAO bind VBO?

Does binding VAO bind VBO?

You can bind a VBO before you bind a VAO, and fill the VBO with data using glBufferData() . A VBO is essentially just a dumb data container. But any kind of vertex attribute setup tracked in the VAO can only be done after the VAO is bound.

What is a vertex array object?

A Vertex Array Object (VAO) is an object which contains one or more Vertex Buffer Objects and is designed to store the information for a complete rendered object. In our example this is a diamond consisting of four vertices as well as a color for each vertex.

Should I use VAO?

You should use VAO in same way how you are using VBO or textures, or shaders. First set it up. And during rendering only Bind them, without modifying it.

What’s the difference between a Vao and a VBO?

A VAO lets you do that in a single call. In short words, VBO is an array of raw data, when VAO is an array of ATTRIBUTES – an instruction for shader program how to use the data. Before, in OpenGL ES 2.0 for example, VAO wasn’t introduced yet at all and VBO was optional.

What happens when you bind a VAO in OpenGL?

When you bind a VAO, you are binding an object that stores the state used for vertex arrays. When you call a function that modifies the state for vertex arrays, that function will modify the state stored in the VAO currently bound. When you render, the rendering system will use the vertex array state found in the currently bound VAO.

How are vertex bindings stored in a VAO?

A VAO is an object that stores vertex bindings. This means that when you call glVertexAttribPointer and friends to describe your vertex format that format information gets stored into the currently bound VAO. And when you draw it will use the vertex bindings in the currently bound VAO.

When do you use a VBO in init?

Note that there is no mention of any VBO during init, just the binding points. That binding point is then used during draw to specify which vbo to pull the vertex data from: