Hi,
I’ve implemented a Wavefront object loader for my Opengl 4.1 context program. I use Vertex Buffer Objects and Vertex Arrays for the multiple meshes. It works perfectly with the vertex, normal, tangent and texture coordinates information sent to the GPU.
In order to map textures to these multiple meshes I had a choice of using texture atlases or 2D texture arrays. I opted for 2D texture arrays since my textures were never going to differ in size. So I added another vertex attribute to each vertex in each mesh corresponding to the layer number in the array.
This implementation works. However since I also have a normal map and perhaps an additional light map implementation later on, I was wondering if there was a better way to choose the layer to use than to use glVertexAttribPointer for each vertex. Uniforms as far as I know would not work in this situation. I also tried using glVertexAttrib with little success (probably not using it right - and would still be per vertex).
Any advice would be appreciated.