Advanced Global Illumination 15-462 Computer Graphics Mar 23, 2004 - - PowerPoint PPT Presentation

advanced global illumination
SMART_READER_LITE
LIVE PREVIEW

Advanced Global Illumination 15-462 Computer Graphics Mar 23, 2004 - - PowerPoint PPT Presentation

Advanced Global Illumination 15-462 Computer Graphics Mar 23, 2004 Sriram Vaidhyanathan 1 Announcements Ray tracer help session slides online Ray tracer assignment reminders Read the bboard! Questions? Mar 23, 2004 Sriram


slide-1
SLIDE 1

Mar 23, 2004 Sriram Vaidhyanathan 1

Advanced Global Illumination

15-462 Computer Graphics

slide-2
SLIDE 2

Mar 23, 2004 Sriram Vaidhyanathan 2

Announcements

  • Ray tracer help session slides online
  • Ray tracer assignment reminders

– Read the bboard!

  • Questions?
slide-3
SLIDE 3

Mar 23, 2004 Sriram Vaidhyanathan 3

Overview

  • Background
  • Monte Carlo Integration Methods
  • Path Tracing
  • Bidirectional Path Tracing
  • Metropolis Light Transport
  • Photon Mapping
  • BSSRDF’s & Subsurface Scattering
slide-4
SLIDE 4

Mar 23, 2004 Sriram Vaidhyanathan 4

Global Illumination

  • The story so far

– Local illumination – Ray tracing – Radiosity

  • What’s wrong?

– Efficiency issues – Incomplete models

slide-5
SLIDE 5

Mar 23, 2004 Sriram Vaidhyanathan 5

A mathematical model for global illumination

  • Kajiya’s rendering equation

– States necessary conditions for equilibrium

  • f light transport
  • Energy conservation
  • How can we solve this integral?

– Cannot be done analytically

slide-6
SLIDE 6

Mar 23, 2004 Sriram Vaidhyanathan 6

Simplifying assumptions

  • Any global illumination solution must

somehow closely approximate Kajiya’s rendering equation

  • Ray tracing?
  • Radiosity?
slide-7
SLIDE 7

Mar 23, 2004 Sriram Vaidhyanathan 7

Ray tracing + Radiosity

  • Two-pass method

– Pass 1: Enhanced Radiosity

  • View-independent

– Pass 2: Enhanced Ray tracing

  • View-dependent
  • Extremely slow!

– Still many approximating assumptions

slide-8
SLIDE 8

Mar 23, 2004 Sriram Vaidhyanathan 8

BRDF’s

  • Bidirectional Reflectance Distribution

Function (BRDF)

– General model of light reflection

  • BRDF Isotropy
  • Anisotropy

– Brushed metals, satin, hair

slide-9
SLIDE 9

Mar 23, 2004 Sriram Vaidhyanathan 9

Overview

  • Background
  • Monte Carlo Integration Methods
  • Path Tracing
  • Bidirectional Path Tracing
  • Metropolis Light Transport
  • Photon Mapping
  • BSSRDF’s & Subsurface Scattering
slide-10
SLIDE 10

Mar 23, 2004 Sriram Vaidhyanathan 10

Monte Carlo Integration

  • Estimate area under the curve (integral)

using samples of the function being integrated

  • Number of samples is inversely related to

the standard deviation of estimation error

  • Used often when integrals have no

analytical solution

slide-11
SLIDE 11

Mar 23, 2004 Sriram Vaidhyanathan 11

Sampling schemes

  • At what points do we sample?
  • Several schemes

– Random sampling – Importance sampling

  • Pick more samples in parts where the function

is large

– Stratified sampling

  • Divide domain into strata
  • One sample in each stratum
  • Good for smooth functions
slide-12
SLIDE 12

Mar 23, 2004 Sriram Vaidhyanathan 12

Solving the rendering equation

  • Use Monte Carlo sampling to estimate a

solution to the rendering equation

– Path tracing – Bidirectional path tracing – Metropolis Light Transport

slide-13
SLIDE 13

Mar 23, 2004 Sriram Vaidhyanathan 13

