In computer graphics, triangle setup is the rasterization stage that prepares a screen-space triangle for coverage testing and interpolation. It calculates edge-related data and gradients so later stages can determine which samples lie inside the triangle and derive values such as depth and shading attributes. The phrase is also used for a Brazilian jiu-jitsu technique, but the explanation below covers the graphics meaning.
What triangle setup does
After a triangle’s vertices have been transformed into screen or window coordinates, the rasterizer needs information to evaluate the triangle across the screen. Triangle setup computes that information—often including edge equations or slopes, differentials, and depth gradients—and makes it available to later rasterization work.
As an Amazon Associate I earn from qualifying purchases.
Real-Time Rendering, Fourth Edition defines the stage this way: “In this stage the differentials, edge equations, and other data for the triangle are computed.” The authors describe those values as supporting triangle traversal and interpolation of shading data from the geometry stage. The specific data and hardware organization vary by GPU; this is a conceptual description, not a claim that every GPU implements an identical block.
How setup fits into rasterization
- Triangle vertices reach screen space. The preceding graphics stages transform the geometry into coordinates suitable for rasterization.
- Setup computes triangle data. Edge-related quantities and interpolation gradients provide a compact basis for later tests and calculations.
- Traversal tests coverage. Rasterization checks pixels or individual sample positions against the triangle and identifies coverage, producing fragments for covered locations.
- Interpolation derives fragment values. Per-vertex values are interpolated across the triangle; these can include depth and data used by later shading.
Setup prepares the information; it does not itself mean “shade every pixel.” Coverage testing and fragment generation belong to the subsequent traversal work.
How a rasterizer determines whether a pixel is inside
The edge data lets rasterization evaluate sample positions relative to the triangle’s boundaries. A simple illustrative method tests one sample at the pixel center. That is not the only approach: multisampling or supersampling evaluates multiple samples, and conservative rasterization uses a broader overlap rule. Under the definition described in Real-Time Rendering, conservative rasterization treats a pixel as inside when at least part of it overlaps the triangle.
Because the result depends on where and how coverage is sampled, “inside the triangle” is not always equivalent to a single universal pixel-center test. Exact edge handling and sample rules depend on the rasterization method and implementation.
What data can triangle setup calculate?
- Edge equations or slopes: used by later work to evaluate triangle boundaries at sample positions.
- Differentials or gradients: describe how relevant values change across the triangle and support interpolation.
- Depth gradients: support calculating depth at locations inside the triangle.
These are examples of the kinds of data involved, not a fixed list of fields required in every GPU’s triangle-setup implementation. One graphics-processor patent describes an example that sorts vertices by x and y, assigns triangle descriptors, computes edge slopes and depth gradients, and passes data downstream. It illustrates one design rather than defining all hardware.
Recommended Free Tools
Triangle setup is not a jiu-jitsu setup
In Brazilian jiu-jitsu, “Lapel Triangle Setup” names a gi-specific entry that uses the lapel to isolate an arm and move toward triangle control. That is a separate use of the phrase, not a graphics-pipeline stage.
Rank #3
Further reading
For a broader treatment of rasterization and the graphics pipeline, see Real-Time Rendering, Fourth Edition by Tomas Akenine-Möller, Eric Haines, Naty Hoffman, Angelo Pesce, Michał Iwanicki, and Sébastien Hillaire, A K Peters/CRC Press (2018). Its section 2.4.1 discusses triangle setup and traversal. The publisher lists the book’s graphics rendering pipeline content, and the authors’ resource page identifies the edition and print ISBN.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




