# matrix row-column sampling for the many-light problem

Post on 20-Feb-2016

26 views

Embed Size (px)

DESCRIPTION

Matrix Row-Column Sampling for the Many-Light Problem. Milo š Ha š an (Cornell University) Fabio Pellacini (Dartmouth College) Kavita Bala (Cornell University). Complex Illumination: A Challenge. Conversion to Many Lights. Area, indirect, sun/sky. - PowerPoint PPT PresentationTRANSCRIPT

Matrix Row-Column Sampling for the Many-Light ProblemMilo Haan (Cornell University)Fabio Pellacini (Dartmouth College)Kavita Bala (Cornell University)

Complex Illumination: A Challenge

Conversion to Many LightsCourtesy Walter et al., Lightcuts, SIGGRAPH 05/06Area, indirect, sun/sky

A Matrix InterpretationPixels(2,000,000)Lights (100,000)

Compute sum of columns

Note: We dont have the matrix dataProblem Statement= ()PixelsLights

Indirect Illumination Many Lights=100,000 point lights ()

Environment Map Many Lights=100,000 point lights ()

Sun, Sky, Indirect Many Lights=100,000 point lights ()

Brute Force Takes MinutesWhy not sum all columns? With 100,000 lights, still several minutes 10 min13 min20 min

Our ContributionFast, accurate, GPU-based approximation

Application: Preview for lighting design10 min13 min20 min3.8 sec13.5 sec16.9 secBrute force:Our result:

Related WorkMany lights (CPU-based): Walter et al 05/06, Ward 94, Paquette et al 98, Wald et al 03, Instant radiosity & related: Keller 97, Dachsbacher & Stamminger 05/06, Laine et al 07, Environment maps: Agarwal et al 03, Ostromoukhov et al 04, Precomputation-based: Sloan et al 02/03, Ng et al 03/04, Ben-Artzi et al 06, Hasan et al 06, Ritschel et al 07, Other global illumination: Ward et al 88, Jensen 96, Hanrahan et al 91, Christensen 97, Scheel 01/02, Gautron et al 05, Krivanek et al 06, Dachsbacher et al 07,

Insight #1: Matrix has structureCompute small subset of elementsReconstructA simple scene30 x 30 imageThe matrix643 lights900 pixels

Insight #2: Sampling Pattern MattersLightsPixelsPoint-to-point visibility: Ray-tracingPoint-to-many-points visibility: Shadow-mapping

Row-Column DualityShadow map at light positionSurface samplesColumns: Regular Shadow Mapping

Row-Column DualityShadow map at sample positionRows: Also Shadow Mapping!

Image as a Weighted Column Sumcompute very small subset of columnscompute weighted sumThe following is possible:Use rows to choose a good set of columns!

Exploration and Exploitationcompute rows (explore)compute columns (exploit)weighted sum?choose columns and weightshow to choose columns and weights?

Reduced MatrixReduced columns

Clustering ApproachChoose k clustersChoose representative columnsReduced columns

Reduced FullUse the same representatives for the full matrixWeighted sumRepresentative columns

Visualizing the Reduced ColumnsReduced columns: vectors in high-dimensional spacevisualize as

Clustering IllustrationStrong but similar columnsWeak columns can be clustered more easilyColumns with various intensities can be clustered

Minimize:

where:

The Clustering Metrictotal cost of all clusterscost of a clustersum over all pairs in itnorms of the reduced columnssquared distance between normalized reduced columns

How to minimize?Problem is NP-hardNot much previous researchShould handle large input:100,000 points1000 clustersWe introduce 2 heuristics:Random samplingDivide & conquer

Clustering by Random SamplingVery fast (use optimized BLAS)Some clusters might be too small / large

Clustering by Divide & ConquerSplitting small clusters is fastSplitting large clusters is slow

Combined Clustering Algorithm

Combined Clustering Algorithm

Full AlgorithmCompute rows (GPU)Weighted sumAssemble rows into reduced matrixCluster reduced columnsChoose representativesCompute columns (GPU)

ResultsWe show 5 scenes:

Show reference and 5x difference imageAll scenes have 100,000+ lightsTimingsNVidia GeForce 8800 GTXLight / surface sample creation not includedTempleBunnyKitchenTreesGrand Central

Results: Kitchen388k polygonsMostly indirect illuminationGlossy surfacesIndirect shadowsOur result: 13.5 sec (432 rows + 864 columns)Reference: 13 min (using all 100k lights)5x diff

