This example uses an attribute variable for the vertex position, and a uniform variable for the colour.
There are no varying variables in this example.
-
Attribute Variable: variables that help describe each vertex. Examples include: position, normal, and texture coordinate.
Each vertex has its own attribute variables.
-
Uniform Variable: Variables that are used to describe one or more primitives like Triangles, or Lines.
Examples include: modelling transforms and colours.
-
Varying Variables: Variables that are computed in the vertex shader and passed to the fragment shader. Varying variables
are interpolated for each fragment. If triangles are being drawn the varying variables are interploated between the calculations for each
vertex of the triangle.