Acceleration

Our acceleration structure was not quite complete at the time of the assignment 5 submission. However, the ray tracer now uses a kd-tree of axis-aligned bounding boxes. The performance is dramatically improved through the use of this algorithmic acceleration for complex geometries, which is enabled by running the program with the “-accel” flag.

Usage of ray tracer:

./hw5 -accel input.test

Single-thread performance: 4.55 sec for hw5 dragon at VGA
Eight-thread performance: 9.811 sec for hw5 dragon at VGA , 5x AA (782800 rays/sec)

This dragon image (without antialiasing) took over 90 minutes to render without acceleration and under five seconds using the bounding box hierarchy.

This dragon image (without antialiasing) took over 90 minutes to render without acceleration but finished in 4.552 seconds using the bounding box hierarchical kd-tree (single thread on hive machine).

In addition to very fast rendering times for the standard VGA-resolution images, one benefit of the acceleration is the ability to render complex geometries at higher resolutions. With 4x uniform antialiasing, XGA (1024×768) images of the Stanford dragon can be finished in reasonable times. This corresponds to rendering over 12.5 megapixels.

dragon_xga_4x_aa

This dragon was rendered with 4x uniform antialiasing and 1024×768 base resolution. Time to render with one thread on a hive machine was 1 minute, 35 seconds.

A further performance improvement came from selectively antialiasing pixel with an associated value of the Sobel operator above a parametrizable threshold (see  https://raytracing2012.wordpress.com/edge-detection/). This drastically cuts the number of samples required for achieving the desired smoothed appearance. Dragons rendered at XGA resolution with 4x antialiasing for pixels with high Sobel operator values completed three times faster than with uniform antialiasing.

dragon_xga_sobel_4x_aa

Edge-detection based antialiasing (Sobel operator computed on unit intensity, threshold 0.5, 4x edge antialiasing)
Single-threaded rendering time: 31 seconds at XGA resolution