Overview

  • Ray tracing & Radiosity
  • Monte Carlo Integration Methods
  • Path Tracing
  • Bidirectional Path Tracing
  • Metropolis Light Transport
  • Photon Mapping
  • BSSRDF’s & Subsurface Scattering
slide-14
SLIDE 14

Mar 23, 2004 Sriram Vaidhyanathan 14

Heckbert’s Light Transport Notation

  • L – a light source
  • S – a specular reflection
  • D – a diffuse reflection
  • E – the eye
  • Regular expressions for combinations

– E.g. L(S|D)+DE

slide-15
SLIDE 15

Mar 23, 2004 Sriram Vaidhyanathan 15

Path Tracing

  • Simulates all

possible light paths L(S|D)*E

  • Requires a large

number of samples per pixel to remove noise

– 400 paths/pixel

slide-16
SLIDE 16

Mar 23, 2004 Sriram Vaidhyanathan 16

Path Tracing - algorithm

  • Start at eye
  • Build a path by, at each bounce, sampling a

direction according to some distribution

– Suggestions?

  • At each point on the path, cast a shadow ray

and add direct lighting contribution at that point

  • Multiple paths per pixel

– Average contributions to get intensity

slide-17
SLIDE 17

Mar 23, 2004 Sriram Vaidhyanathan 17

Picking new path directions

  • Importance sampling

– Using BRDF

  • Stratified sampling

– Break possible directions into sub-regions, and cast one sample per sub-region

  • Problems with path tracing

– Too many paths/pixel required!

slide-18
SLIDE 18

Mar 23, 2004 Sriram Vaidhyanathan 18

Overview

  • Ray tracing & Radiosity
  • Monte Carlo Integration Methods
  • Path Tracing
  • Bidirectional Path Tracing
  • Metropolis Light Transport
  • Photon Mapping
  • BSSRDF’s & Subsurface Scattering
slide-19
SLIDE 19

Mar 23, 2004 Sriram Vaidhyanathan 19

Bidirectional Path Tracing

  • Build a path by working from the eye and the light and join

in the middle

  • Don’t just look at overall path, also weigh contributions

from all sub-paths Pixel x0 x1 x3 x4 Light

slide-20
SLIDE 20

Mar 23, 2004 Sriram Vaidhyanathan 20

Bidirectional path tracing – the algorithm

Render image using bidrectional path tracing for each pixel and sample trace_paths(pixel position) trace_paths(pixel position) trace ray through pixel – generate eye path trace photon from light – generate light path combine(eye path, light path) combine(eye path, light path) for each vertex on eye path for each vertex on light path if vertices mutually visible compute weight for this path add in the contribution to the corresp. pixel

slide-21
SLIDE 21

Mar 23, 2004 Sriram Vaidhyanathan 21

Bidirectional path tracing vs. path tracing

  • Bidirectional path tracing

– Fewer samples per pixel – Better for certain effects, e.g. caustics

  • Path tracing

– Better when light sources are easiest to reach from the eye

slide-22
SLIDE 22

Mar 23, 2004 Sriram Vaidhyanathan 22

Overview

  • Ray tracing & Radiosity
  • Monte Carlo Integration Methods
  • Path Tracing
  • Bidirectional Path Tracing
  • Metropolis Light Transport
  • Photon Mapping
  • BSSRDF’s & Subsurface Scattering
slide-23
SLIDE 23

Mar 23, 2004 Sriram Vaidhyanathan 23

Metropolis Light Transport

  • Veach and Guibas,

1997

  • Similar concept

– Metropolis sampling algorithm, 1953

  • Mutate paths

– Accept mutated path with some probability

  • Implementation

builds character!

Veach & Guibas

slide-24
SLIDE 24

Mar 23, 2004 Sriram Vaidhyanathan 24

MLT algorithm

x=initial_path(); zero_out_image(); for i= 1 to n y=mutate(x); a=accept_prob(y|x) if(random()<a) then x = y record_sample(image,x) return image;

slide-25
SLIDE 25

Mar 23, 2004 Sriram Vaidhyanathan 25

Exotic MLT Strategies

  • Mutation

– Bidirectional mutation

  • Sample space exploration

