lightcuts: a scalable approach to illuminationbjw/lightcutsigtalk05.pdf · lightcuts: a scalable...

70
Lightcuts: A Scalable Approach to Illumination Lightcuts: A Scalable Approach to Illumination Bruce Walter, Sebastian Fernandez, Adam Arbree, Mike Donikian, Kavita Bala, Donald Greenberg Program of Computer Graphics, Cornell University

Upload: vanduong

Post on 05-Jun-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

Lightcuts: A Scalable Approach to Illumination

Lightcuts: A Scalable Approach to Illumination

Bruce Walter, Sebastian Fernandez, Adam Arbree, Mike Donikian,

Kavita Bala, Donald Greenberg

Program of Computer Graphics, Cornell University

LIGHTCUTS

SIGGRAPH 2005

2

Lightcuts Lightcuts

• Efficient, accurate complex illumination

Environment map lighting & indirectTime 111s

Textured area lights & indirectTime 98s

(640x480, Anti-aliased, Glossy materials)

LIGHTCUTS

SIGGRAPH 2005

3

ScalableScalable

• Scalable solution for many point lights– Thousands to millions

– Sub-linear cost

0

100

200

300

400

500

600

0 1000 2000 3000 4000

Number of Point Lights

Tim

e (s

ecs)

StandardWardLightcut

Tableau Scene

LIGHTCUTS

SIGGRAPH 2005

4

Complex LightingComplex 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

LIGHTCUTS

SIGGRAPH 2005

5

Related WorkRelated Work• Hierarchical techniques

– Hierarchical radiosity [eg, Hanrahan et al. 91, Smits et al. 94]

– Light hierarchy [Paquette et al. 98]

• Many lights– [eg, Teller & Hanrahan 93, Ward 94, Shirley et al. 96, Fernandez et al. 2002,

Wald et al. 2003]

• Illumination coherence– [eg, Kok & Jensen 92, Ward 92, Scheel et al. 2002, Krivanek et al. 2005]

• Env map illumination– [Debevec 98, Agarwal et al. 2003, Kollig & Keller 2003, Ostromoukhov et al.

2004]

• Instant Radiosity– [Keller 97, Wald et al. 2002]

LIGHTCUTS

SIGGRAPH 2005

6

Talk OverviewTalk Overview

• Lightcuts– Scalable accurate solution for complex illumination

• Reconstruction cuts– Builds on lightcuts

– Use smart interpolation to further reduce cost

LIGHTCUTS

SIGGRAPH 2005

7

Lightcuts ProblemLightcuts Problem

Visiblesurface

LIGHTCUTS

SIGGRAPH 2005

8

Lightcuts ProblemLightcuts Problem

LIGHTCUTS

SIGGRAPH 2005

9

Lightcuts ProblemLightcuts Problem

Camera

LIGHTCUTS

SIGGRAPH 2005

10

Key ConceptsKey Concepts

• Light Cluster– Approximate many lights by a single brighter light

(the representative light)

LIGHTCUTS

SIGGRAPH 2005

11

Key ConceptsKey Concepts

• Light Cluster

• Light Tree– Binary tree of lights and clusters

Clusters

IndividualLights

LIGHTCUTS

SIGGRAPH 2005

12

Key ConceptsKey Concepts

• Light Cluster

• Light Tree

• A Cut– A set of nodes that partitions the lights into clusters

LIGHTCUTS

SIGGRAPH 2005

13

Simple ExampleSimple Example

#1 #2 #3 #4

1 2 3 4

1 4

Light Tree

Clusters

IndividualLights

RepresentativeLight

4

LIGHTCUTS

SIGGRAPH 2005

14

Three Example CutsThree 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

LIGHTCUTS

SIGGRAPH 2005

15

Three Example CutsThree 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

LIGHTCUTS

SIGGRAPH 2005

16

Three Example CutsThree 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

LIGHTCUTS

SIGGRAPH 2005

17

Three Example CutsThree 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

LIGHTCUTS

SIGGRAPH 2005

18

Algorithm OverviewAlgorithm Overview

• Pre-process– Convert illumination to point lights

– Build light tree

• For each eye ray– Choose a cut to approximate the illumination

LIGHTCUTS

SIGGRAPH 2005

19

Convert IlluminationConvert Illumination

• HDR environment map– Apply captured light to scene

