Anti-aliasing Polygons

Polygons edges suffer from aliasing just as lines do. If a line passes between two pixels, they share the intensity. the same method can be used on the scan-line fill.

The fill begins at the leftmost edge intersection. If the intersection is between two pixels X(i) < X < X(i+1) then pixel X(i) is assigned the intensity (X(i+1) - X). Pixel X(i+1) is assigned intensity 1.0 (unless the polygon is very narrow).

At the second intersection, where filling stops, the reverse is true, X(j) < X X(j+1). Pixel X(j) is assigned intensity 1.0 and X(j+1) is assigned (X - X(j)).