– Lens subpath mutation

  • Sample stratification over image plane
  • Lens perturbations

– Rare convergence phenomena

  • Caustic perturbations
slide-26
SLIDE 26

Mar 23, 2004 Sriram Vaidhyanathan 26

MLT - Advantages

  • Path space explored locally

– Favor mutations that make small changes

  • Small average cost per sample

– Typically one or two rays

  • Paths near important ones sampled as

well

– Expense amortized

  • Easy extension of mutation set

– Exploit coherence

slide-27
SLIDE 27

Mar 23, 2004 Sriram Vaidhyanathan 27

Path Tracing vs. MLT

Veach & Guibas

slide-28
SLIDE 28

Mar 23, 2004 Sriram Vaidhyanathan 28

MLT vs. Bidirectional Path Tracing

Veach & Guibas

slide-29
SLIDE 29

Mar 23, 2004 Sriram Vaidhyanathan 29

Monte Carlo pro’s and con’s

  • Pro’s

– Simulate all global illumination effects – Arbitrary geometry – Low memory consumption

  • Con’s

– Noise – May be inefficient for complex lighting scenes

slide-30
SLIDE 30

Mar 23, 2004 Sriram Vaidhyanathan 30

Noise elimination

  • Obvious method
  • Variance reduction techniques

– Importance/stratified sampling! – Key idea: dump all problem information into selecting sampling technique

  • Russian Roulette

– Importance sampling using probability distribution function

slide-31
SLIDE 31

Mar 23, 2004 Sriram Vaidhyanathan 31

Questions?

?

slide-32
SLIDE 32

Mar 23, 2004 Sriram Vaidhyanathan 32

Overview

  • Ray tracing & Radiosity
  • Monte Carlo Integration Methods
  • Path Tracing
  • Bidirectional Path Tracing
  • Metropolis Light Transport
  • Photon Mapping
  • BSSRDF’s & Subsurface Scattering
slide-33
SLIDE 33

Mar 23, 2004 Sriram Vaidhyanathan 33

Photon Mapping

Henrik Jensen

slide-34
SLIDE 34

Mar 23, 2004 Sriram Vaidhyanathan 34

Photon Mapping: The concept

  • Motivation

– Want to simulate all global illumination effects on complex surfaces with arbitrary BRDF’s – As painlessly as possible

  • Problems with Monte-Carlo techniques

– Noise

  • Very costly to eliminate!
slide-35
SLIDE 35

Mar 23, 2004 Sriram Vaidhyanathan 35

Two-pass algorithm

  • First pass: photon tracing

– Fire photons from light sources into the scene – Build photon map data structure

  • Second pass: rendering
  • The first pass is view-independent!
slide-36
SLIDE 36

Mar 23, 2004 Sriram Vaidhyanathan 36

Photon tracing

  • Fire photons from

light sources

  • Contrast with ray

tracing

– Rays gather radiance – Photons propagate flux

CS 517, Cornell U.

slide-37
SLIDE 37

Mar 23, 2004 Sriram Vaidhyanathan 37

Physical quantities

  • Flux

– Rate of flow of radiant energy

  • Irradiance

– Flux arriving at surface location

  • Radiance

– Radiant flux per unit solid angle per unit projected area – Most closely represents the color of an object – Number of photons arriving per time at a small area from a given direction – Constant along line of sight in vacuum

  • Important for ray tracing!
slide-38
SLIDE 38

Mar 23, 2004 Sriram Vaidhyanathan 38

Firing photons from light sources

  • Different kinds of light sources

– Diffuse point light – Spherical light – Square light – Directional light – Complex light

  • Emit more photons from bright lights than dim ones

to even-out power

slide-39
SLIDE 39

Mar 23, 2004 Sriram Vaidhyanathan 39

The next step

  • What happens once your photon hits

something in the scene?

– Reflection – Transmission – Absorption

slide-40
SLIDE 40

Mar 23, 2004 Sriram Vaidhyanathan 40

Specular Reflection

  • Photon hits a mirror surface

– Reflect just like a ray

  • Power of reflected photon scaled by

reflectivity of mirror surface

slide-41
SLIDE 41

