Scalable many-light methods Jaroslav Kivnek Charles University, - - PowerPoint PPT Presentation

scalable many light methods
SMART_READER_LITE
LIVE PREVIEW

Scalable many-light methods Jaroslav Kivnek Charles University, - - PowerPoint PPT Presentation

Scalable many-light methods Jaroslav Kivnek Charles University, Prague Instant radiosity Approximate indirect illumination by 1. Generate VPLs 2. Render with VPLs 2 Instant radiosity with glossy surfaces Ground truth 1,000 VPLs


slide-1
SLIDE 1

Scalable many-light methods

Jaroslav Křivánek

Charles University, Prague

slide-2
SLIDE 2
  • Approximate indirect illumination by
  • 1. Generate VPLs

2

Instant radiosity

  • 2. Render with VPLs
slide-3
SLIDE 3
  • Large number of VPLs required
  • True even for diffuse scenes
  • Scalability issues

3

Ground truth 1,000 VPLs 100,000 VPLs

Instant radiosity with glossy surfaces

slide-4
SLIDE 4
  • 1. Generate many, many VPLs
  • 2. Use only the most relevant VPLs for rendering
  • Choosing the right VPLs

– Per-pixel basis

  • Lightcuts [Walter et al 05/06]

– Per-image basis

  • Matrix Row Column Sampling [Hašan et al. 07]

4

Scalable many-light methods

slide-5
SLIDE 5

Scalability with many lights Approach #1:

Lightcuts & Multi-dimensional lightcuts

Walter et al., SIGGRAPH 2005/06 Slides courtesy Bruce Walter: http://www.graphics.cornell.edu/~bjw/papers.html

slide-6
SLIDE 6

Lightcuts: A Scalable Approach to Illumination

Bruce Walter, Sebastian Fernandez, Adam Arbree, Mike Donikian, Kavita Bala, Donald Greenberg

Program of Computer Graphics, Cornell University

slide-7
SLIDE 7

Lightcuts

  • Efficient, accurate complex illumination

Environment map lighting & indirect Time 111s Textured area lights & indirect Time 98s

(640x480, Anti-aliased, Glossy materials)

slide-8
SLIDE 8

Scalable

  • Scalable solution for many point lights

– Thousands to millions – Sub-linear cost

100 200 300 400 500 600 1000 2000 3000 4000

Number of Point Lights Time (secs) Standard Ward Lightcut

Tableau Scene

slide-9
SLIDE 9

Complex Lighting

  • Simulate complex illumination using point

lights

– Area lights – HDR environment maps – Sun & sky light – Indirect illumination

  • Unifies illumination

– Enables tradeoffs between components

Area lights + Sun/sky + Indirect

slide-10
SLIDE 10

Lightcuts Problem

Visible surface

slide-11
SLIDE 11

Lightcuts Problem

slide-12
SLIDE 12

Lightcuts Problem

Camera

slide-13
SLIDE 13

Key Concepts

  • Light Cluster

– Approximate many lights by a single brighter light (the representative light)

slide-14
SLIDE 14

Key Concepts

  • Light Cluster
  • Light Tree

– Binary tree of lights and clusters

Clusters Individual Lights

slide-15
SLIDE 15

Key Concepts

  • Light Cluster
  • Light Tree
  • A Cut

– A set of nodes that partitions the lights into clusters

slide-16
SLIDE 16

Simple Example

#1 #2 #3 #4

1 2 3 4 1 4

Light Tree

Clusters Individual Lights Representative Light

4

slide-17
SLIDE 17

Three Example Cuts

1 2 3 4 1 4 4 1 2 3 4 1 4 4 1 2 3 4 1 4 4

Three Cuts #1 #2 #4 #1 #3 #4 #1 #4

slide-18
SLIDE 18

Three Example Cuts

1 2 3 4 1 4 4 1 2 3 4 1 4 4 1 2 3 4 1 4 4

Three Cuts #1 #2 #4 #1 #3 #4 #1 #4

Good Bad Bad

