Sunday, March 27, 2016

Bidirectional Path Tracing 1 - Kickoff

After attending SIGGRAPH last year, I was chatting with colleagues about those inspiring contents in the talks like  "The Path Tracing Revolution in the Movie Industry", "Physically Based Shading in Theory and Practice". It seems clear the whole industry is shifting toward path tracing at this moment, but there are still no conclusion about what is the best way to do this. ( It was fun to see WETA first stated that you shouldn't aim at certain algorithm to build the software architecture and sacrifice the future extensibility, then Disney immediately came up to say "we are actually doing exactly what you said that shouldn't do"). "We should keep up our learning speed, and try to catch up those integrators knowledges that are moving so fast nowadays" was our chatting conclusion that day.

In Pixar's Renderman Art and Science Fair, they mentioned that the latest version Renderman supports Vertex Connection Merging (vcm) and ready for production use. My barely minimum understanding about vcm is that it mixed bidirectional path tracing(bdpt) and progressive photon map(ppm) with multiple importance sampling, and able to efficiently render some particular tricky light transport path (SDS, specular->diffuse->specular especially) that is sometimes even impossible to render with unidirectional path tracing. To get a better idea of how exactly it works, I guess I should first get myself familiar with bdpt and ppm, which I thought about implement it in this side project for quite some while.

So here we go, I tried to read through that famous Veach 97 again (I tried it once before, and got pretty confused about several key details...). After consuming quite some amount of coffee in Starbucks, I think this time I understand it a bit deeper :) . Definitely still far from throughout understanding, but should be enough to implement bdpt. I got a working implementation few days ago, and thought I should write my thought process down as memo. There are some particular points I struggled for days to figure out and I would like to share the thoughts for discussion. The original paper try to explain the whole idea with a broader application view while all I want is crank out some tiny pixels. The thoughts here, as a result, are mainly my interpretation about translating those math equation into codes. Hopefully after I write down the following posts, I can pick up the thoughts quicker next time.

The steps of this bdpt implementation are roughly listed below:

1. the mindset shifting from original path tracing style solid angle space light transport equation (LTE) to area space

2. understanding the idea of impoartance, Its zen symmetry to radiance and most importantly: how to evaluate its value?

3. how filter works in the bdpt world, and how to modify existing filter implementation to adapt and keep it backward compatible to the previous path tracing implementation

4. break down the unweighted contribution equation in Veach97 10.2

5. implement light tracing technique, which is actually more intuitive as high level idea than path tracing to me (shooting particle from light instead of shooting sensor ray from camera), and make sure the result is correct compare to the path tracing method

6. implement bdpt that can choose around different light/camera path (s, t) combination techniques

7. implement multiple importance sampling(MIS) to weight sum different s, t techniques

8. handle specular special case (I like point light and glass surface, until I need to deal them as exceptional case)

The reference:
Robust Monte Carlo Methods for Light Transport Simulation : Veach97. Fun fact: Eric Veach went to google doing google AdWords after publishing this groundbreaking thesis in computer graphics. Friends once joked about this: "Maybe the prophet foresaw that rendering has no future, so go do the actual money making business"

Bidirectional Estimators for Light Transport : Veach94. It was the time bidirectional is there already, but MIS combination is not fully fleshed out yet.

Adjoints and Importance in Rendering: An Overview : A read while trying to figure out the abstract importance concept. Sadly it din't offer a concrete math equation I was looking for 

Adjoint Equations and Random Walks for Illumination Computation : same as above. It gave me an idea but I still didn't get the concrete equation after went through this paper


No comments:

Post a Comment