microZEUS
The whole stack, hand-drawn.

◄ Wiki / Graphics

fragment shader

A fragment shader is a small program the GPU runs for every fragment to decide its final color.

After rasterization produces fragments, the fragment shader runs once per fragment, computing its output color from inputs like textures, lighting, and interpolated values. It is the main place where surface appearance is defined — materials, shading, effects. Because it runs for potentially millions of fragments per frame, its efficiency directly drives frame rate.

See also

  • fragmentA fragment is a candidate pixel produced when the GPU rasterizes a triangle, before it is finalized on screen.
  • geometry shaderA geometry shader is a programmable GPU stage that can take a primitive and emit new primitives from it.
  • GLSLGLSL is the OpenGL Shading Language, a C-like language for writing GPU shader programs.

Referenced by

fixed-function tessellator · fragment · geometry shader · gl_PrimitiveID · GLSL · GLSL.std.450