Fragment
shaders
compute the colour of a
fragment. They may draw upon different attributes at
the fragment, including
- Colour
- Surface
normal
- Depth
(distance from camera)
- Texture
coordinate and texture
- (more)
A
simple fragment shader might just interpolate between the colour values passed
in from vertex shaders or
it can introduce complex processing.
The
fragment shader runs once for each fragment.