Reputation: 1161
I am new to opengl so I got confused about the terminology of vertex attributes and vertex. I wonder if someone could clarify for what exactly is a vertex attribute and how is it differ from a vertex.
Also, can you explain to me what does vertex attributes have to do with shaders?
Upvotes: 9
Views: 6340
Reputation: 22165
A vertex attribute is an input variable to a shader that is supplied with per-vertex data. In OpenGL core profile, they are specified as in
variables in a vertex shader and are backed by a GL_ARRAY_BUFFER
. These variable can contain, for example, positions, normals or texture coordinates.
A vertex is the combination of all the vertex attributes that belong together.
Upvotes: 13