LightSlice: Matrix Slice Sampling for the Many-Lights Problem SIGGRAPH Asia 2011 Yu-Ting Wu
Authors Jiawei Ou ( 歐嘉蔚 ) PhD Student Dartmouth College Fabio Pellacini Associate Prof. 2
Rendering L o ( p, ) o L ( p, ) f ( p,, ) L ( p, ) cos d 2 e o s o i i i i i Recursive image plane 3
Many-Lights Problem A long-standing problem in rendering is to efficiently and accurately render complex scenes under complex illumination (large area lights, environment lights, indirect illumination ) 4
Many-Lights Problem Many-Lights Problem: Convert the illumination into a large number of point lights (150-300K) 5
Many-Lights Problem Many-Lights Problem: Convert the illumination into a large number of point lights (150-300K) For each shading point, sum the contributions from all lights 6
Advantages Many-Lights Problem Simulate complex illumination using point lights Area lights HDR environment maps Sun & sky light Indirect illumination Unify illumination Break the recursion Area lights + Sun/sky + Indirect 7
Many-Lights Problem Problem encountered Too many lights Brute-force is impractical Museum (1.5M triangles) 1024 x 1024 x 9 shading points 153K point lights Hundreds of Hours! 8
Many-Lights Problem Efficient approximation using a subset of lights Reference (hundreds of hours) LightSlice (425.9 sec) 9
Related Work 10
Related Work (Major) Multidimensional Lightcuts B. Walter, A. Arbree, K. Bala, D. P. Greenberg Cornell University SIGGRAPH 2006 Matrix Row-Column Sampling for the Many-Lights Problem M. Hasan, F. Pellacini, K. Bala Cornell University / Dartmouth University SIGGRAPH 2007 11
Related Work (Minor) Relighting SIGGRAPH 06 Animation EGSR 08 Glossy Material SIGGRAPH Asia 09, 10 12
Lightcuts Lightcuts: A Scalable Approach to Illumination B. Walter, S. Fernandez, A. Arbree, M. Donikian, K. Bala, D. P. Greenberg Cornell University SIGGRAPH 2005 Multidimensional Lightcuts B. Walter, A. Arbree, K. Bala, D. P. Greenberg Cornell University SIGGRAPH 2006 13
Key concepts: Lightcuts Light cluster: approximate many lights by a single brighter light (the representative light) 14
Key concepts: Lightcuts Light tree: binary tree of lights and clusters A cut: a set of nodes that partition the lights into clusters Clusters Individual Lights 15
Lightcuts Example cuts #1 #2 #3 #4 Light Tree 4 Representative Light 1 4 1 2 3 4 16
Lightcuts Example cuts Three Cuts #1 #2 #4 #1 #3 #4 #1 #4 4 4 4 1 4 1 4 1 4 1 2 3 4 1 2 3 4 1 2 3 4 17
Lightcuts Example cuts Three Cuts #1 #2 #4 #1 #3 #4 #1 #4 4 4 Good Bad Bad 4 1 4 1 4 1 4 1 2 3 4 1 2 3 4 1 2 3 4 18
Lightcuts Example cuts Three Cuts #1 #2 #4 #1 #3 #4 #1 #4 4 4 Bad Good Bad 4 1 4 1 4 1 4 1 2 3 4 1 2 3 4 1 2 3 4 19
Lightcuts Example cuts Three Cuts #1 #2 #4 #1 #3 #4 #1 #4 4 4 Good Good Good 4 1 4 1 4 1 4 1 2 3 4 1 2 3 4 1 2 3 4 20
Algorithm For each shading point Lightcuts Choose a cut to approximate the illumination Use perceptual metric to avoid visible artifacts (Weber s Law) From the root, refine light tree until the upper bound of error is smaller than the perceptual error we can accept error < - M ub G ub V ub S lights I i 21
Lightcuts Results Kitchen, 388K polygons, 4608 lights (72 area sources) Error x16 Lightcuts (128s) Reference (1096s) 22
Matrix Row-Column Sampling Matrix Row-Column Sampling for the Many-Lights Problem M. Hasan, F. Pellacini, K. Bala Cornell University / Dartmouth University SIGGRAPH 2007 Matrix Sampling for Global Illumination M. Hasan Cornell University PhD Dissertation (2010) 23
Matrix Representation We can interpret the many-lights problem as a matrix of light-pixel formulation Lights (300,000) Pixels (2,000,000) 24
Pixels Matrix Representation Problem: compute sum of columns = Σ ( ) 300,000 point lights = Σ ( ) 25
Matrix Row-Column Sampling Key concepts: Matrix has structures (low rank) Compute small subset of elements Reconstruct Repeating patterns / Large areas of near black 26
Matrix Row-Column Sampling Key concepts: Compute image as a weighted column sum compute very small subset of columns compute weighted sum How to choose columns!? 27
Matrix Row-Column Sampling Algorithm flow of MRCS Stratfied Uniform Sampling 300 600 rows 400 4000 columns 28
Matrix Row-Column Sampling Compute entire row or column using GPU Column: light to all shading points Row: shading point to all lights 29
Matrix Row-Column Sampling Light clustering algorithm Clustering Reduced columns: vectors in high-dimensional space Visualize Radius = Norm of reduced column Position = Position of normalized reduced columns in the high-dimensional space 30
Matrix Row-Column Sampling Light clustering algorithm Metrics Minimize p 1,, k cost( C p ) where cost( C) i, j C norms of reduced column i j x i - x j 2 squared distance between normalized reduced columns NP-Hard. Solve by heuristic approach 31
Matrix Row-Column Sampling Light clustering algorithm Top-down splitting 32
Matrix Row-Column Sampling Reconstruction Estimation of cluster contribution Randomly choose representative column j with proportional to its global norm R j Render the full column using ray-tracing Estimate its total weight as R j p C p R Linear combination to get the final result of pixel color 33
Matrix Row-Column Sampling Review of MRCS assemble rows into reduced matrix cluster reduced columns compute rows (GPU) choose representatives compute columns (GPU) weighted sum 34
Matrix Row-Column Sampling Results Temple, 2.1M polygons, 1,000,000+ lights 5x diff Our result: 16.9 sec (300 rows + 900 columns) Reference: 20 min (using all 100k lights) 35
Matrix Interpretation Repeating patterns / Large black areas 36
Matrix Interpretation Lights have two common behaviors Global lights Strong contributions to all pixels Typically correspond to direct illumination (sun) Appear as bright matrix columns Local lights Local behavior affects only a few pixels Typically correspond to indirect lighting Appear mostly as black columns with a small, low, intensity sections 37
Matrix Interpretation of Lightcuts Lightcuts chooses different clusters for each pixel error < M ub G ub V S - ub For each row, cluster the lights independently lights Work well for scenes with little occlusion (or usually local lighting) Not efficient for scenes with highly occlusion and global lighting Ignore visibility term I i 38
Matrix Interpretation of MRCS MRCS use global clusters for all pixels, considering how the lights effect the scene Sample a small number of rows to determine the clusters Work very well for global lighting (subsampled rows include shadow) Not efficient for local lighting (with many zero elements along the column) 39
Algorithms 40
Algorithms LightSlice combines the advantages from both lightcuts and matrix row-column sampling Key concepts: Cluster similar surface samples to form slices in matrix The slice of the matrix has significantly lower rank than the whole matrix 41
Algorithms Flowchart Spatial Clustering 1400 1600 slices 400 columns for each slice 42
Algorithms Matrix slicing Slice sampling Initial light clustering Per-slice cluster refinement Per-slice reconstruction 43
Matrix slicing Partition the surface samples based on the geometric proximity Use a 6D KD-Tree Algorithms 44
Slice sampling Algorithms Randomly pick one representative point Compute full row using raytracing 45
Initial Light Clustering Algorithms The same as Matrix Row-Column Sampling The rough clustering (30% of total cluster budget) can capture strong global lighting well 46
Algorithms Per-Slice Cluster Refinement Refine the initial light clustering for each slice to adapt to local lighting Avoid image-space discontinuity artifacts 47
Algorithms Per-Slice Cluster Refinement For each slice S i, assemble a local matrix L i S i 6D space KD-Tree search Initialize the light clustering as in last step Iteratively split the highest cost cluster in until a maximum number of clusters is reached L i 48
Algorithms Per-Slice Reconstruction Render each slice by summing the contribution of each of its clusters 49
Algorithms Per-Slice Reconstruction Estimation of cluster contribution Randomly choose representative column j with proportional to its global norm R j Render using ray-tracing Estimate its total weight as R j i p C p R L k Linear combination to get the final result of pixel color 50
Results and Discussion 51
Results and Discussion Equal-time / equal-quality comparison LightSlice, Lightcuts, and MRCS Four test scenes Error (relative) visualization Machine Four Intel Xeon 7560 processors (running at 2.27 GHz), each with 8 cores 52
Results and Discussion Scene1: Sanmiguel 1.6 M triangles 550K VPL Resolution: 1024 x 1024 (9) 53
Equal-Time Comparison light slice mrcs lightcuts reference 6.75% 22.50% 16.30% slices visualization
Equal-Quality Comparison light slice mrcs lightcuts reference 775.1 sec 4237 sec (5.4x) 3618 sec (4.6x) slices visualization
Error Plot Scene: sanmiguel
Results and Discussion Scene2: Museum 1.5 M triangles 153K VPL Resolution: 1024 x 1024 (9) 57
Equal-Time Comparison light slice mrcs lightcuts reference 2.77% 8.83% 7.40% slices visualization
Equal-Quality Comparison light slice mrcs lightcuts reference 425.9 sec 2076 sec (4.87x) 2816 sec (6.61x) slices visualization
Results and Discussion Scene3: Condo 1.4 M triangles 305K VPL Resolution: 1200 x 900 (9) 60
Equal-Time Comparison light slice mrcs lightcuts reference 2.12% 5.60% 5.70% slices visualization
Equal-Quality Comparison light slice mrcs lightcuts reference 351.9 sec 1621 sec (4.6x) 1972 sec (5.6x) slices visualization
Scene4: Lobby Results and Discussion 611.5 K triangles 317K VPL Resolution: 1200 x 900 (9) 63
Equal-Time Comparison light slice mrcs lightcuts reference 1.14% 2.51% 3.70% slices visualization
Equal-Quality Comparison light slice mrcs lightcuts reference 866.5 sec 2542 sec (2.93x) 2738 sec (3.16x) slices visualization
Parameters selection Limitations LightSlice avoids spatial discontinuities by using a high number of slices 378 slices 400 columns 378 slices 1200 columns 66
Glossy surfaces Glossy transports increase the local matrix rank Animation Left as a future work Matrix sparsity Limitations LightSlice cannot efficiently converge on the correct solution if the transport matrix is too sparse 67
LightSlice Conclusion An algorithm that can efficiently solve the manylight problems Take advantages of the global and local behavior of lighting by clustering and rendering per-slice columns in the transport matrix 3x 6x performance improvement compared to previous work 68
End Thanks for your attention 69