slide-19
SLIDE 19

Three Example Cuts

1 2 3 4 1 4 4 1 2 3 4 1 4 4 1 2 3 4 1 4 4

Three Cuts #1 #2 #4 #1 #3 #4 #1 #4

Bad Good Bad

slide-20
SLIDE 20

Three Example Cuts

1 2 3 4 1 4 4 1 2 3 4 1 4 4 1 2 3 4 1 4 4

Three Cuts #1 #2 #4 #1 #3 #4 #1 #4

Good Good Good

slide-21
SLIDE 21

Algorithm Overview

  • Pre-process

– Convert illumination to point lights – Build light tree

  • For each eye ray

– Choose a cut to approximate the illumination

slide-22
SLIDE 22

Convert Illumination

  • HDR environment map

– Apply captured light to scene – Convert to directional point lights using [Agarwal et al. 2003]

  • Indirect Illumination

– Convert indirect to direct illumination using Instant Radiosity [Keller 97]

  • Caveats: no caustics, clamping, etc.

– More lights = more indirect detail

slide-23
SLIDE 23

Algorithm Overview

  • Pre-process

– Convert illumination to point lights – Build light tree

  • For each eye ray

– Choose a cut to approximate the local illumination

  • Cost vs. accuracy
  • Avoid visible transition artifacts
slide-24
SLIDE 24

Perceptual Metric

  • Weber’s Law

– Contrast visibility threshold is fixed percentage of signal – Used 2% in our results

  • Ensure each cluster’s error < visibility threshold

– Transitions will not be visible – Used to select cut

slide-25
SLIDE 25

Illumination Equation

result =

Mi Gi Vi Ii

Σ

lights

Currently support diffuse, phong, and Ward

slide-26
SLIDE 26

Illumination Equation

result =

Mi Gi Vi Ii

Σ

lights

slide-27
SLIDE 27

Illumination Equation

result =

Mi Gi Vi Ii

Σ

lights

slide-28
SLIDE 28

Cluster Approximation

Cluster

result ≈ Mj Gj Vj

Ii

Σ

lights

j is the representative light

slide-29
SLIDE 29

error < Mub Gub Vub

Ii

Cluster Error Bound

Cluster

Σ

lights

  • Bound each term

– Visibility <= 1 (trivial) – Intensity is known – Bound material and geometric terms using cluster bounding volume

ub == upper bound

slide-30
SLIDE 30

Cut Selection Algorithm

Cut

  • Start with coarse cut (eg, root node)
slide-31
SLIDE 31

Cut Selection Algorithm

Cut

  • Select cluster with largest error bound
slide-32
SLIDE 32

Cut Selection Algorithm

Cut

  • Refine if error bound > 2% of total
slide-33
SLIDE 33

Cut Selection Algorithm

Cut

slide-34
SLIDE 34

Cut Selection Algorithm

Cut

slide-35
SLIDE 35

Cut Selection Algorithm

Cut

slide-36
SLIDE 36

Cut Selection Algorithm

Cut

  • Repeat until cut obeys 2% threshold
slide-37
SLIDE 37

Lightcuts (128s) Reference (1096s) Kitchen, 388K polygons, 4608 lights (72 area sources)

slide-38
SLIDE 38

Lightcuts (128s) Reference (1096s) Error Error x16 Kitchen, 388K polygons, 4608 lights (72 area sources)

slide-39
SLIDE 39

Combined Illumination

Lightcuts 128s 4 608 Lights (Area lights only) Lightcuts 290s 59 672 Lights (Area + Sun/sky + Indirect)

slide-40
SLIDE 40

Combined Illumination

Lightcuts 128s 4 608 Lights (Area lights only)

  • Avg. 259 shadow rays / pixel

Lightcuts 290s 59 672 Lights (Area + Sun/sky + Indirect)

  • Avg. 478 shadow rays / pixel

(only 54 to area lights)

slide-41
SLIDE 41

Lightcuts Reference Error x 16 Cut size

slide-42
SLIDE 42

