= Fragment shader
A <fragment shader> is a programmable stage of the <rasterization> pipeline that computes values for a fragment, such as its output color and optionally its depth. It receives interpolated data from rasterized primitives and can use <texture mapping> to sample an image. A fragment is a candidate contribution; later tests and blending determine what reaches the final <digital image>.<The OpenGL Graphics System Version 4.6 Core Profile by Khronos Group>[Chapter 15, Fragment Shaders; Chapter 17, per-fragment operations]{ref}
For example, a shader can multiply a surface's interpolated color by a sampled image to decorate a triangle. A fragment hidden behind a nearer opaque surface may fail the <depth buffer> test. With multiple samples per <pixel>, fragments, shader invocations and final pixels need not correspond one to one.
Back to article page