Antialiasing

Uniform (as opposed to edge-detect) antialiasing was the first extra feature added to the ray tracer. In order to control the level of antialiasing applied to the image, a new command was added to the input file parser.

antialias level

Here, “level” is an integer greater than zero; it indicates the degree of antialiasing in the linear dimension. Therefore, the number of rays shot per pixel is the square of the level. Using XGA resolution (1024×768), the Stanford dragon and the Cornell box may be compared with no antialiasing and with 5x antialiasing.

The image was sampled at level * width points in the x-direction and level * height. Then, tiles measuring level on a side were averaged in color. The resulting image was then written out.

In practice, higher levels of antialiasing did not yield greater visual quality. Furthermore, since 5x antialiasing represents an approximately 2500% increase in running time, an impetus was provided for implementing selective antialiasing, as done with edge detection.

XGA Dragon, no AA (single-threaded render time: 8.357 seconds)

XGA Dragon, no AA (single-threaded render time: 8.357 seconds)

XGA Dragon, 5x AA (single-threaded render time: 148 seconds)

XGA Dragon, 5x AA (single-threaded render time: 148 seconds)