What are Uniform Variables in Shaders?
In Computer Graphics, the term "uniform" (plural: "uniforms") refers to a variable that is passed down to the vertex and the fragment shader.
Uniforms are data or variables that are defined at the software level and are passed down to both the vertex shader and the fragment shader.
An example of a point light shader that uses uniforms.
Uniforms can be updated over time (i.e. once per frame) allowing for software to change the outcome of a shader.
An example of adapting uniforms over time can be found in our tutorial on writing a point light shader, where sliders can change the appearance of the shader.
Looking for tutorials on how to implement shaders?
For examples on how to implement shaders in WebGL and Metal (Apple), consult the guides below.
Looking to learn more about how computer graphics (CG) are rendered?
Consult our article below to learn more about how computer graphics are rendered.
Looking to learn more about Technology, Augmented Reality, Virtual Reality, Mixed Reality or Spatial Computing?
Search our blog to find educational content on technology, A/R, V/R, M/R and spatial computing.