Ray Tracer Project

I have written a ray tracer as a course project (for a senior graphics course at the University of Waterloo). Below are images highlighting the features implemented.

Antialiasing

  

No antialiasing.

Flagged pixels.

Antialiased

Soft Shadows

  

No soft shadows

Soft shadows (81 rpp).
 

Phong Shading

  

No phong

Phong
 

Constructive Solid Geometry (CSG)

  

Additional primitives

CSG

Another scene involving CSG

Texture Mapped Primitives

  

Textured primitives

Textured mesh (not using texture coordinates)
 

Texture Mapped Meshes

  

Textured primitives

Texture map

Textured mesh (using texture coordinates)

Refraction

  

Refraction

Objects in refractive materials

Refractive mesh

Caustics

  

Caustics

'Cowstics?' --Will

Photon map

Depth of Field (DOF)

  

DOF - Focused on middle pot

DOF - Focused on near pot
 

Octrees

  
ievollic@gl14> time ./render.pl macho_cows --no-aa --no-octrees
=======================================
- macho_cows.png: 512x512
=======================================
root : 0x80ff4c0
(e,v,u) : (p<0,2,30>,v<0,0,-1>,v<0,1,0>)
fov : 50
ambient : c<0.3,0.3,0.3>
lights : L[c<0.8,0.8,0.8>, p<200,202,430>, 1, 0, 0]
d-level : 0
length : 0
radius : 0
progress: [---------->]
tracing : [===========]
real 1m0.787s
user 1m0.220s
sys 0m0.050s
ievollic@gl14> time ./render.pl macho_cows --no-aa
=======================================
- macho_cows.png: 512x512
=======================================
root : 0x80ff4c0
(e,v,u) : (p<0,2,30>,v<0,0,-1>,v<0,1,0>)
fov : 50
ambient : c<0.3,0.3,0.3>
lights : L[c<0.8,0.8,0.8>, p<200,202,430>, 1, 0, 0]
d-level : 0
length : 0
radius : 0
progress: [---------->]
tracing : [===========]
real 0m7.534s
user 0m7.410s
sys 0m0.020s
 
No octreesOctrees (~8x faster) 

Fake Caustics

  

Real Caustics

Bogus Caustics
 

Glossy Reflection

  

Glossy Reflections
   

Projection Mapping

  

Caustic Photon Map w/o Proj Map

Projection Map

Caustic Photon Map w Proj Map

Final Scene