Results: Temple2.1m polygonsMostly indirect & sky illuminationIndirect shadowsOur result: 16.9 sec (300 rows + 900 columns)Reference: 20 min (using all 100k lights)5x diff

Results: Trees328k polygonsComplex incoherent geometryOur result: 2.9 sec (100 rows + 200 columns)Reference: 14 min (using all 100k lights)5x diff

Results: Bunny869k polygonsIncoherent geometryHigh-frequency lightingKajiya-Kay hair shaderOur result: 3.8 sec (100 rows + 200 columns)Reference: 10 min (using all 100k lights)5x diff

Results: Grand Central1.5m polygonsPoint lights between stone blocks

Our result: 24.2 sec (588 rows + 1176 columns)Reference: 44 min (using all 100k lights)5x diff

The Value of ExplorationOur result(432 rows + 864 columns)

No exploration(Using 1455 lights)

Equal time comparison

The Value of ExplorationOur resultNo explorationEqual time comparison: 5x difference from reference

ConclusionFast, high quality approximation for many lightsGPU-orientedSample rows to explore low-rank structureSample well-chosen columns

Application: Preview for lighting designIndirect illuminationEnvironment mapsArbitrary lights and shaders

Future WorkHow many rows + columns?Pick automatically

Row / column alternation

Progressive algorithm:stop when user likes the image

Render multiple frames at once?

AcknowledgmentsVeronica Sundstedt and Patrick LeddaTemple sceneBruce Walter, PCG @ CornellNSF CAREER 0644175Affinito-Stewart Award

Thank You

Discarded slides

Indirect Illumination Many Lights shoot photons from light sources deposit on every bounce treat photons as point lights cosine-weighted emission

Low Rank AssumptionWorst case: lights with very local contribution

The Value of ExplorationOur result(432 rows + 864 columns)

No exploration(Using 1992 lights)

Equal time comparison

The Value of ExplorationOur resultNo explorationEqual time comparison: 5x difference image

A long-standing problem in rendering is to efficiently and accurately render complex scenes with indirect illumination,Environment lightingOr a combination of these.

One particular approach is to convert the illumination into a large number of point lights.The conversion process is described in previous research.Here you can see the created lights as colored dots.

We can interpret the many light problem as a matrix of light-pixel interactions.This means that each element of the matrix is the contribution of a single light to a single pixel.So, the columns of the matrix are really images rendered with a single point light.The rows represent contributions of all the lights to a particular pixel.

In this setting, the ideal image we would like to render is equal to the sum of the columns of the matrix.Or, to put it differently, the color of each pixel is equal to the sum of the matrix row corresponding to that pixel.It is important to note thart we dont have the matrix data, we just have a shader that can evaluate the elements on demand.

*For example heres indirect illumination as many lights.

And environment illumination as many lights.And a combination of sun, sky and indirect illumination.

The simplest approach to computing these images would be to accumulate all the columns.Unfortunately, it would take several minutes to compute this, even on a fast GPU.

In this talk we present a very fast GPU-oriented algorithm for rendering with many lights.The rendering times have been reduced from minutes to seconds. as you can see in the bottom row of images

We believe this approach could have compelling applications, for example in lighting design.Since we dont use precomputation, we could change anything - the camera, lighting, materials, geometry.And we would get a high-quality preview image in several seconds.Several techniques for many lights have been proposed. Lightcuts is a scalable CPU-based approach to many lights, that computes illumination on a per-pixel basis.Instant radiosity approaches are similar to our technique, but usually use a smaller number of lights, while we concentrate more on picking a good set lights from a large number.Finally, some other approaches are limitied to environment maps or require several hours of precomputation.

*The first insight that makes our result possible is as follows.Lets take the simple scene on the left, and look at the matrix corresponding to the illumination in the scene.We can see that the matrix is highly structured. Numerically, it is usually close to low-rank.Therefore, we can get away with computing only a very small subset of the elements, and still gather enough information to render an accurate image.

So, we want to sample a subset of the elements, but which ones should we choose?

If we sample like this, well have to use ray-tracing to evaluate the visibility term between lights and pixels.However, if we sample complete rows and columns, we can use GPU shadow mapping as our visibility algorithm.This way we can compute elements at a much higher rate.

*In particular, we can compute the shadow map at light position, and determine the visibility of the surface samples, as usual.

We can also invert this idea and compute the shadow map ta the surface sample, and determine the visibility of all lights.

Its usually possible to find a very small subset of the columns such that some linear combination of them is a very good approximation to the ideal result

Recommended