gl_VertexAttrib[n] syntax? Where is it?

You know how you can reference gl_Vertex, gl_Normal, gl_Color, gl_MultiTexCoord0, etc. in a shader to refer to vertex attributes 0, 2, 3, 8, etc.

Where’s the syntax to reference vertex attributes 1, 6, and 7?


You can not reference the generic vertex attributes using the built-in vertex attributes in GLSL. At least not in guaranteed way because the specification requires that they should be not aliased (except for attribute 0 and gl_Vertex). The Nvidia does not follow this requirement because of backward compatibility issues and aliases them. So this might work (I did not tested that) on Nvidia cards even if it should not based on the specification.

Ok, thanks Komat.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.