So I recently learned about VAO (Vertex Array Object), and so far they seem pretty awesome, but I have a problem I cant seem to solve. I have a bunch of models, their vertex-states are stored in separate VAOs, so a single call to
glBindVertexArray(VAO);
is all that is needed to begin draw an instance of this. The problem lies in that I have to bind an additional VAO, one containing the data for a
glDrawElementsInstanced();
call. So it contains data like offset, UV-offset, color-overlay etc. When I bind this, the previous one seem to unbind itself, which makes sense in OpenGL I guess, but I'm not sure what to do to have both active?
The idea is to draw all static objects that shares the same model without uploading any data per-frame. Is this a wrong approach entirely?