Scalable

  • Scalable solution for many point lights

– Thousands to millions – Sub-linear cost

100 200 300 400 500 600 1000 2000 3000 4000 5000

Number of Point Lights Time (secs) Standard Ward Lightcuts

100 200 300 400 500 600 1000 2000 3000 4000

Number of Point Lights Time (secs) Standard Ward Lightcut

Tableau Scene Kitchen Scene

slide-43
SLIDE 43
  • Problem: Large cuts in dark areas

43

Lightcuts

slide-44
SLIDE 44

Lightcuts Recap

  • Unified illumination handling
  • Scalable solution for many lights

– Locally adaptive representation (the cut)

  • Analytic cluster error bounds

– Most important lights always sampled

  • Perceptual visibility metric
  • Problems

– Large cuts in dark regions – Need tight upper bounds for BRDFs

slide-45
SLIDE 45

Multidimensional Lightcuts

Bruce Walter Adam Arbree Kavita Bala Donald P. Greenberg

Program of Computer Graphics, Cornell University

slide-46
SLIDE 46

Problem

  • Simulate complex, expensive phenomena

– Complex illumination – Anti-aliasing – Motion blur – Participating media – Depth of field

Pixel = L(x,ω)...

Lights

Pixel Area

Aperture

Volume

Time

Pixel = L(x,ω)...

Lights

Pixel Area

Time

slide-47
SLIDE 47

Problem

  • Simulate complex, expensive phenomena

– Complex illumination – Anti-aliasing – Motion blur – Participating media – Depth of field

Pixel = L(x,ω)...

Lights

Pixel Area

Time

Volume

slide-48
SLIDE 48

Problem

  • Simulate complex, expensive phenomena

– Complex illumination – Anti-aliasing – Motion blur – Participating media – Depth of field

Pixel = L(x,ω)...

Lights

Pixel Area

Time

Volume

Aperture

slide-49
SLIDE 49
  • Complex integrals over multiple dimensions

– Requires many samples

Pixel = L(x,ω)...

Lights

Pixel Area

Time

Volume

Aperture

camera

Problem

slide-50
SLIDE 50

Multidimensional Lightcuts

  • Solves all integrals

simultaneously

  • Accurate
  • Scalable

600 1200 1800 100 200 300

Samples per pixel Image time (secs)

Supersampling Multidimensional

slide-51
SLIDE 51

Direct only (relative cost 1x) Direct+Indirect (1.3x) Direct+Indirect+Volume (1.8x) Direct+Indirect+Volume+Motion (2.2x)

slide-52
SLIDE 52

Camera

  • Discretize full integral into 2 point sets

– Light points (L) – Gather points (G)

Point Sets

Light points

slide-53
SLIDE 53

Camera

  • Discretize full integral into 2 point sets

– Light points (L) – Gather points (G)

Point Sets

Light points

slide-54
SLIDE 54

Camera

  • Discretize full integral into 2 point sets

– Light points (L) – Gather points (G)

Point Sets

Light points

Pixel

Gather points

slide-55
SLIDE 55
  • Discretize full integral into 2 point sets

– Light points (L) – Gather points (G)

Point Sets

Light points Gather points

slide-56
SLIDE 56

Pixel =

Sj Mji Gji Vji Ii

Σ

(j,i)∈GxL

  • Sum over all pairs of gather and light points

– Can be billions of pairs per pixel

Discrete Equation

slide-57
SLIDE 57

Product Graph

  • Explicit hierarchy would be too expensive

– Up to billions of pairs per pixel

  • Use implicit hierarchy

– Cartesian product of two trees (gather & light)

slide-58
SLIDE 58

Light tree Gather tree

Product Graph

L0 L1 L2 L3 L4 L5 L6 G1 G0 G2

L0 L1 L2 L3 G0 G1

slide-59
SLIDE 59

Product Graph

Light tree Gather tree

X

=

L0 L1 L2 L3 L4 L5 L6 G1 G0 G2

G1 G0 G2 L0 L4 L1 L6 L2 L5 L3

