Rasterization

Rasterization turns a mathematical triangle into pixels by asking one question at every pixel — is my sample center inside? Fast enough for dedicated silicon, blind enough to alias: the staircase is the price of a binary answer, and more samples per pixel is the remedy.

Core Idea

A triangle is mathematics — three points and the plane between them. A screen is a grid of cells. Rasterization is the conversion, and it is nothing more than one question asked at every pixel: is this pixel’s sample center inside the triangle? Yes → the pixel gets a fragment; no → it’s skipped. Drag the triangle above and watch the grid chase it: the cream dashed outline is the math, the lit cells are the answer.

Every frame you have ever seen on a screen was made exactly this way — and the question is asked staggeringly often. A 2880 × 1800 display at 60 fps means ~311 million pixel decisions per second before a single shading instruction runs, which is why GPUs answer it in dedicated silicon, thousands of pixels at a time.

Fragments, Not Pixels

The rasterizer’s output is a fragment: a candidate pixel — coverage plus everything the fragment shader will need, delivered as barycentric-weighted values from the triangle’s three vertices (interpolation makes that touchable). A fragment is not yet a pixel:

Pixel is a location on screen; fragment is one triangle’s bid for it.

The Staircase Is the Price

A yes/no question can only produce a yes/no edge. Wherever the true edge crosses a pixel diagonally, the binary test rounds it to a step — aliasing:

The remedy is to ask the question more than once per pixel and report the fraction: 4 samples give five possible coverage values instead of two, fractions become intermediate tones, and the same grid reads smooth — that is supersampling. MSAA is its hardware discount: multiple coverage samples, but the expensive shading still runs once per pixel. Higher device-pixel-ratio rendering is the same idea again, priced per pixel — which is why DPR is one of the biggest levers on a GPU-bound frame.

Where It Sits

Rasterization is the pipeline’s hinge — the moment geometry becomes image:

vertices → clip → ÷w → NDC → viewport      geometry (per vertex)
        → RASTERIZE                         the hinge
        → fragments → shade → depth test    image (per pixel)

Everything before it is the vertex journey; everything after is per-fragment work. The count flips here too: thousands of vertices in, millions of fragments out — most scenes pay their bills on the pixel side of the hinge.

Connections

The weights each fragment carries are the barycentric story of interpolation; what the fragment does with them is shading; whether it survives is decided by the depth buffer of clip space. The whole machine exists because asking “which pixels does this triangle cover?” is vastly cheaper than ray tracing’s opposite question — “which triangle does this pixel see?” — and the GPU pipeline is the silicon shaped around that bargain.