Tracy Renderer

About

Tracy is my physically based renderer, the name comes from trace and y(initial of my family name). Writing a renderder maybe the most exciting and enjoyable experience for graphics students. I started to code a Whitted-style ray tracer following the book Ray Tracing from groud up; then I turned to Path Tracing following the book Physically Based Rendering, and BDPT(Bidirectional Path Tracing) following Eric Veach's thesis. Recently I ported it to GPU under NVIDIA's OptiX framework.

Features

Sample Images

Path Tracing

Cornell box
Cornell box with specular materials
Depth of Field
Kitchen scene, SPP: 2048 (Global Illumination, Glossy Compound Material, Texture, Point Light)
San Miguel scene, SPP: 1024 (Global Illumination, Environment Map Lighting, Specular material, Texture, Alpha Mask)
San Miguel scene close-up view, SPP: 1024

BDPT

I proposed a new BDPT algorithm, One-sample BDPT, based on MIS's one sample model. This algorithm preserves the low-variance advantage of MIS technique, and constructs a single BDPT sample faster than the state-of-the-art GPU BDPT algorithm, Streaming BDPT[8], thus is better suited for interactive application. More details are coming in my Master thesis.

Path Tracing the glass egg scene (SPP: 1024)
BDPT (SPP: 1024)
PT V.S. BDPT (same time)
The pyramid shows contribution from paths of various lengths

Progressive Photon Mapping

Following results show PPM's effectiveness in sampling paths that are difficult for Path Tracing. Since the lights are placed behind glass, the scene is dominated by caustics.

Box scene, by PPM (Eye Ray SPP: 64, Photons: 25.6M, Time: ~5min)
Path Tracing, brightness scaled by 2^8 (SPP: 1024, Time: ~2min)

PSSMLT

SPP: 1024

Multiple Importance Sampling

Sampling BSDF
Sampling Light Sources
MIS
Multiple Importance Sampling effectively combines the two sampling techniques

Environment Map Illumination

Importance sampling the environment map requires generating more samples in brighter area. The traditional method, namely the inversion method on a 2D discrete distribution, is implemented in both PBRT and Mitsuba.

Besides its sophisticated implementation details, the traditional method can only importance sample the environment map globally. When computing Direct Lighting, the method would possibly sample a pixel on the map that is located in the lower hemisphere of current shading point, which doesn't make contribution at all thus lead to inefficiency.

I developed an importance sampling method based on the Metropolis-Hastings algorithm. The M-H algorithm is a general algorithm for sampling any sophisticated distribution, and in this context, I just use pixel intensity as the function value. The transition rule is composed of two mutation strategies:

The two mutations are both symmetric, so the acceptance probability is just f_new/f_old, namely the ratio of new pixel intensity and old pixel intensity. The method is very simple to implement and it only samples pixels in the upper hemisphere thus does not waste samples.

Input environment map
Importance Sampling by traditional 2D distribution method (the whole image is sampled for all shading points)
Importance Sampling by proposed method based on M-H algorithm (only the upper hemisphere is sampled for current shading point)

Timings

Timings for Path Tracing in several scenes.

Scene Resolution Max Path Length SPP Tracy Mitsuba Speed-up
Cornell Box 512x512 6 256 9.9s 49.6s 5.01
Crytek Sponza 720x480 3 256 22.7s 140.1s 6.17
Kitchen 720x480 4 256 18.2s 111.2s 6.11
Conference 640x480 4 256 14.5s 90.3s 6.23

Source Code

[github]

Acknowledgments

The Cornell box scene, glass egg scene and MIS scene are from Mitsuba; the kithcen scene is from Peiran Ren; the San Miguel scene was modeled by Guillermo M. Leal Llaguno, and I converted it from PBRT's scene format; the Dragon scene was also converted from PBRT's scene format; the Box scene was modeled by Toshiya Hachisuka.

Reference

  1. Ray Tracing from the Ground Up, by Kevin Suffern
  2. Physically Based Rendering, 2nd Edition, by Matt Pharr and Greg Humphreys
  3. Veach, Eric. Robust Monte Carlo methods for light transport simulation. Diss. Stanford University, 1997.
  4. Mitsuba Renderer, by Wenzel Jakob
  5. Hachisuka, Toshiya, Shinji Ogaki, and Henrik Wann Jensen. "Progressive photon mapping." ACM Transactions on Graphics (TOG). Vol. 27. No. 5. ACM, 2008.
  6. Kelemen, Csaba, et al. "A simple and robust mutation strategy for the metropolis light transport algorithm." Computer Graphics Forum. Vol. 21. No. 3. 2002.
  7. NVIDIA OptiX
  8. Van Antwerpen D. Recursive mis computation for streaming bdpt on the gpu[R]. Technical report, Delft University of Technology, 2011.

Last updated 6/29/2015