Primary Sample Space Path Guiding Jerry Jinfeng Guo1, Pablo Bauszat1, Jacco Bikker2 and Elmar Eisemann1 3-July-2018 1: Delft University of Technology, the Netherlands 2: Utrecht University, the Netherlands
Background Realistic rendering via light transport simulation Path tracing and bi-directional path tracing Monte Carlo integration to solve the equation 11/21/201811/21/2018
Path Construction 101 Motivation in 2D 11/21/201811/21/2018
Related Work – Path Guiding 11/21/201811/21/2018
Related Work – Path Guiding Reduce Zero Radiance Paths Guide rays towards more promising region Essentially importance sampling PG with pre-computed caches [1][2] On-line PG [3][4] PG with reinforced approach [5] [1] Jensen et al. "Photon maps in bidirectional Monte Carlo ray tracing of complex objects.“, 1995 [2] Hey et al. "Importance sampling with hemispherical particle footprints.", 2002 [3] Vorba et al. "On-line learning of parametric mixture models for light transport simulation.", 2014 [4] Müller et al. "Practical Path Guiding for Efficient Light‐Transport Simulation.", 2017 [5] Dahm, Ken, and Alexander Keller. "Learning light transport the reinforced way.", 2017 11/21/201811/21/2018
Related Work – Primary Sample Space Metropolis light transport [7] Path configurations as samples Correlate samples as Markov states Mutation done by tweaking path configuration Primary sample space MLT [8] Tweaking random numbers Ease of implementation Primary samples: vectors of random numbers [ …, 0.6541869, 0.2548385, 0.1089318, … ] [ …, 0.7041869, 0.2358438, 0.0998318, … ] [7] Veach et al. "Metropolis light transport.“, 1997 [8] Kelemen et al. "A simple and robust mutation strategy for the metropolis light transport algorithm.", 2002. 11/21/201811/21/2018
Our Objective To build a structure that affects sample generation Takes as input samples from standard RNG Output are samples more concentrated in valuable regions 11/21/201811/21/2018
Distinction All methods build spatial-directional structures in scene space Spatially distributed (3D) Hemispherical or spherical representation (2D) We work solely in primary sample space Out-of-kernel feature No need to explicitly build structures in scene space Clarification This project is about unidirectional path guiding No Metropolis sampling involved 11/21/201811/21/2018
Overview A standard path tracing solution: {u0, u1, u2, u3, …} Luminance Sampler Path Tracer Final Image 11/21/201811/21/2018
Overview Our primary sample space guided path tracing: {u0, u1, u2, u3, …} {u’0, u’1, u’2, u’3, …} Sampler K-d Tree Path Tracer Luminance {u’0, u’1, u’2, u’3, …}, L Final Image Last Iteration? 11/21/201811/21/2018
Method – Our Structure We use a K dimensional binary tree as our structure K = MxN: M: bounces N: fixed random numbers each bounce consumes Each node encodes: Leaf flag Counter or right child index Luminance value 11/21/201811/21/2018
Tree construction (refinement) Method – Outline Sample collection Tree construction (refinement) Tree sampling Rendering 11/21/201811/21/2018
Method – Sample Collection 11/21/201811/21/2018
Method – Sample Collection We use a two-tree design: one for sampling, one for collection Tree traversal, with samples & luminance ({u’0, u’1, u’2, u’3, …}, L) {u’0, u’1, u’2, u’3}, L Node Range for u0 Add luminance value Is Leaf? Get axis ui Get split via range[] ui Go left? Update Range for u1 Range for u2 Range for u3 … depth 11/21/201811/21/2018
Method – Tree Construction 11/21/201811/21/2018
Method – Tree Construction Start with an empty tree Refine the tree after each iteration Refine the collection tree Copy it to the sample tree Node division criteria: leaf node counter 11/21/201811/21/2018
Method – Tree Sampling 11/21/201811/21/2018
Method – Tree Sampling Tree traversal, with primary sample {u0, u1, u2, u3, …}, {u0, u1, u2, u3} Range for u0 Range for u1 Range for u2 Range for u3 Node Is Leaf? Go left? Comp. value Get axis ui Split range[] ui Update … pdf depth 11/21/201811/21/2018
Method – Tree Sampling With ranges available, we get the transformed sample by warping the input sample into these ranges We use a parameter to balance tree sampling and uniform random numbers 11/21/201811/21/2018
Method – Rendering
Method – Rendering Feed the path tracer with transformed sample Simply fetch random number from a proper RNG after the end The final path length is not limited by k-d tree dimension Combine guided with uniform using multiple importance sampling Correctly reweight results using the pdf that comes along: 11/21/201811/21/2018
Implementation Details u0 u1 u2 u3 Max depth = 20 … Implemented in PBRT v3 K-d tree: K=4, M=2, N=2 K-d tree node division criteria 4 or 8 Max depth 20 8 bytes node layout K-d tree per image tile (16x16) Probability of sampling K-d tree 0.5 1/8 total sample budget for collection … 8 bytes 1 bit leaf flag 31 bits counter/index 32 bits node value 11/21/201811/21/2018
Results – Ajar scene 256 collection spl. 2048 rendering spl. 800x450 n/a L: 0.0097646 C: 0.0081286 R: 0.0076802 2048 rendering spl. 256 collection spl. 1792 rendering spl. 4096 rendering spl. 11/21/201811/21/2018
Results - Dinning room scene 800x450 2k PT: 3215.2s 0.0009080 2k ours: 3182.9s 0.0006681 512 ours: 542.5s 0.0021433 256 collection spl. 1792 rendering spl. 64 collection spl. 448 rendering spl. 2048 rendering spl. 11/21/201811/21/2018
Results – Staircase scene 32 + 224 450x800 Ours 256: 238.1s 0.0043931 PT 512: n/a 0.0034243 Ours 512: n/a 0.00320734 512 64 collection spl. 448 rendering spl. 11/21/201811/21/2018
Results – Kitchen scene 800x450 Ours 1K: 812.1s 0.00032123 PT 4K: 3162.8s 0.000207535 Ours 4K: 3281.0s 0.00012555 128 collection spl. 869 rendering spl. 512 collection spl. 3584 rendering spl. 4096 rendering spl. 11/21/201811/21/2018
Results – Observations MSEs In all scenes, our method brings down MSE Works in regions from where light can be reached with one or two bounces Zero radiance path ratios In all scenes, our method brings down zero radiance paths, best case by 39.5% Zero radiance path ratio goes down as more samples/iterations are invested Best case Kitchen scene 11/21/201811/21/2018
Future work Acknowledgement Make the per tile structure adaptive Higher dimensions Apply to Bi-directional path tracing Acknowledgement PBRT authors for the book and pbrt Benedikt Bitterli [1] for the awesome 3D scenes freely available online Reviewers for the insightful feedback [1] https://benedikt-bitterli.me/resources/ 11/21/201811/21/2018
Conclusion We presented an unbiased path guiding scheme Path guiding in primary sample space is practical Easy to implement Out-of-kernel feature Efficient 11/21/201811/21/2018
Thank you! Questions are welcome! 11/21/201811/21/2018