Mar 23, 2004 Sriram Vaidhyanathan 41

Diffuse Reflection

  • Photon hits a diffuse surface

– Store in photon map! – Reflect the photon

  • How?
  • Power scaled by diffuse reflectance
slide-42
SLIDE 42

Mar 23, 2004 Sriram Vaidhyanathan 42

Arbitrary BRDF Reflection

  • Compute the new photon direction by

importance sampling the BRDF!

  • Scale power using BRDF and reflectivity
  • f material
slide-43
SLIDE 43

Mar 23, 2004 Sriram Vaidhyanathan 43

Photon map data structure

  • Requirements

– Fast lookup of neighboring photons

  • For radiance estimates
  • Ideas?
  • Solution

– kd-trees!

slide-44
SLIDE 44

Mar 23, 2004 Sriram Vaidhyanathan 44

Kd-trees – quick review

  • Sort of like BSP trees

– Anyone?

  • Multidimensional binary search tree

– Each node partitions one dimension

  • O(k + log n) average for k nearest

neighbors with n photons in the kd-tree

  • Another solution

– Voronoi diagrams

  • O(k log n), but O(n^2) in space
slide-45
SLIDE 45

Mar 23, 2004 Sriram Vaidhyanathan 45

Second pass: rendering

  • Ray trace as normal
  • But when a ray hits a diffuse surface

– We need to consult the photon map to compute the radiance of this surface

slide-46
SLIDE 46

Mar 23, 2004 Sriram Vaidhyanathan 46

Radiance Estimate

  • When a ray hits a

diffuse surface, perform density approximation to get radiance

– Use kd-tree

CS 517, Cornell U.

slide-47
SLIDE 47

Mar 23, 2004 Sriram Vaidhyanathan 47

Radiance estimate

radiance_estimate(x,w,n) locate k nearest photons r = distance to the kth nearest photon ∑flux = 0 for each photon p pd = photon direction power = photon power ∑flux += fr(x,w,pd) * power Lr = ∑flux / r*r*pi return Lr

slide-48
SLIDE 48

Mar 23, 2004 Sriram Vaidhyanathan 48

Direct Visualization

10,000 photons fired 50,000 photons fired

Kayvon Fatahalian and Jonathan Hui

slide-49
SLIDE 49

Mar 23, 2004 Sriram Vaidhyanathan 49

Direct Visualization - II

100,000 photons fired 500,000 photons fired

Kayvon Fatahalian and Jonathan Hui

slide-50
SLIDE 50

Mar 23, 2004 Sriram Vaidhyanathan 50

Photon mapping effects

  • Caustics

– Focused light

  • Diffuse inter-reflections

– Color bleeding

  • Participating media

– Clouds, smoke, fog

Henrik Jensen, Jos Stam, Ron Fedkiw

slide-51
SLIDE 51

Mar 23, 2004 Sriram Vaidhyanathan 51

Caustics - I

Henrik Jensen

slide-52
SLIDE 52

Mar 23, 2004 Sriram Vaidhyanathan 52

Caustics - II

Henrik Jensen

slide-53
SLIDE 53

Mar 23, 2004 Sriram Vaidhyanathan 53

Formation of caustics - I

  • LS+DE paths

– One or more specular hits ending on diffuse – May not be extremely important in scene

http://och.phpwebhosting.com/tachyonic.htm

slide-54
SLIDE 54

Mar 23, 2004 Sriram Vaidhyanathan 54

Formation of caustics - II

http://och.phpwebhosting.com/tachyonic.htm

slide-55
SLIDE 55

Mar 23, 2004 Sriram Vaidhyanathan 55

Multiple photon maps

  • For efficiency, it is usually good to

maintain a separate photon map for paths that lead to caustics

– Caustic photon map

  • Also maintain a global photon map for

all paths

  • Pick the right photon map during

radiance estimation

slide-56
SLIDE 56

Mar 23, 2004 Sriram Vaidhyanathan 56

Participating media

  • Dust, air, clouds, fog, smoke
  • Do photon interactions occur only at
  • bject surfaces?

– Only in vacuum!

  • Solution

– Use volume photon map to store photon scattering/absorption with medium

  • How do we get the radiance estimate?
