Monday, April 23, 2007

Ray Tracing - Project 10

Design Choices

I decided to model a chess set for my image. All pieces in the scene are modeled with triangles except the board (a box) and the ominous red sphere. All the chess pieces were modeled using Blender by myself and exported to the OBJ format, for which I wrote a mesh parser.

The board is rendered using two different Perlin noises and rendered with soft shadows by displacing the light position using a spherical distribution and many samples per pixel. The chess pieces have the same two materials as the board, so I tried to place them on opposing colors so the Perlin noise wouldn't match up perfectly.

This project took me a long time (close to twenty hours, I imagine), mostly because I took so long trying to decide what scene I wanted. I decided to do a chess theme since it gave me a lot of control over how I wanted to lay it out, and I didn't want to do anything too terribly abstract (like a bunch of dragons staring at a heightfield). The final images took around 30 minutes to render using 25 samples per pixel.

Extra Credit

My second Monte Carlo effect was embossed reflections. This was added to materials using a Russian roulette method, where either the diffuse color or the reflected color would be calculated based on the ratio assigned between the two. The embossed reflections were generated by perturbing the normal over a uniform disk. The disk size determined the amount of blurriness.

I originally blended the two colors together, but that introduced a number of artifacts. Switching to the Russian roulette method, these dropped significantly, but I still see an occasional blue splotch. Also, the Russian roulette method looks horrible at low-sampling rates since every other pixel might have a different shading calculation.

This is my final rendered scene using soft shadows and embossed reflections. It took about forty minutes to run using 25 samples per pixel


Wednesday, April 11, 2007

Ray Tracing - Project 9

Design Choices

To implement instancing, I created an instance class inherited from the Primitive class. This allowed a simple abstraction for adding groups and other objects and stuff. The preprocess function called the grid layout preprocess for every instance so I added a check to only preprocess once. I used a matrix and a vector to hold the translations and rotations and created to functions for rotating and translating.

This is a really stupid picture of the Stanford bunny rotated and translated around in a strange manner showing the transformations possible with the new instance class

I was feeling patriotic and made a giant bunny flag and just gave it three different colors based on a series of modulos. I was really bored

Code: project9.tar.bz2'