Unit content
Perspective-correct interpolation of vertex attributes
Barycentric interpolation is linear in the space where it is performed. After perspective projection, however, equal steps in screen space do not correspond to equal steps across the original 3D triangle.
Interpolating texture coordinates or other attributes directly from post-projection screen-space barycentric weights therefore produces visible distortion.
Perspective-correct interpolation compensates using each vertex's homogeneous depth. If an attribute is $a_i$ and the projected vertex has homogeneous coordinate $w_i$, the corrected value at screen-space barycentric weights $\lambda_i$ is
$$ a=\frac{\sum_i \lambda_i a_i/w_i}{\sum_i \lambda_i/w_i}. $$
This reconstructs the attribute as if it had been interpolated on the original 3D primitive before perspective division.
Depth and attributes used for texture mapping, shading and other fragment calculations must follow the pipeline's projective interpolation rules rather than being treated as ordinary linear screen-space values.
The need for this correction comes directly from the nonlinear perspective divide.