I am writing a renderer and am at the point to pick a final way to handle vao/vbo/shader management. On the web I found highly contradictory information on what is actually recommended. Right now idea is as follow:
-One VBO stores all meshes consecutively.
-Per "shader mapping" create a VAO to store the specific pointer mapping into VBO. ("shader mapping", consistent throughout different shaders with identical inputs)
then sort entities by "shader mapping" and render using offsets in the main VBO, thus minimizing shader and VAO switches. Something like:
for(shaders by mapping)
bindVAO(); //set pointers
for(shader)
for(entity using shader)
entity.setUniforms();
drawArrays(entity.offset, entity.size);
Since This would include a considerable amount of refactoring I wanted to ask if this solution is optimal at all. I'm also wondering if its possible to have multiple interleaved formats in a single VBO.