Move a triangle through transform, clip, rasterize, and final pixel
output.
Example
Move vertices through transform, clip, rasterize, and pixels.
highlighted = computed this step
Step 1 — Input vertices
Set up the exact input values.
vertices ((1, 1), (3, 1), (1, 3)) \begin{array}{c|c}\text{vertices}&\text{((1, 1), (3, 1), (1, 3))}\end{array} vertices ((1, 1), (3, 1), (1, 3))
Pipeline triangle pixels The transformed and clipped triangle is rasterized to covered pixels. 0 1 2 3 4 5 0 1 2 3 4 5
Step 2 — Transform
Compute the highlighted value.
delta and moved vertices ((1, 1), ((2, 2), (4, 2), (2, 4))) \begin{array}{c|c}\text{delta and moved vertices}&\hlmath{\text{((1, 1), ((2, 2), (4, 2), (2, 4)))}}\end{array} delta and moved vertices ((1, 1), ((2, 2), (4, 2), (2, 4)))
Pipeline triangle pixels The transformed and clipped triangle is rasterized to covered pixels. 0 1 2 3 4 5 0 1 2 3 4 5
Step 3 — Clip
State the structural verdict.
clip verdict inside \begin{array}{c|c}\text{clip verdict}&\hlmath{\text{inside}}\end{array} clip verdict inside
Pipeline triangle pixels The transformed and clipped triangle is rasterized to covered pixels. 0 1 2 3 4 5 0 1 2 3 4 5
Step 4 — Rasterize
Compute the highlighted value.
covered pixels ((2, 2), (2, 3), (2, 4), (3, 2), (3, 3), (4, 2)) \begin{array}{c|c}\text{covered pixels}&\hlmath{\text{((2, 2), (2, 3), (2, 4), (3, 2), (3, 3), (4, 2))}}\end{array} covered pixels ((2, 2), (2, 3), (2, 4), (3, 2), (3, 3), (4, 2))
Pipeline triangle pixels The transformed and clipped triangle is rasterized to covered pixels. 0 1 2 3 4 5 0 1 2 3 4 5 T T T T T T
Step 5 — Output pixels
State the final pixel set.
final pixels ((2, 2), (2, 3), (2, 4), (3, 2), (3, 3), (4, 2)) \begin{array}{c|c}\text{final pixels}&\hlmath{\text{((2, 2), (2, 3), (2, 4), (3, 2), (3, 3), (4, 2))}}\end{array} final pixels ((2, 2), (2, 3), (2, 4), (3, 2), (3, 3), (4, 2))
Pipeline triangle pixels The transformed and clipped triangle is rasterized to covered pixels. 0 1 2 3 4 5 0 1 2 3 4 5 T T T T T T
triangle-pipeline-capstone
The graphics pipeline is a chain: vertices are transformed, clipped to the viewport, rasterized, and finally written as pixels.