March 2013
Intermediate to advanced
984 pages
26h 18m
English
The final stage where you have programmable control over the color of a screen location is during fragment shading. In this shader stage, you use a shader to determine the fragment’s final color (although the next stage, per-fragment operations can modify the color one last time), and potentially its depth value. Fragment shaders are very powerful as they often employ texture mapping to augment the colors provided by the vertex processing stages. A fragment shader may also terminate processing a fragment if it determines the fragment shouldn’t be drawn; this process is called fragment discard.
A helpful way of thinking about the difference between shaders that deal with vertices and fragment shaders is: vertex shading (including ...