raytracer

Samples

Spheres | Shadows | Ellipsoids | Refraction | Directional Lights

Spheres

This demonstrates reflection. There are four spheres, and two fully reflective mirrors behind the spheres and behind the camera, causing an long chain.

Input

[spheres_antialias.txt]

$ time ./assignment4 output/spheres_antialias.txt output/spheres_antialias.png
./assignment4 output/spheres_antialias.txt output/spheres_antialias.png 215.34s user 0.05s system 98% cpu 3:39.11 total

Output

spheres_antialias.png

Cool Bug

After submitting the project, I was playing around with my ray tracer, and I introduced a bug that generated a really neat image with this input, and I thought others might find it cool.

cool_bug.png


Shadows

This demonstrates a triangle primitive and a small sphere shadowing a larger sphere.

Input

shadow.txt

$ time ./assignment4 output/shadow.txt output/shadow.png
./assignment4 output/shadow.txt output/shadow.png 62.47s user 0.86s system 88% cpu 1:11.26 total

Output

shadow.png


Ellipsoids

This demonstrates arbitrary oriented ellipsoids shadowing each other.

NOTE: I found a bug with normal transformations in the code after the due date, and this image was affected, the fixed image is shown after the original.

Input

ellipsoid.txt

$ time ./assignment4 output/ellipsoid.txt output/ellipsoid.png
./assignment4 output/ellipsoid.txt output/ellipsoid.png 51.80s user 0.02s system 99% cpu 51.995 total

Output

ellipsoid.png

Output (fixed, after submission)

ellipsoid_fixed.png


Refraction

This demonstrates refraction, reflection, and triangles. Also this demonstrates AABB trees. Without them, it took more than 2 times as long to render, with 1/4th the amount of the antialiasing (doing 1/4 times as much work).

NOTE: The checkerboard pattern was generated in code. To activate, uncomment section at the end of the scene constructor.

Input

refraction.txt

$ time ./assignment4 output/refraction.txt output/refraction.png
./assignment4 output/refraction.txt output/refraction.png 2884.47s user 0.67s system 99% cpu 48:14.32 total

Output

refraction.png


Directional Lights

This demonstrates the usage of both point and directional lights, and interesting object shading.

Input

directional.txt

$ time ./assignment4 output/directional.txt output/directional.png
./assignment4 directional.txt directional.png 85.18s user 0.02s system 99% cpu 1:25.69 total

Output

directional.png

Valid XHTML 1.0 StrictValid CSS!
Generated on Thu, 12 Dec 2013 20:28:12 UTC