– Convert to directional point lightsusing [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

LIGHTCUTS

SIGGRAPH 2005

20

Algorithm OverviewAlgorithm 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

LIGHTCUTS

SIGGRAPH 2005

21

Perceptual MetricPerceptual 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

LIGHTCUTS

SIGGRAPH 2005

22

Illumination EquationIllumination Equation

Material term

result = Mi Gi Vi IiΣlights

Geometric termVisibility termLight intensity

Currently support diffuse, phong, and Ward

LIGHTCUTS

SIGGRAPH 2005

23

Illumination EquationIllumination Equation

Material term

result = Mi Gi Vi IiΣlights

Geometric termVisibility termLight intensity

LIGHTCUTS

SIGGRAPH 2005

24

Illumination EquationIllumination Equation

Material term

result = Mi Gi Vi IiΣlights

Geometric termVisibility termLight intensity

LIGHTCUTS

SIGGRAPH 2005

25

Cluster ApproximationCluster Approximation

Cluster

result ~ Mj Gj Vj IiΣlights

~

j is the representative light

LIGHTCUTS

SIGGRAPH 2005

26

error < Mub Gub Vub Ii

Cluster Error BoundCluster 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

LIGHTCUTS

SIGGRAPH 2005

27

Cut Selection AlgorithmCut Selection Algorithm

Cut

• Start with coarse cut (eg, root node)

LIGHTCUTS

SIGGRAPH 2005

28

Cut Selection AlgorithmCut Selection Algorithm

Cut

• Select cluster with largest error bound

LIGHTCUTS

SIGGRAPH 2005

29

Cut Selection AlgorithmCut Selection Algorithm

Cut

• Refine if error bound > 2% of total

LIGHTCUTS

SIGGRAPH 2005

30

Cut Selection AlgorithmCut Selection Algorithm

Cut

LIGHTCUTS

SIGGRAPH 2005

31

Cut Selection AlgorithmCut Selection Algorithm

Cut

LIGHTCUTS

SIGGRAPH 2005

32

Cut Selection AlgorithmCut Selection Algorithm

Cut

LIGHTCUTS

SIGGRAPH 2005

33

Cut Selection AlgorithmCut Selection Algorithm

Cut

• Repeat until cut obeys 2% threshold

Lightcuts (128s) Reference (1096s)

Kitchen, 388K polygons, 4608 lights (72 area sources)

Lightcuts (128s) Reference (1096s)

Error Error x16

Kitchen, 388K polygons, 4608 lights (72 area sources)

LIGHTCUTS

SIGGRAPH 2005

36

Combined IlluminationCombined Illumination

Lightcuts 128s

4 608 Lights(Area lights only)

Lightcuts 290s

59 672 Lights(Area + Sun/sky + Indirect)

LIGHTCUTS

SIGGRAPH 2005

37

Combined IlluminationCombined 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)

LIGHTCUTS

SIGGRAPH 2005

38

Lightcuts RecapLightcuts 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

Lightcuts implementation sketch, Petree Hall C, ~4:30pm

LIGHTCUTS

SIGGRAPH 2005

39

Talk OverviewTalk Overview

• Lightcuts– Scalable accurate solution for complex illumination

• Reconstruction cuts– Builds on lightcuts

– Use smart interpolation to further reduce cost

LIGHTCUTS

SIGGRAPH 2005

40

Reconstruction CutsReconstruction Cuts

• Subdivide image into blocks– Generate samples at corners

• Within blocks– Interpolate smooth illumination

– Use shadow rays when needed to preserve features

• Shadow boundaries, glossy highlights, etc.

• Anti-aliasing – (5-50 samples per pixel)

LIGHTCUTS

SIGGRAPH 2005

41

Image SubdivisionImage Subdivision

• Divide into max block size (4x4 blocks)

4x4 block

LIGHTCUTS

SIGGRAPH 2005

42

Image SubdivisionImage Subdivision

• Divide into max block size (4x4 blocks)

• Trace multiple eye rays per pixel

• Subdivide blocks if needed– Based on material, surface normal,

and local shadowing configuration

LIGHTCUTS

SIGGRAPH 2005

43

Image SubdivisionImage Subdivision

• Divide into max block size (4x4 blocks)

• Trace multiple eye rays per pixel

• Subdivide blocks if needed– Based on material, surface normal,

and local shadowing configuration

• Compute samples at corners

Samples

LIGHTCUTS

SIGGRAPH 2005

44

Image SubdivisionImage Subdivision

• Divide into max block size (4x4 blocks)

• Trace multiple eye rays per pixel

• Subdivide blocks if needed– Based on material, surface normal,

and local shadowing configuration

• Compute samples at corners

• Shade eye rays using reconstruction cuts Samples Reconstruction

cut

LIGHTCUTS

SIGGRAPH 2005

45

Sample ConstructionSample Construction

• Compute a lightcut at each sample

• For each node on or above the cut – Create impostor light (directional light)

– Reproduce cluster’s effect at sample

Cluster

ImpostorDirectional light

LIGHTCUTS

SIGGRAPH 2005

46

Reconstruction CutReconstruction Cut

• Top-down traversal of light tree– Comparing impostors from nearby samples

Not visited

Recurse

Occluded

