Usually I try to separate mesh specific information (VBO/VAO) from instance specific information (transform, uniforms, etc).
In this way parts of the code which manipulate instance info do not need to know anything about VBOs/VAOs, and vice-versa.
However, recently I have started to use hardware instancing using glDrawInstanced and the fact that instance attributes are bound together in the VAO is making my separation of concerns harder.
The reason is that usually the VBO/VAO was constructed from my .OBJ loader (which has all the info necessary to build this) and then other parts of the code only worried about shader uniforms. Now, these parts of the code need to know about the structure of the VAO in order to attach the info about their instance attributes.
This becomes even more annoying when I have VBOs which may be reused for both normal and instanced rendering.
Is there a recommended way that would allow keeping a separation of concerns between setting mesh attributes and instance attributes?
I thought of having two VAOs, one for normal rendering and another for instanced rendering where I would add the extra instance attributes I need, but I found no way to duplicate or inspect the original VAO data so it seems that my components need to know the actual structure of the VBO/VAO and not just about the instance parameters.