[Solved] Why is there the need for the index argument in glEnableVertexAttribArray? [duplicate]

[ad_1]

Because it’s possible to set a vertex attribute to a value that’s constant for all elements using glVertexAttrib. Yes, you could to that to the same effect with a uniform as well, but this kind of per-attribute selection of where a value comes from (sourced from array, or set constant) has been around for ages (ever since OpenGL-1.1, although back then it was not generic attributes, but specific ones, i.e. position, color, normal and so on) and this legacy rubbed of onto generic vertex attributes.

[ad_2]

solved Why is there the need for the index argument in glEnableVertexAttribArray? [duplicate]