OpenGL Programming Guide: The Official Guide to Learning OpenGL, Version 4.3, Eighth Edition
by Dave Shreiner, Graham Sellers, John M. Kessenich, Bill M. Licea-Kane
Fragment Shading
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access