glVertexAttribPointer()
's first argument is an index representing where the vertex attribute resides, Opengl offers a minimum of 16 slots.
I want all 16 to represent different vertex attributes (position=0, uvs=1, colors=3, weights=8, etc) and for these to be constant across every vertex type, even if the vertex doesn't use that attribute.
My question is, does it matter at all if the indices are not contigious for a given vertex? For example, would this be inefficient at all:
enum Attrib : GLuint {
aPos = 0,
aUv1 = 1,
aUv2 = 2,
aColor1 = 3,
aColor2 = 4,
aNormal = 5,
aTangent = 6,
aBitangent = 7,
aBoneIndex = 8,
aBoneWeight = 9,
aAttrib1 = 10,
aAttrib2 = 11,
aAttrib3 = 12,
aAttrib4 = 13,
aAttrib5 = 14,
aAttrib6 = 15,
a__count = 16
};
glVertexAttribPointer(aPos, ...);
glVertexAttribPointer(aUv1, ...);
glVertexAttribPointer(aAttrib1, ...);