Building a Monte Carlo Path Tracer

Woojong Koh

As part of my coursework in computer graphics in 2013, I implemented a custom Monte Carlo path tracer. Path tracing is a fundamental rendering algorithm that simulates the physical behavior of light to create highly realistic images, calculating global illumination by tracing rays of light as they bounce around a 3D scene.

Rendered Results #

Below are two sample scenes rendered using the engine. The first demonstrates soft shadows, diffuse reflection, and color bleeding in a classic Cornell Box environment. The second showcases a reflective cone with complex light interactions and specular highlights.

Technical Specifications #

To achieve these results without overwhelming noise, the engine was built with the following configurations and features:

  • Resolution: 1,024 x 768 pixels.
  • Materials: Support for both Lambertian (perfectly diffuse) and Phong (specular highlight) Bidirectional Reflectance Distribution Functions (BRDFs).
  • Sampling Strategy: Cosine-weighted importance sampling to significantly reduce variance in the final render.
  • Lighting: Explicit direct lighting calculations enabled.
  • Optimization: Russian Roulette path termination enabled to efficiently stop tracing paths that contribute little to the final pixel color.
  • Path Constraints: Minimum path length of 2 bounces.
  • Sample Count: 6,400 samples per pixel to ensure a smooth, high-fidelity final image.