project thumbnail
Duration: ±6 weeks
Date: September-October 2012
Course: Graphics programming 1
Tools used: Jacco Bikker's Template
Visual Studio 2010
Very sleepy

Pathtracer

This pathtracer is the successor of my raytracer project. It also started out as a raytracer. I later added the pathtracer in the same project so that each scene could both be raytraced and pathtraced. I used a single shader for everything, so that almost all materials could be simulated by adjusting only a couple of material values. This way I didn’t have to optimize and maintain different execution paths for different materials. The raytracer is still aimed to be somewhat realtime, while the pathtracer can converge much longer on a single image.

Features:

  • Materials raytracer part:
    • Recursive reflection with Fresnell falloff
    • Reflection
    • Diffuse and specular
    • Normal maps and color textures
    • Interpolated combinations possible
  • Materials pathtracer part:
    • Diffuse BRDF
    • Specular reflection BRDF
    • Perfect reflection BRDF
    • Alpha transparency
    • Emissive (supporting terminating and non-terminating, including transparent emissive materials like Uranium glass)
    • Normal maps and color textures
    • Interpolated combinations possible
  • Multisample effects including depth of field and anti aliasing.
  • Primitives:
    • Spheres
    • Planes
    • Triangles in accelerated SAH BVH structure (imported from 3ds files)
  • Monte Carlo sampling:
    • Russian roulette with biasing for faster caustics and efficient diffuse
    • Explicit light rays
    • Post processing:
    • Auto exposure adjustment
    • Gamma
    • Small boom kernel
  • Multithreaded rendering

Images

Raytracer screenshot 1
Recursive refraction and refraction on a glass sphere in raytrace mode showing off Fresnell falloff.

Raytracer screenshot 2
Normal mapping on the planes and Beer's law on the water in raytrace mode.

Raytracer screenshot 3
Path tracer with diffuse BRDF and specular BRDF.

Raytracer screenshot 4
Reflective floor (mixed diffuse and specular BRDF), notice the caustics on the bottom of the wall.

Raytracer screenshot 5
Fur ball. Created using multiple layers of an alpha mapped texture. The pathtracer algorithm automatically produces self shadowing and ambient occlusion

Raytracer screenshot 6
Fur ball above shallow water with sun and sky light.

Raytracer screenshot 7
Fur ball and glass sphere above deep water with sun and sky light.

Raytracer screenshot 8
Temple with 3 different colored area lights, a metal ball, and a glass ball with caustics.

Raytracer screenshot 9
Temple with torus knot, and 3 colored area lights.

Raytracer screenshot 10
Water temple by night with 3 small area lights. Rendered to an HDR buffer enabling bloom to be correctly colored for the bight light sources.

Raytracer screenshot 11
View down a hole/cave model.

Raytracer screenshot 12
View from the bottom of the hole/cave.

Raytracer screenshot 13
Entry for the pretty image contest.

Raytracer screenshot 14
Glass ring wave to test russian roulette sampling bias for caustics.