Product Graph

slide-60
SLIDE 60

Product Graph

Light tree Gather tree

X

=

L0 L1 L2 L3 L4 L5 L6 G1 G0 G2

G1 G0 G2 L0 L4 L1 L6 L2 L5 L3

Product Graph

slide-61
SLIDE 61

Product Graph

G1 G0 G2 L0 L4 L1 L6 L2 L5 L3

Product Graph

slide-62
SLIDE 62

Product Graph

G1 G0 G2 L0 L4 L1 L6 L2 L5 L3

Product Graph

slide-63
SLIDE 63

Product Graph

Light tree Gather tree

X

=

L0 L1 L2 L3 L4 L5 L6 G1 G0 G2

G1 G0 G2 L0 L4 L1 L6 L2 L5 L3

Product Graph

slide-64
SLIDE 64

Cluster Representatives

slide-65
SLIDE 65

Cluster Representatives

slide-66
SLIDE 66
  • Collapse cluster-cluster interactions to point-cluster

– Minkowski sums – Reuse bounds from Lightcuts

  • Compute maximum over multiple BRDFs

– Rasterize into cube-maps

  • More details in the paper

Error Bounds

slide-67
SLIDE 67

Algorithm Summary

  • Once per image

– Create lights and light tree

  • For each pixel

– Create gather points and gather tree for pixel – Adaptively refine clusters in product graph until all cluster errors < perceptual metric

slide-68
SLIDE 68

L6 G2 L1 L2 L3 L4 L5 L0 G1 G0

  • Start with a coarse cut

– Eg, source node of product graph

Scalability

slide-69
SLIDE 69

L6 G2 L1 L2 L3 L4 L5 L0 G1 G0

  • Choose node with largest error bound & refine

– In gather or light tree

Scalability

slide-70
SLIDE 70

L6 G2 L1 L2 L3 L4 L5 L0 G1 G0

  • Choose node with largest error bound & refine

– In gather or light tree

Scalability

slide-71
SLIDE 71

L6 G2 L1 L2 L3 L4 L5 L0 G1 G0

  • Repeat process

Scalability

slide-72
SLIDE 72

L6 G2 L1 L2 L3 L4 L5 L0 G1 G0

  • Until all clusters errors < perceptual metric

– 2% of pixel value (Weber’s law)

Algorithm summary

slide-73
SLIDE 73

Results

  • Limitations

– Some types of paths not included

  • Eg, caustics

– Prototype only supports diffuse, Phong, and Ward materials and isotropic media

slide-74
SLIDE 74

Roulette

7,047,430 Pairs per pixel Time 590 secs Avg cut size 174 (0.002%)

slide-75
SLIDE 75

400 800 1200 1600 50 100 150 200 250 300

Image time (secs) Gather points (avg per pixel)

Image time vs. Gather points

Multidimensional Original lightcuts Eye rays only

Scalability

slide-76
SLIDE 76

Metropolis Comparison

Our result Time 9.8min Metropolis Time 148min (15x) Visible noise 5% brighter (caustics etc.)

Zoomed insets

slide-77
SLIDE 77

Kitchen

5,518,900 Pairs per pixel Time 705 secs Avg cut size 936 (0.017%)

slide-78
SLIDE 78

180 Gather points X 13,000 Lights = 234,000 Pairs per pixel

Avg cut size 447 (0.19%)

slide-79
SLIDE 79

114,149,280 Pairs per pixel Avg cut size 821 Time 1740 secs

slide-80
SLIDE 80

Scalability with many lights Approach #2:

Matrix Row-Column sampling

Hašan et al., SIGGRAPH 2007 Slides courtesy Miloš Hašan: http://www.cs.cornell.edu/~mhasan/

slide-81
SLIDE 81

Improving Scalability and Performance

10 min 13 min 20 min 3.8 sec 13.5 sec 16.9 sec Brute force: Our result:

81

slide-82
SLIDE 82

82

A Matrix Interpretation

Pixels

(2,000,000)

Lights (100,000)

