What is the difference between Constant Vertex Attributes and Uniforms?
- by Samaursa
According to the OpenGL ES 2.0 Programming Guide:
A constant vertex attribute is the same for all vertices of a primitive, and
therefore only one value needs to be specified for all the vertices of a
primitive.
For uniforms the book states:
...any parameter to a shader that is constant across either all vertices or
fragments (but that is not known at compile time) should be passed in as
a uniform.
I've always used uniforms for data that is constant for a primitive but now it appears that attributes can also be used in the same way. Is there more to constant vertex attribute than simply 'they are the same as uniforms'?