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.

Reflective spheres rendered at high resolution on a small cluster.

Reflective spheres rendered at high resolution on a small cluster.


Another image rendered on the same cluster

Another image rendered on the same cluster

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

Tagged with:
 

For Graphics II, we had to implement a raytracer, and then add anti-aliasing and a feature of our choice. I selected mirrored surfaces.

First, anti-aliasing. Here are a few pictures of the same image rendered with a different number of passes to change the smoothness.

Using one pass

Using one pass


Using 5 passes.

Using 5 passes.


Using 50 passes.

Using 50 passes.

And lastly, here’s a scene of several spheres, some of which are reflective.

A set of spheres, some of which are mirror-like.

A set of spheres, some of which are mirror-like.


A reflective sphere next to some triangles.

A reflective sphere next to some triangles.


A mirrored sphere in the center of four other sphere.

A mirrored sphere in the center of four other sphere.


More spheres!

More spheres!

Tagged with:
 

Raytracer

Last semester for Graphics, we each wrote raytracers, and this semester for Graphics II, we’ve been asked to add more advanced features to them.

I had written mine in Ruby for its short development cycle, but raytracers aren’t the most efficient renderers on the planet, and it would take hours to run on a single input on occasion. So, not wanting to deal with that this semester, I rewrote it in C++. Much faster. The most difficult input (same set) now takes about a minute. I finished it up today, and here are some pretty pictures to sate you:

Tagged with: