Unit content
Programmable rasterization pipelines and shaders
Modern real-time graphics exposes parts of the rasterization pipeline as small programs called shaders.
A simplified pipeline is:
- fetch vertex data;
- run a vertex shader to transform each vertex and produce attributes;
- assemble and clip primitives;
- rasterize them into fragments;
- interpolate vertex attributes;
- run a fragment shader to compute per-fragment outputs;
- apply visibility and blending tests to update framebuffer attachments.
The vertex and fragment stages execute many independent invocations over large collections of vertices or fragments. This data-parallel structure is one reason graphics processors are effective for raster rendering.
A shader does not normally decide which triangle covers which pixel; fixed-function rasterization performs that geometric sampling between the programmable stages.
Graphics APIs differ in syntax and exact stage names, but the conceptual division between data buffers, programmable transformation/shading, rasterization and framebuffer operations is portable across APIs.