What is a Shader?
In Computer Graphics, the term "shader" refers to software that uses two four-dimensional (4D) programs, known as the vertex shader and the fragment shader, that together define the form and appearance of an object, model or geometry.
Shaders are computer graphics programs that are broken down into two four-dimensional (4D) programs:
- Vertex shaders which are responsible for defining the position of vertices and thus, the form of a geometry, model or object.
- Fragment shaders which are responsible for defining the visual output of a geometry, model or object.
An example of a point light shader that uses uniforms.
Shaders are capable of taking in data or variables that are defined in software through uniforms and attributes as well as transferring vertex specific data or variables from the vertex shader to the fragment shader through varying or in/out variables.
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.