I'm trying to figure out the best way to support multimaterial meshes.
A. One way I was doing it before is to have one VBO and IBO for the entire mesh, and have different draw calls per material using glDrawRangeElements.
B. Another way that's much easier for me at the moment due to the tools that I have is to actually have the meshes split up per material, and have them be completely separate meshes with their own geometry. To the Artists, it would still be as if they're working with one giant mesh to keep things convenient.
Either way I'd be currently sorting draw calls first by the material/shader and then by meshes themselves.
Since I'm doing this, I was wondering if there's any performance hit due to using large VBOs at all.
Let's say I'm doing option A and I have one giant VBO and IBO for the mesh. Since all my draw calls are sorted by shaders and textures, I might bind the VBO for a large mesh, only draw a small portion of it, then bind another VBO for a different large mesh, and etc... Then later, when it comes time to draw the other materials in the mesh, I bind that large VBO again, and draw another small portion of it. Is this a concern for performance? I was wondering if I'd be thrashing some cache or something. I have no idea how this works within the GPU or if I should even worry about it.