slide-83
SLIDE 83
  • Compute sum of columns

83

Problem Statement

= Σ ( )

Pixels Lights

slide-84
SLIDE 84

84

Low-Rank Assumption

= Σ ( )

Pixels Lights

  • Column space is (close to) low-dimensional
slide-85
SLIDE 85

85

Ray-tracing vs Shadow Mapping

Lights Pixels Point-to-point visibility: Ray-tracing Point-to-many-points visibility: Shadow-mapping

slide-86
SLIDE 86

86

Computing Column Visibility

Shadow map at light position

Surface samples

  • Regular Shadow Mapping
slide-87
SLIDE 87

87

Row-Column Duality

Shadow map at sample position

  • Rows: Also Shadow Mapping!
slide-88
SLIDE 88

Image as a Weighted Column Sum

Compute small subset of columns compute weighted sum

  • The following is possible:
  • Use rows to choose a good set of columns!

88

slide-89
SLIDE 89

89

The Row-Column Sampling Idea

compute rows compute columns weighted sum

?

choose columns and weights

how to choose columns and weights?

slide-90
SLIDE 90

90

Clustering Approach

Clustering Choose representative columns Columns

slide-91
SLIDE 91

91

Reduced Matrix

Reduced columns

slide-92
SLIDE 92

Weights and Information Vectors

  • Weights wi

– Norms of reduced columns – Represent the “energy” of the light

  • Information vectors xi

– Normalized reduced columns – Represent the “kind” of light’s contribution

slide-93
SLIDE 93

93

Visualizing the Reduced Columns

Reduced columns: vectors in high- dimensional space visualize as …

radius = weight position = information vector

slide-94
SLIDE 94
  • Algorithm:
  • 1. Cluster reduced columns
  • 2. Choose a representative in each cluster, with

probability proportional to weight

  • 3. Approximate other columns in cluster by

(scaled) representative

  • This is a Monte Carlo estimator
  • Which clustering minimizes its variance?

94

Monte Carlo Estimator

slide-95
SLIDE 95
  • Minimize:
  • where:

95

The Clustering Objective

total cost of all clusters cost of a cluster sum over all pairs in it weights squared distance between information vectors

slide-96
SLIDE 96

Clustering Illustration

Strong but similar columns Weak columns can be clustered more easily Columns with various intensities can be clustered

slide-97
SLIDE 97

How to minimize?

  • Problem is NP-hard
  • Not much previous research
  • Should handle large input:

– 100,000 points – 1000 clusters

  • We introduce 2 heuristics:

– Random sampling – Divide & conquer

slide-98
SLIDE 98

Clustering by Random Sampling

Very fast (use optimized BLAS) Some clusters might be too small / large

slide-99
SLIDE 99

Clustering by Divide & Conquer

Splitting small clusters is fast Splitting large clusters is slow

slide-100
SLIDE 100

Combined Clustering Algorithm

slide-101
SLIDE 101

Combined Clustering Algorithm

slide-102
SLIDE 102

102

Full Algorithm

Compute rows (GPU) Weighted sum Assemble rows into reduced matrix Cluster reduced columns Choose representatives Compute columns (GPU)

slide-103
SLIDE 103
  • 2.1m polygons
  • Mostly indirect & sky illumination
  • Indirect shadows

103

Example: Temple

Our result: 16.9 sec (300

rows + 900 columns)

Reference: 20 min

(using all 100k lights)

5x diff

slide-104
SLIDE 104
  • 388k polygons
  • Mostly indirect illumination
  • Glossy surfaces
  • Indirect shadows

104

Example: Kitchen

Our result: 13.5 sec (432 rows

+ 864 columns)

Reference: 13 min (using all

100k lights)

5x diff

slide-105
SLIDE 105
  • 869k polygons
  • Incoherent geometry
  • High-frequency lighting
  • Kajiya-Kay hair shader

105

Example: Bunny

Our result: 3.8 sec (100 rows

+ 200 columns)

Reference: 10 min (using all

100k lights)

5x diff