blog banner

Ray Tracer

A simple Ray Tracer with photon mapping in C++.


  • Loads scenes in .ms3d format.
  • Performs a first-hit speed up by rendering the scene with the GPU into multiple buffers (color, normal, world, etc).
  • Starts at each pixel in the GPU rendered buffers and performs standard CPU ray-tracing to calculate soft-shadows, reflections and refraction.
  • Diffuse interreflections are handled by generating a photon map and storing it in an octree.  Photons are sampled in the final gathering step at each picel.

There are images of my latest progress below.  Click on the pics to get a bigger image.

Uncompensated Overtime


200k triangles, 2048 rays per bounce for ambient occlusion + indirect lighting.

Reflections (1/3/2013):


One point light, 10000 photons, 256 final gather rays per pixel (12/21/2012):


2 Aug, 2018


22 Jul, 2015

Poly Explode