# VAO & binding multiple VBOS

**URL:** <https://community.khronos.org/t/vao-binding-multiple-vbos/77291>\
**Category:** OpenGL: Basic Coding\
**Created:** [January 19, 2019, 8:07am UTC](https://community.khronos.org/t/vao-binding-multiple-vbos/77291 "2019-01-19T08:07:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dariusz](https://community.khronos.org/letter_avatar_proxy/v4/letter/d/7ea924/32.png) [@Dariusz](https://community.khronos.org/u/Dariusz)\
**Post date:** [January 19, 2019, 8:07am UTC](https://community.khronos.org/t/vao-binding-multiple-vbos/77291/1 "2019-01-19T08:07:04Z")

</div>

Hey

I wonder if its possible to

```auto

{
  Bind VAO.
  bind VBO_vertexA;
  bind VBO_vertexB;
  bind VBO_vertexC;
  bind VBO_vertexD;

  bind VBO_indicesA;
  bind VBO_indicesB;
  bind VBO_indicesC;
  bind VBO_indicesD;

  bind VBO_normalsA;
  bind VBO_normalsB;
  bind VBO_normalsC;
  bind VBO_normalsD;
  Release VAO
}

{
  Bind VAO
  draw(VBO_vertexA meshes)
  draw(VBO_vertexB meshes)
}

```

etc etc? So I can have multiple vbos under 1 VAO that are vertex/indices/uvs/normals and then draw each of them 1 by 1 or something like that? I would like to glDrawElementsBaseVertex on each VBO and provide a uniform matrix/flags per each set of vertex that I would like to draw.

---

<div class="post-metadata">

**Author:** ![GClements](https://community.khronos.org/letter_avatar_proxy/v4/letter/g/e0b2c6/32.png) [@GClements](https://community.khronos.org/u/GClements)\
**Post date:** [January 19, 2019, 10:51am UTC](https://community.khronos.org/t/vao-binding-multiple-vbos/77291/2 "2019-01-19T10:51:08Z")

</div>

A VAO stores the current GL\_ELEMENT\_ARRAY\_BUFFER binding, plus the state associated with each attribute array.

Calling glBindBuffer(GL\_ARRAY\_BUFFER) doesn’t itself change the VAO state. A call to glVertexAttribPointer() stores the buffer currently bound to GL\_ARRAY\_BUFFER, along with its parameters.

So if you have a sequence of calls like:

```auto

glBindVertexArray(vao);
glBindBuffer(GL_ARRAY_BUFFER, buffer_0);
glVertexAttribPointer(0, ...);
glBindBuffer(GL_ARRAY_BUFFER, buffer_1);
glVertexAttribPointer(1, ...);
...
glBindVertexArray(0);

```

it will store the buffers associated with each attribute. If you have multiple glVertexAttribPointer() calls which all use the same attribute index, each one will overwrite the state set by the previous call for that index, leaving the state set by the last such call. You can’t store multiple element arrays.
