Is it possible to add vbos to vbos after their creation? For example (pseudo-code):

glGenVertexArrays(1, &_vao);
// do init stuff

// Much much later in a galaxy far away
glGenBuffers(1, &_instance_vbo);
glBindBuffer(GL_ARRAY_BUFFER, _instance_vbo);
glBufferData(GL_ARRAY_BUFFER, sizeof(blee), blee, GL_STATIC_DRAW);
glVertexAttribPointer(_vpos_att, 3, GL_FLOAT, GL_FALSE, 0, (void*)0);

// Draw

So far it hasn't really worked. Looking at the bound vbos to my vao (using GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING) shows no buffers bound. Though that may be another problem altogether.


1 Answer 1


So after debugging some more, I've found that yes it is possible. You cam add buffers later on but they will need to point to their own attributes.

My issues came from thinking I could have multiple vbos contributing to a single attribute. That doesn't work. You need multiple vaos for that scenario.

  • $\begingroup$ What do you mean with "multiple vbos contributing to a single attribute"? This does never work, even with multiple VAOs this wouldn't work. A single attribute can only ever be sourced from a single VBO. So it seems you mean something different when you say "contributing to a single attribute". If you mean sourcing different attributes from different VBOs, this is very much possible, even with just a single VAO. $\endgroup$ Apr 9, 2019 at 9:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.