slide-57
SLIDE 57

Mar 23, 2004 Sriram Vaidhyanathan 57

Optimization strategies - I

  • Irradiance caching

– Speedup for computing indirect illumination

  • Visual Importance

– “importons” from observer to determine important regions of the scene

  • Efficient Stratification of Photons

– Quasi-Monte Carlo methods

slide-58
SLIDE 58

Mar 23, 2004 Sriram Vaidhyanathan 58

Optimization strategies - II

  • Fast Shadows with Shadow Photons
  • Precomputed Irradiance

– Extend photon data structure to include irradiance – Speedup of a factor of six in some cases

  • Parallel Number-Crunching

– Easy to parallelize

slide-59
SLIDE 59

Mar 23, 2004 Sriram Vaidhyanathan 59

Extensions to photon mapping

  • Time dependent photon mapping

– Motion blur - must avoid strobing artifacts

Mike Cammarano, Henrik Jensen

slide-60
SLIDE 60

Mar 23, 2004 Sriram Vaidhyanathan 60

Hardware photon mapping

  • Speedups using programmable graphics

hardware?

  • Use GPU to compute nearest k

neighbors for radiance estimate

  • 8.3 seconds for the ring caustic
  • 64.3 seconds for the Cornell box scene
slide-61
SLIDE 61

Mar 23, 2004 Sriram Vaidhyanathan 61

Real world photon mapping

  • Gaining wide

acceptance and popularity!

  • High-end rendering

software packages

– Dali, 3D Studio Max

  • Games, movies

– Kilauea, SquareUSA

  • Whisky glass from

Final Fantasy movie

SquareUSA

slide-62
SLIDE 62

Mar 23, 2004 Sriram Vaidhyanathan 62

Questions?

?

slide-63
SLIDE 63

Mar 23, 2004 Sriram Vaidhyanathan 63

Movies!

slide-64
SLIDE 64

Mar 23, 2004 Sriram Vaidhyanathan 64

Overview

  • Ray tracing & Radiosity
  • Monte Carlo Integration Methods
  • Path Tracing
  • Bidirectional Path Tracing
  • Metropolis Light Transport
  • Photon Mapping
  • BSSRDF’s & Subsurface Scattering
slide-65
SLIDE 65

Mar 23, 2004 Sriram Vaidhyanathan 65

BRDF Limitations

  • Back to the BRDF…
  • What are we missing from the BRDF?

– What assumption are we making about light rays?

  • Think about non-metallic materials, like marble

– BRDF’s don’t account for translucency effects

slide-66
SLIDE 66

Mar 23, 2004 Sriram Vaidhyanathan 66

BSSRDF’s

  • Bidirectional Surface Scattering

Reflectance Distribution Function

Henrik Wann Jensen, et. Al.

slide-67
SLIDE 67

Mar 23, 2004 Sriram Vaidhyanathan 67

Glasses of milk

slide-68
SLIDE 68

Mar 23, 2004 Sriram Vaidhyanathan 68

Movies!

Henrik Jensen

slide-69
SLIDE 69

Mar 23, 2004 Sriram Vaidhyanathan 69

Appearance Modeling

  • BSSRDF’s are good for translucent

materials

– Skin, marble, cloth, paper, cheese, bread, plants, fish, ocean water, snow

  • Wide acceptance

– Most renderers have BSSRDF functionality – Lord of the Rings’ Gollum, Harry Potter’s Dobby, T3’s Arnold – Technical Oscar winner, 2004 – Expected in next-gen consoles

slide-70
SLIDE 70

Mar 23, 2004 Sriram Vaidhyanathan 70

Questions?

slide-71
SLIDE 71

Mar 23, 2004 Sriram Vaidhyanathan 71

Resources

  • References

– Realistic Image Synthesis Using Photon Mapping, Henrik Wann Jensen – 3D Computer Graphics, Alan Watt

  • Internet Resources

– http://www.daimi.au.dk/~lai/lysrapport/ph

  • tonmapping.html

– http://graphics.ucsd.edu/~henrik/ – http://och.phpwebhosting.com/tachyonic.h tm