My Octopress Blog

A blogging framework for hackers.

Parallel Ray Tracer

This afternoon I was able to successfully parallelize the ray tracer I wrote for Graphics II to run on the Alamode cluster at Mines. Using 17 machines, I was able to render a 4,096 x 4,096 pixel image with 25 passes and up to 5 reflections. It took only 1 minute and 20 seconds. [caption id=”attachment_481” align=”aligncenter” width=”300” caption=”Reflective spheres rendered at high resolution on a small cluster.”]Reflective spheres rendered at high resolution on a small cluster.[/caption] [caption id=”” align=”aligncenter” width=”300” caption=”Another image rendered on the same cluster”]Another image rendered on the same cluster[/caption]

For the benefit of those who are not computer scientists, this is what the input file looks like: 8192 8192 0 0 20 -1 -1 1 2 0 0 0 2 0 3 10 10 0.8 0.2 9 # These next few lines will define a triangle T # With one of the points at (1, 1, 1) 1 1 1 # and the next point here: 0.12321 0.12321 -1 # and the last point here: -1 1 1 # and with this color setting 1 1 1 1 1 1 0 1 0.7 T -1 1 1 -0.12321 0.12321 -1 0.12321 0.12321 -1 1 1 1 1 1 1 0 1 0 T 1 -1 1 0.12321 -0.12321 -1 -1 -1 1 1 1 1 1 1 1 0 1 0 T -1 -1 1 -0.12321 -0.12321 -1 0.12321 -0.12321 -1 1 1 1 1 1 1 0 1 0 T 1 1 1 0.12321 0.12321 -1 1 -1 1 1 0 0 1 0 0 0 1 0 T 1 -1 1 0.12321 -0.12321 -1 0.12321 0.12321 -1 1 0 0 1 0 0 0 1 0 T -1 1 1 -0.12321 0.12321 -1 -1 -1 1 1 1 0 1 1 0 0 1 0 T -1 -1 1 -0.12321 -0.12321 -1 -0.12321 0.12321 -1 1 1 0 1 1 0 0 1 0 S 0 0 0 0.5 1 0 1 1 0 1 0 1 0.3