Advanced Ray Tracer

Course: CS500

Instructor: Jorge Usabiaga

Type: Solo project

Language: C++

Overview

The goal of this course was to develop an offline advanced ray tracer from scratch. Apart from this, I had to choose a complex feature to implement in my ray tracer and make a 40 minute presentation to the rest of the class about it.

The topic I selected was CAUSTICS! The effects that the light creates when going through glass and water is awesome, so I decided to implement it and I had a lot of fun doing it! I based all my project in a paper from Siggraph 2000, A Practical Guide to Global Illumination using Photon Maps.

Features

  • Phong illumination model.
  • Global illumination using photon mapping.
  • Caustics using photon mapping.
  • Render simple shapes: cubes, planes, spheres and ellipsoids.
  • Render 3D models using a KdTree for optimization.
  • Anti-aliasing by multi sampling each pixel randomly.
  • Multi-threading using OpenMP.
  • Reflections and refraction using Fresnel equation.
  • Hard and soft shadows.
  • Depth of field.

Results

The images below each render are the photon maps used to generate it, global photon map and caustics photon map respectively.

hd_image_0simple_scene

hd_image_1caustics_multiple_spheres

hd_image_2caustics_dragon

Low photon number

If the photon number we are using is small, we won’t get smooth transition. Still, the results are cool 🙂

hd_image_3example_low_photon_num_artifact.png

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 )

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Create a website or blog at WordPress.com

Up ↑