What is the difference between Constant Vertex Attributes and Uniforms?
Posted
by
Samaursa
on Game Development
See other posts from Game Development
or by Samaursa
Published on 2012-11-19T15:41:00Z
Indexed on
2012/11/19
17:24 UTC
Read the original article
Hit count: 283
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'?
© Game Development or respective owner