Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination...

44
Progressive Photon Mapping Basics Toshiya Hachisuka Aarhus University State of the Art in Photon Density Estimation SIGGRAPH 2012 Course

Transcript of Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination...

Page 1: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Progressive Photon Mapping Basics

Toshiya HachisukaAarhus University

State of the Art in Photon Density EstimationSIGGRAPH 2012 Course

Page 2: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

(c)Y. Kimura

Page 3: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Global Illumination Algorithms

• Path Tracing [Kajiya 86]

• Light Tracing [Arvo 86][Dutré 93]

• Bidirectional Path Tracing [Lafortune 93][Veach 95]

• Photon Mapping [Jensen 95]

• Density Estimation [Shirley 95]

• Instant Radiosity [Keller 97]

• Metropolis Light Transport [Veach 97]

• Lightcuts [Walter 05]

• Energy Redistribution Path Tracing [Cline 05]

• ...

Page 4: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Light source Eye

Matte Surface

Page 5: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Eye

Transparent Layer

Matte Surface

Light source

Page 6: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Matte Surface

Specular-Diffuse-Specular PathsEye

Transparent Layer

Light source

Page 7: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Metal tube

Light

Lens

Page 8: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Path Tracing

Page 9: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Bidirectional Path Tracing

Page 10: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Metropolis Light Transport

Page 11: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]
Page 12: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]
Page 13: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]
Page 14: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Specular-Diffuse-Specular Paths

• Existing methods are not robust for SDS paths

• Path tracing

• Bidirectional path tracing

• Metropolis light transport

• ...name your favorite

Page 15: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Specular-Diffuse-Specular Paths

• Existing methods are not robust for SDS paths

• Path tracing

• Bidirectional path tracing

• Metropolis light transport

• ...name your favorite

• Photon mapping?

Page 16: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Photon Mapping

Page 17: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Photon Mapping

Page 18: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Convergence of Photon Mapping

More photons →

Page 19: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

• Infinite number of nearby photons (Nβ→∞)

• Infinitely small radius (r→0)

Convergence of Photon Mapping

L(x, �ω) = limN→∞

Nβ�

p=1

fr(x, �ω, �ωp)φp(xp, �ωp)

πr2

Page 20: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

• Infinite number of nearby photons (Nβ→∞)

• Infinitely small radius (r→0)

Convergence of Photon Mapping

L(x, �ω) = limN→∞

Nβ�

p=1

fr(x, �ω, �ωp)φp(xp, �ωp)

πr2

Infinite storage & photon tracing

Page 21: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Solution:Progressive Photon Mapping

Page 22: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Initial Pass Photon Pass

Overview

Page 23: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]
Page 24: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Initial Pass

Page 25: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Initial Pass

Page 26: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Photon Statistics

• Each measurement point:

• Accumulated flux times BRDF

• Search radius

• Local photon count

• Global:

• Emitted photon count

τi (x, �ω)

Ri (x)

Ne(i)

Ni(x)

Page 27: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Photon Pass

Page 28: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Photon Pass

Page 29: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Photon Pass

Page 30: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Next Photon Pass

Page 31: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Next Photon Pass

Page 32: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Rendering

Page 33: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Li (�ω) =Ni�

p=1

fr (�ω, �ωp)φp (�ωp)πR2

i

• Converges to the correct solution

• Infinite number of photons

• Infinitely small radius

Progressive Density Estimation

Page 34: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Equal-time Comparisons

Metal tube

Light

Lens

Page 35: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Path Tracing

Page 36: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Bidirectional Path Tracing

Page 37: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Metropolis Light Transport

Page 38: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Progressive Photon Mapping

Page 39: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Bidirectional Path Tracing Progressive Photon Mapping

Page 40: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Metropolis Light Transport

Page 41: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Progressive Photon Mapping

Page 42: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Sample Code

• smallppm - 128 lines of working PPM code

cs.au.dk/~toshiya/smallppm.cpp

Page 43: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

Summary

• Infinite number of photons without storing them- “Path tracing”nization of photon mapping

• Robust to specular-diffuse-specular paths

• Converges to the correct solution

• Easy to implement

Page 44: Progressive Photon Mapping - 東京大学hachisuka/starpm2012/PPM_Basics.pdf · Global Illumination Algorithms • Path Tracing [Kajiya 86] • Light Tracing [Arvo 86][Dutré 93]

PPM in the Wild