Interpolate

Shadow ray

LIGHTCUTS

SIGGRAPH 2005

47

Reconstruction CutReconstruction Cut

• Recurse if samples differ significantly

Not visited

Recurse

Occluded

Interpolate

Shadow ray

LIGHTCUTS

SIGGRAPH 2005

48

Reconstruction CutReconstruction Cut

• Discard if cluster occluded at all samples

Not visited

Recurse

Occluded

Interpolate

Shadow ray

LIGHTCUTS

SIGGRAPH 2005

49

Reconstruction CutReconstruction Cut

Not visited

Recurse

Occluded

Interpolate

Shadow ray

LIGHTCUTS

SIGGRAPH 2005

50

Reconstruction CutReconstruction Cut

Not visited

Recurse

Occluded

Interpolate

Shadow ray

LIGHTCUTS

SIGGRAPH 2005

51

Reconstruction CutReconstruction Cut

• Interpolate if sample impostors are similar

Not visited

Recurse

Occluded

Interpolate

Shadow ray

LIGHTCUTS

SIGGRAPH 2005

52

Reconstruction CutReconstruction Cut

• If cluster contribution small enough, shoot shadow ray to representative light– Lightcut-style evaluation

Not visited

Recurse

Occluded

Interpolate

Shadow ray

LIGHTCUTS

SIGGRAPH 2005

53

Reconstruction CutReconstruction Cut

Not visited

Recurse

Occluded

Interpolate

Shadow ray

Temple, 2.1M polygons, 505064 lights, (Sun/sky+Indirect)

Temple, reconstruction cut block size

LIGHTCUTS

SIGGRAPH 2005

56

Result StatisticsResult Statistics

• Temple model (2.1M polys, 505064 lights)

5.5

1

Avg. eye rays per pixel

189s

225s

Image timeImage algorithm

Combined (anti-aliased)

Lightcuts only

Reconstruction cut

Lightcut

Cut type Avg. shadow rays per cut

9.4

373

Grand Central, 1.46M polygons, 143464 lights, (Area+Sun/sky+Indirect)

Avg. shadow rays per eye ray 46 (0.03%)

Tableau, 630K polygons, 13000 lights, (EnvMap+Indirect)

Avg. shadow rays per eye ray 17 (0.13%)

Bigscreen, 628K polygons, 639528 lights, (Area+Indirect)Avg. shadow rays per eye ray 17 (0.003%)

LIGHTCUTS

SIGGRAPH 2005

60

ConclusionsConclusions

• Lightcuts – Scalable, unified framework

for complex illumination

– Analytic cluster error bounds & perceptual visibility metric

• Reconstruction cuts– Exploits coherence

– High-resolution, anti-aliased images

0

100

200

300

400

500

600

0 1000 2000 3000 4000

Number of Point Lights

Tim

e (s

ecs)

StandardWardLightcut

LIGHTCUTS

SIGGRAPH 2005

61

Future WorkFuture Work

• Visibility bounds

• More light types– Spot lights etc.

• More BRDF types– Need cheap tight bounds

• Other illumination types– Eg, caustics

LIGHTCUTS

SIGGRAPH 2005

62

AcknowledgementsAcknowledgements

• National Science Foundation grant ACI-0205438• Intel corporation for support and equipment• The modelers

– Kitchen: Jeremiah Fairbanks

– Bigscreen: Will Stokes

– Grand Central: Moreno Piccolotto, Yasemin Kologlu, Anne Briggs, Dana Gettman

– Temple: Veronica Sundstedt, Patrick Ledda, and the graphics group at University of Bristol

– Stanford and Georgia Tech for Buddha and Horse geometry

LIGHTCUTS

SIGGRAPH 2005

63

The EndThe End

• Questions?

Lightcuts implementation sketch, Petree Hall C, ~4:30pm

LIGHTCUTS

SIGGRAPH 2005

64

ScalableScalable

• Scalable solution for many point lights– Thousands to millions

– Sub-linear cost

0

100

200

300

400

500

600

0 1000 2000 3000 4000 5000

Number of Point Lights

Tim

e (s

ecs)

StandardWardLightcuts

0

100

200

300

400

500

600

0 1000 2000 3000 4000

Number of Point Lights

Tim

e (s

ecs)

StandardWardLightcut

Tableau Scene Kitchen Scene

Lightcuts Reference

Error x 16Cut size

Kitchen, 388K polygons, 59,672 Lights

Kitchen, shadow ray false color

0 750 1500

Tableau, shadow ray false color

0 750 1500

Kitchen with sample locations marked

LIGHTCUTS

SIGGRAPH 2005

70

Types of Point LightsTypes of Point Lights

• Omni– Spherical lights

• Oriented– Area lights, indirect lights

• Directional– HDR env maps, sun&sky