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 #
- Associate each vertex with all its attributes
- Divide all attribures by w
- Add 1/w as additional attribute
- when iterpolating an attribute, divide it by 1/w (last attribute) to get the corrected value