Sparsely Precomputing the Light Transport Matrix for Real Time Rendering Fu-Chung Huang Ravi Ramamoorthi University of California, Berkeley Precomputed Radiance Transfer (PRT) [Sloan et al. 02] [Ng et al. 03, 04] [Liu et al. 04] [Wang et al. 04] Precomputation Time: 13 hours 22 mins The Problem Reflectance equation Separable Dynamic lighting Static geometry Lighting Visibility BRDF Ng et al. 04 Limited to static scene B ( x, ) L ( x , i ) VT ( x , i ) f r ( x , , r ) cos i d i Storage and Time Matrix T ( x , i ) 50K vert. (rows) 24K directions (cols) 1.2B Rays Wavelet + Quantization Compression 10x to 50x Precomputation time is not reduced! Clustered PCA Precomputation Time Buddha Scene 5x speed up in precomputation Sparse Sampling Full Sampling 2 hours 36 mins 13 hours 22 mins Precomputation Time Bunny Scene 4x speed up precomputation Sparse Sampling Full Sampling 3 hours 25mins 13 hours 8 mins Outline Motivation / Introduction Related Work Algorithm Results Conclusion / Future Work Related Work Precomputation based rendering [Nimeroff et al. 94] [Dorsey et al. 95] Focus only on added functionality [Sloan et al. 02,03] Low frequency shadows CPCA compression [Ng et al. 03,04] High frequency shadows Triple product integral [Wang et al. 04,06] Glossy materials Related Work Compressive sensing [Candes et al. 06] [Candes and Tao 06] Sampling Rate = k logN for k-sparse signal Not applicable to PRT No random pattern sampling in virtual scene Must sample one ray at a time [Peers et al. 09] [Sen and Darabi. 09] Related Work Row-column sampling Column selection is fixed across all rows A C [Hasan et al. 07] R B = CA+R [Wang et al. 09] Related Work Hierarchical and Sparse Sampling [Kontkanen et al. 06] [Hasan et al. 07] [Lehtinen et al. 08] [Krivanek and Gautron 09] Adaptive Methods [Guo 98] [Krivanek et al. 04] [Krivanek [Krivanek andetGautron al. 04] 09] Outline Motivation / Introduction Related Work Algorithm Results Conclusion / Future Work Algorithm Outline Overview Dense Vertex Sampling Sparse Vertex Sampling Integrating Clustered PCA Overview - 2 Phase Sampling Dense vertex Spatial: 20%~25% Angular: ~30% Sparse vertex Spatial: 75%~80% Angular: 5%~7% Overview - 2 Phase Sampling Row-column sense Angular: ~30% Dense Vertex Spatial: 20%~25% =6%~7% Sparse Vertex Spatial: 75%~80% =4%~5% Angular: 5%~7% Algorithm Outline Overview Dense Vertex Sampling Where? How? What? Sparse Vertex Sampling Integrating Clustered PCA Dense Vertex Distribution Observation from CPCA Non-uniform cluster sizes Large cluster: low rank Small cluster: high rank Non-uniform sampling But how? Dense Vertex Spatial Sampling Sampling by exploration 1st iteration High rank area Uniform Local rank -> probability 2nd iteration Local rank -> probability And so on…. Zoom-Up rd th st iteration] [2 [3 [4 [1nd Dense Adaptive Angular Sampling 1st pass: regularly 2nd pass: adaptively If values are inconsistent 50%-70% savings Algorithm Outline Overview Dense Vertex Sampling Sparse Vertex Sampling Angular Sampling Local Reconstruction Integrating Clustered PCA Sparse Vertex Angular Sampling Remember in overview… The sparse set of important angular features The Union Variances lightoftransport these of neighboring features, from its Weighted Neighboring selection, angular 5%~7% features neighboring but angular too many features dense vertices Sparse Vertex Reconstruction Reconstructed light transport ? i i Sampled directions as constraints s .t . i i Sparse Vertex Reconstruction How many neighbors? In reality L1 sparse solver [Kim et al. 07] No exact radius needed Algorithm Outline Overview Dense Vertex Sampling Sparse Vertex Sampling Integrating Clustered PCA Clustered PCA Incrementally adding bases 1. for each PCA basis for each LBG iteration [Sloan et al. 03] Avoid local minimum run clustering on *dense* vertices *all* vertices end for Linear combination assumption! end for 2. Assign sparse vertex to nearest cluster 3. Run inner loop for all vertices Outline Motivation / Introduction Related Work Algorithm Results Error analysis Performance Conclusion / Future Work Analysis: Angular Sampling Adaptive sampling [Ours] Sampling important directions Non-adaptive angular sampling [Wang et al. 09] [Hasan et al. 07] A lot of directional samples are wasted Analysis: L2 Error for Bunny 35K + 29K vertices Scanned High error at seams Analysis: L2 Error for Horse 8.5K + 29K vertices Low resolution Man made Performance Precomputation time only Rendering is real-time with the same quality Model CPCA Full New Sparse CPCA Sampling Sampling CPCASampling Speed Up Rate Speed Up Horse 52m 12.6x 4h 2m 4m 54m ~11% 4.47x Dancer 45m 12.6x 5h 40m3m 1h 15m ~11% 4.77x Bunny 81m 12.8x 13h 8m6m 3h 26m ~11% 3.83x Performance for Glossy Objects In-Out Factorization for glossy BRDFs [Liu et al. 04] [Wang et al. 04] Model Size Full Sampling Sparse Sampling Sampling Rate Speed Up Armadillo 55K 10h 7m 2h 17m 11.43% 4.75x Buddha 55K 13h 22m 2h 36m 11.11% 5.12x Dragon 55K 10h 31m 2h 1m 11.16% 5.22x Bench 50K 7h 7m 1h 56m 18.54% 3.67x Precomputation Time Bench Scene 3.6x speed up in precomputation Sparse Sampling Full Sampling 1 hours 56mins 7 hours 7 mins Detailed Timing Conclusion PRT research on real-time functionality Precomputation is often the bottleneck Adaptive and sparse sampling Exploit both spatial and angular coherence Accelerated Clustered PCA compression Sparse precomputation possible 5x speed-up 12x speed-up computing CPCA Future Work GPU acceleration Interactive precomputation New capabilities Rapid prototyping Lighting design Dynamic scenes General theory of sparse sampling Avoid heuristic parameter tuning Broader context Appearance acquisition Offline rendering The End Acknowledgements Ryan S. Overbeck Anonymous reviewers NSF CAREER Grant IIS-0924968 ONR PECASE N0001409-1-0741 Intel NVIDIA Adobe Pixar