Ray Tracing Application

Source Code on GitHub

For a computer graphics class at DePaul, I wrote a ray tracing application in C++. The skeleton of the code was provided by the professor but I wrote the bulk of the code in the final product. The in class version included Phong illumination and shading, reflective materials, checkered textures, polygons and spheres.

Since the class I have extended the ray tracer to include planes, octahedra and cubes for shapes, a multicolored rainbow material, a reflective checkerboard material, rectangular array sampling for anti-aliasing, monte carlo sampling for anti-aliasing and more advanced monte carlo sampling for anti-aliasing using edge detection.

renderDefault

This render shows an octahedron, a rectangular prism made from a cube, the rainbow material and the reflective checkerboard material. Note the aliasing on the edges of the objects and in the distance. This was rendered in 1.140 seconds.

render4x4Array

This render shows the rectangular array subpixel sampling for antialiasing. This functionality was described in a short comment by the professor but not explained in class. I implemented it on my own. This was rendered in 13.596 seconds.

renderMonteCarlo16

This render shows a monte carlo subpixel sampling algorithm for anti-aliasing. This functionality was again described in a short comment by the professor but not explained in class and I implemented it on my own. This was rendered in 13.393 seconds.

renderEdgeDetection

This render shows an edge detection algorithm that I designed and implemented myself. It compares the colors on the corners of the pixel to the color in the center of the pixel. In this render, if the colors are more different than an inputted difference threshold, they are rendered black, otherwise they are rendered white. This was rendered in 5.017 seconds.

renderMonteCarloAdvanced4-16

This render shows a more complicated monte carlo subpixel sampling algorithm for anti-aliasing. It runs the same edge detection algorithm from above but if the corner colors are more different than the center color than a difference threshold, they are rendered with more samples. This makes edges smoother and more accurate. This method is similar in quality to the rectangular anti-aliasing algorithm but runs in about half the time. This was rendered in 6.356 seconds.

Source Code on GitHub

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s