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.
Basic primitives, .obj meshes(optionally with .mtl material file)
Textures, Normal Map, Alpha Mask
Materials: Lambertian, Phong, Blinn, Mirror, Metal, Dielectric
Light sources: Point Light, Directional Light, Area Light, Environment Map
Rendering algorithms: Path Tracing, BDPT, PPM, PSSMLT
Multiple Importance Sampling
GPU accelerated Path Tracing with NVIDIA OptiX, runs at interactive rates for a moderately complex scene (e.g Crytek Sponza); over 5 times faster than Mitsuba.
Able to parse Mitsuba's scene files; with my utility tool pbrt2mts which converts PBRT scenes to Mitsuba's, Tracy can also load PBRT scenes files. (the San Miguel scene below is converted from PBRT)
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
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, 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)
Multiple Importance Sampling
Sampling Light Sources
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 first is to uniformly sample a pixel in the upper hemisphere of current shading point. This mutation strategy ensures ergodicity, and avoid samples being stuck in a small area.
The other is to slightly perturb current pixel position. This mutation strategy is good at exploring local region with large pixel intensity.
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 for Path Tracing in several scenes.
Tested on Intel Core i5-4430 (16GB memory), NVIDIA GeForce GTX 760 (4GB memory).
- Tracy was compiled with CUDA 6.5 + OptiX 3.7.0.
- Mitsuba run on 4 cores with SSE2 enabled.
||Max Path Length
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.
Ray Tracing from the Ground Up, by Kevin Suffern
Physically Based Rendering, 2nd Edition, by Matt Pharr and Greg Humphreys
Veach, Eric. Robust Monte Carlo methods for light transport simulation. Diss. Stanford University, 1997.
Mitsuba Renderer, by Wenzel Jakob
Hachisuka, Toshiya, Shinji Ogaki, and Henrik Wann Jensen. "Progressive photon mapping." ACM Transactions on Graphics (TOG). Vol. 27. No. 5. ACM, 2008.
Kelemen, Csaba, et al. "A simple and robust mutation strategy for the metropolis light transport algorithm." Computer Graphics Forum. Vol. 21. No. 3. 2002.
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