Ray Tracing (CS6620) - Project 2

Kyle Madsen

Source Code

You can find the source code here

Required Image

Here is the required image generated by my raytracer:

Download as png or ppm
Download the scene file



I calculated this material like the other materials. This material has just more things going into the resulting color. To find bugs I also added an OpenGL viewer helper. This was a big help to find my bugs.


Funny I had more difficulties on this assignment then the first one, yet the first one was a lot more work. I pretty much had a difficulty in every section of the material. I also found certain techniques essential to solving my problems.

Time Spent:

Creative Image

Lots of reflection and refraction!

For the first project I created a scene file generator, but I didn't use it for this one. To build this scene file I made my scene have a very small resolution and I moved objects around until it looked cool to me. This was a bit easier to test things out since I made my OpenGL viewer that just re-reads the scene file, and re-renders the scene.

In this scene there is a metal disk to the right (in the background), and a metal plane to the left in the back. The subject of the scene features three spheres (two are dielectric) over a dielectric box. This scene took a rediculous amount of time, mostly because I get an error in my viewer when I try to run it in Release Mode. When I rendered this at 1024 X 1024 it took about 14 minutes. While it was rendering, I was writting this design doc. To get everything positioned where I wanted it, I was only rendering at depth 4 and my window size was 128 X 128. With my OpenGL viewer this was a lot easier. I tried to make it as balanced as possible, but the background metals were difficult to position. When I decided to take the time to render the BIG image, I set the depth deeper then necessary (just so I wouldn't have to do it again). You can see a lot of antialiasing, so I say we need to fix that!! That is all.

Download as png or ppm
Download scene file

Extra Work

OpenGL viewer

Right now this viewer is really simple, but there are a lot of features I'd like to add as the semester continues. Currently with the program you can select a program file from a list box and the program will read the scene file. When you press the Render button, it will display the image to the window. While running, you can click the left mouse button to shoot a ray into your current scene. This is very helpful for debugging! I am currently unable to run it in Release Mode so it is slower then it should be.