Sterling Hirsh

CSC 473 Final Project

For Zoë Wood

Spring 2011

Project Description

The official goal of this project was to create a fast raytracer capable of rendering reflections, refractions, and monte carlo indirect lighting. The speed of the raytracer is due in part to its use of CUDA to run intersection tests on the GPU. To this end, I worked with Felix Turgeon and AJ Ignacio from Dr. Lupo's CPE 458 Parallel Processing class. The raytracer also uses a bounding volume hierarchy to reduce the number of intersection tests performed per ray.

The unofficial goal of this project was to create a raytracer that could efficiently handle very large renders. This required the use of clever memory management. Many of the other raytracers in the class were inefficient at or even incapable of generating images as large as this raytracer did (10240x7680, or 78.6 MegaPixels). Several large renders are linked at the bottom of the page, but, due to their size, they are not shown on the page.

Run Times

I will compare run times on the CPU to those on the GPU. CUDA has a roughly 10-second startup overhead, so the GPU will appear extrememly slow for small renders. However, large images, images with high antialiasing settings, and images with high monte carlo settings will see a benefit. I will compare run times for bunny_jumbo (~36k spheres) below.

Size AA MC Samples MC Depth Time CPU Time GPU
640x480 1 - - 0:01.74 0:11:95
640x480 16 - - 0:12.43 0:15:25
2560x1920 1 - - 0:14.20 0:16:78
2560x1920 16 - - 3:06.74 1:02:21
640x480 1 32 1 0:14.57 0:15.20
640x480 1 32 2 3:55.58 0:46.86
640x480 1 256 1 1:46.53 0:37.91
10240x7680 1 - - 3:53.61 1:46.31


Here is my favorite render scaled down from 10240x7680, with zoomed in pictures following. This picture does not have monte carlo enabled, but was created with 9x AA. It took about 1:40:00 to render on Tesla.

Zoom, enhance.

Zoom, enhance.

Actual Size:

Rainbow Room:

Actual Size:

Another Actual Size:

This one demonstrates monte carlo. It was 5120x3840 in a sphere and took about 2:20:00 to render with 9x Monte Carlo sampling. The low sampling amount is evident when zoomed in all the way, but is hard to see when scaled down.

Actual Size:

Large Renders

Bunny Small Reflect 2 @ 10240x7680

Bunny Jumbo @ 10240x7680

Bunny Tasty @ 10240x7680

Bunny Small In Sphere @ 5120x3840


CUDA Programming Guide

Bob Somers' Cubuild