I have a VBO that contains multiple 3d models stored one after another with the intention of drawing the models conditionally with multiple calls to functions like glDrawElements. Each model is meant to have a fixed position. Before each call to glDrawElements, I can pass the model's position as a uniform, however because there are a lot of models doing so is very costly.
I'd like to store each model position in the VBO memory once per model (not per vertex) and have access to it from every vertex in the shader while drawing that model.
My hope was to have a vertex attrib pointer with an offset that points to the model position and with a stride of 0 so that it doesn't increment the memory per vertex, but unfortunately a stride of 0 moves the pointer forward as if it's tightly packed.
Is there any way to accomplish what I want? Also, I'm curious why OpenGL doesn't allow a stride of 0. It would have been so convenient.