Spheres in water (aka I've lost my marbles)


Quick Intro

For my final project, I decided to implement antialiasing, depth of field, and soft shadows. I changed all my materials so the ray tracer uses the Cook-Torrance model to more accurately depict the scene. For antialiasing and depth of field, I used a 5x5 grid to oversample each pixel, and for soft shadows, 100 shadows rays are sent to each light source. Unfortunately, I had a little too much fun placing the spheres, and as the scene grew more and more complex, the time to render the scene grew exponentially longer. If I had some more time, I would have either tried to optimize the intersection testing or scrap the whole distributed ray tracing idea and gone for photon mapping.

Early soft shadow examples

Soft shadows were a pain to implement efficiently. What I did originally was to model each light as a cube, and as such, I only needed to send out 8 shadows rays to the corner of the cube to see if a particular point was affected by the light source. If it was, then I would send out 100+ shadows rays to the points sampled uniformly throughout the cube. The points inside the cube were jittered randomly for each ray-traced point.


Unfortunately the cube model of the light didn't work well for more complex shapes, and ended up leaving really weird looking shadows. I kept the initial testing of the 8 corners of the cube, but when it is determined that a light is casting some sort of shadow, I would then randomly sample over a sphere using the photon emission method from Jensen's book.

Test images

I played around with bumpmapping after seeing Diem's preview of his project in class, and tried to make the water in my glass "wavy". I decided not to use it since it was introducing weird artifacts, but it probably had to do with my way of implementing the function.

Here's a particularly nice picture of the spheres in water inside glass before I put in a sky.

Prior to getting everything all set up, I had to play around with the ray traced depth. 3 simply wasn't enough when I had objects inside other objects inside other objects. I ended up raising it to 4 and then to 5, and while 5 did the best for the spheres inside the glass of water, it oversaturated the glass planet circling above. I ended up settling for a depth of 4.


Final image

After 18 hours of rendering here's what I ended up with. This picture would have been nice, but I accidentally set the depth to 3. (doh!)

Since I really should be studying for finals though, I ended up ray tracing a much smaller image as my final image.

Blah. Can't seem to concentrate on studying on the finals. So here's a final render of the the final project. I finally have the oversampling and the depth correct...

And there you have it folks!