Rasterizer

Rasterizer

Part of the Graphics Pipeline .

Input
Vertex positions in screen space and all exported attributes from the Vertex Shader
Output
Interpolates all the outputs of the VS using barycentric interpolation and calls the FS with them

Attribute interpolation #

Attribute interpolation cannot be done in screen space. As seen in the following picture.

Correct interpolation #

  1. Associate each vertex with all its attributes
  2. Divide all attribures by w
  3. Add 1/w as additional attribute
  4. when iterpolating an attribute, divide it by 1/w (last attribute) to get the corrected value
Calendar October 22, 2023