Undergraduate Project – Raytracer

April 29th 2009, No Comments

One of the assignments that I worked on during undergraduate studies at the University of Toronto was a raytracer, which I wrote for a 4th year computer graphics course. My raytracer took first place at the Fall 2006 Wooden Monkey competition. The prize: fame, glory, and a wooden monkey :)

Scene 3: Colored Area Light

Raytracing Final Project (more images after the break!)

Some features of the raytracer are:

  1. CSGs, Arbitrary Polygonal Objects (loaded from wavefront obj files)
  2. Normals are phong interpolated for smooth shading
  3. Texture mapping with bilinear interpolation. Can be applied to any channel of phong model, as well as luminosity
  4. Reflections and refractions
  5. Diffuse (blurry) reflections and refractions (diffusivity can be set)
  6. Point lights with shadows
  7. Area lights: Polygonal geometry can serve as an area light. Texture can be applied to the luminosity channel of the  geometry; this way the mesh can cast light with varying color and intensity over its surface.

The images below show how these features can be applied to a scene in order to enhance its visual appearance:

1_signature

signature

2_diffuse

diffuse

3_diffuse_with_shadows

shadows

4_recursive_depth1

reflections (recursion depth: 1)

5_recursive_depth2

reflections (recursion depth: 2)

6_texture

texture mapping

7_refraction

refraction (blue sphere)

8_blurry_ref

diffuse reflections & refractions

9_soft_shadows

area lights (and resulting soft shadows)

a3_csg

CSG subtractions

Finally, the images below combine the features of the raytracer. These images were submitted to the Wooden Monkey competition and took first place. In order to tune the lighting and various other parameters, thumbnail-sized images were rendered. Rendering times for full resolution images were about 2 hours each.

SScene 1 Close-up Test Rendering

Scene 1 Close-up Test Rendering

Scene 1 Final

Scene 1 Final

Scene 2: More Geometry

Scene 2: More Geometry

Scene 3: Colored Area Light

Scene 3: Colored Area Light

Tags: ,

Leave a Reply