Antialiasing#

We have seen in the previous sections that when an idealised image is represented using a raster array, lines and edges of curved and sloping surfaces appear jagged because pixels are square. We can attempt to reduce this effect by using antialising which is the process of smoothing lines and edges so that they appear less jagged. Antialiasing is achieved by illuminating the pixels adjacent to the idealised image using a colour intensity less than that of the colour intensity used for the rasterised image. There are several approaches used in practice and the most common of these is super sampling antialiasing.

Super sampling antialiasing#

Super sampling antialiasing (SSAA) uses a raster which has \(\times 2\) or \(\times 4\) the number of pixels in the horizontal and vertical directions as the display which is known as a super sample. The scene that is to be rendered is calculated using the super sample and the colours of each pixel on the display raster is then calculated by averaging the pixels of the super-sample raster that correspond to the pixel on the display raster.

../_images/antialiasing.svg

Fig. 105 Super sampling antialiasing.#

Consider the diagram in Fig. 105 where four pixels from a \(\times 2\) super sample are combined to produce the display pixel. Averaging the colour triplets gives

\[\begin{split} \begin{align*} \text{display pixel colour} &= \frac{(255, 255, 255) + (128, 128, 128) + (192,192,192) + (0,0,0)}{4}\\ &= (144, 144, 144). \end{align*} \end{split}\]

The affects of applying a \(\times 2\) super sample antialiasing can be seen in Fig. 106.

../_images/antialiasing_example.png

Fig. 106 Filled circle with (left) and without (right) \(\times 2\) super sampling antialiasing applied.#