Global Illumination II Shih-Chin Weng shihchin.weng@gmail.com Case - - PowerPoint PPT Presentation

global illumination ii
SMART_READER_LITE
LIVE PREVIEW

Global Illumination II Shih-Chin Weng shihchin.weng@gmail.com Case - - PowerPoint PPT Presentation

Global Illumination II Shih-Chin Weng shihchin.weng@gmail.com Case Study PantaRay from NVidia & Weta Scenario of PantaRay Scenario of PantaRay Case Study: PantaRay Splitting to chunks (green) Bucking van Emde Boas Layout etc.


slide-1
SLIDE 1

Global Illumination II

Shih-Chin Weng

shihchin.weng@gmail.com

slide-2
SLIDE 2

PantaRay from NVidia & Weta

Case Study

slide-3
SLIDE 3

Scenario of PantaRay

slide-4
SLIDE 4

Scenario of PantaRay

slide-5
SLIDE 5

Case Study: PantaRay

etc.

Bucking Splitting to chunks (green) BVH construction van Emde Boas Layout Converting to Bricks

slide-6
SLIDE 6

Hyperion from Disney Animation

Case Study

slide-7
SLIDE 7

Concerns of Production Renderers

  • Computation bound or I/O bound?
  • Challenges

– Massive geometry data set

  • Buildings, forest, hair, fur, etc.

– Large amount of high-resolution textures

  • Goals

– Reduce I/O costs – Improve memory access patterns

slide-8
SLIDE 8

The Beauty of San Fransokyo

[Video courtesy of Disney Animation.]

slide-9
SLIDE 9

City View of San Fransokyo

[Video courtesy of Disney Animation.]

slide-10
SLIDE 10

Introduction of Hyperion in Big Hero 6

  • Features

– Uni-directional path tracer (w/o intermediate caches) – Physically based rendering – Support volumetric rendering and mesh lights, etc.

  • Data complexity

– 83,000 buildings – 216,000 street lights

slide-11
SLIDE 11

Core Ideas To Ensure Coherence

  • Sort potentially out-of-core ray batches to extract ray

groups from a complex scene

– There are 30~60M rays per batch – Perform scene traversal per ray batch at a time

  • Sort ray hits for deferred shading w.r.t. shading

context (mesh ID + face ID)

– Hit points are grouped by mesh ID, then sorted by face ID

  • Achieve sequential texture reads with PTex
slide-12
SLIDE 12

Tracing Pipeline

[Eisenacher et al., EGSR’13]

slide-13
SLIDE 13

Tracing Pipeline

[Eisenacher et al., EGSR’13]

slide-14
SLIDE 14

Render Equation

slide-15
SLIDE 15

Where Does Light Come From?

direct indirect

slide-16
SLIDE 16

Global = Direct + Indirect Lighting

Direct Illumination Global Illumination

slide-17
SLIDE 17

Global = Direct + Indirect Lighting

Direct Illumination Global Illumination color bleeding

slide-18
SLIDE 18

Render Equation

𝑀 𝑦, 𝜕𝑝 = 𝑀𝑓 𝑦, 𝜕𝑝 + න

Ω

𝑀 𝑦, 𝜕𝑗 𝑔 𝜕𝑗, 𝜕𝑝 𝜕𝑗 ⋅ 𝑜 𝑒𝜕𝑗

Unknown!!

slide-19
SLIDE 19

Render Equation

𝑀 𝑦, 𝜕𝑝 = 𝑀𝑓 𝑦, 𝜕𝑝 + න

Ω

𝑀 𝑦, 𝜕𝑗 𝑔 𝜕𝑗, 𝜕𝑝 𝜕𝑗 ⋅ 𝑜 𝑒𝜕𝑗

Unknown!!

How do we solve this kind of equation??

slide-20
SLIDE 20

Render Equation

𝑀 𝑦, 𝜕𝑝 = 𝑀𝑓 𝑦, 𝜕𝑝 + න

Ω

𝑀 𝑦, 𝜕𝑗 𝑔 𝜕𝑗, 𝜕𝑝 𝜕𝑗 ⋅ 𝑜 𝑒𝜕𝑗

Unknown!!

How do we solve this kind of equation??

slide-21
SLIDE 21

Quadrature

  • 1D example

– Rectangle/trapezoid – Gaussian quadrature

  • Curse of dimensionality

– The dimension of render equation is infinity!! – That’s why we need Monte Carlo

https://en.wikipedia.org/wiki/Numerical_integration

slide-22
SLIDE 22

Monte Carlo Integration

slide-23
SLIDE 23

event sample space random variable 𝑌: 𝑇 → ℝ Ep f x = නf x p x dx V 𝑔(𝑦) = E 𝑔 𝑦 − 𝐹 𝑔 𝑦

2

V 𝑔(𝑦) = 𝐹 𝑔 𝑦

2 − 𝐹 𝑔 𝑦 2

P 𝐹 𝑇 probability set function Excepted value of a random variable Variance

It’s a function, NOT a variable!!

Probability Review

slide-24
SLIDE 24

Concepts

  • Use random numbers to approximate integrals
  • It only estimates the values of integrals

– i.e. gives the right answer on average

  • It only requires to be able to evaluate the integrand

at arbitrary points

– Nice property for multi-dimensional integrand such as radiance in render equation

slide-25
SLIDE 25

Monte Carlo Sampling

 Easy to implement  Efficient for high dimensional integrals ꭙ Noise (variance) ꭙ Low convergence rate (1/ 𝑜)

– But we don’t have many other choices in high dimensional space!

slide-26
SLIDE 26

Estimate 𝜌 with Monte Carlo Sampling

𝑄(𝑄𝑝𝑗𝑜𝑢𝑡𝐽𝑜𝐷𝑗𝑠𝑑𝑚𝑓) = 𝜌𝑠2 4𝑠2 ⇒ 𝜌 = 4𝑄 2r

https://en.wikipedia.org/wiki/Monte_Carlo_method#/media/File:Pi_30K.gif

slide-27
SLIDE 27

Probability Density Function (PDF)

Pr x ∈ a, b = න

a 𝑐

𝑞 𝑦 𝑒𝑦

The relative probability of a random variable taking on a particular value

  • 𝑞 𝑦 =

𝑒𝑄𝑠 𝑦 𝑒𝑦

≥ 0

  • ׬

−∞ ∞ 𝑞 𝑦 𝑒𝑦 = 1, Pr 𝑦 ∈ ℝ = 1

slide-28
SLIDE 28

Cumulative Distribution Function (CDF)

𝑄 𝑦 = 𝑄𝑠 𝑌 ≤ 𝑦

Figure from “Global Illumination Compendium”, Philip Dutré

slide-29
SLIDE 29

Properties of Estimators

  • Suppose 𝑅 is the unknown quantity
  • Unbiased: E 𝐺𝑂 = 𝑅

– Bias β FN = E 𝐺

𝑂 − 𝑅

– The expected value is independent of sample size N

  • Consistent
  • lim

𝑂→∞ 𝛾 𝐺 𝑂 = 0

  • lim

𝑂→∞ 𝐹 𝐺 𝑂 = 𝑅

slide-30
SLIDE 30

Law of Large Numbers

Pr E x = lim

N→∞

1 𝑂 ෍

𝑗=1 𝑂

𝑦𝑗 = 1 E 𝑔(𝑦) ≈ 1 𝑂 ෍

𝑗=1 𝑂

𝑔(𝑦𝑗)

slide-31
SLIDE 31

Law of Large Numbers

Pr E x = lim

N→∞

1 𝑂 ෍

𝑗=1 𝑂

𝑦𝑗 = 1 E 𝑔(𝑦) ≈ 1 𝑂 ෍

𝑗=1 𝑂

𝑔(𝑦𝑗)

N

slide-32
SLIDE 32

Law of Large Numbers

Pr E x = lim

N→∞

1 𝑂 ෍

𝑗=1 𝑂

𝑦𝑗 = 1 E 𝑔(𝑦) ≈ 1 𝑂 ෍

𝑗=1 𝑂

𝑔(𝑦𝑗)

N

slide-33
SLIDE 33

Insufficient Samples = High Variance = Noise

[Rendered with pbrt.v3]

slide-34
SLIDE 34

Monte Carlo Estimation

න𝑔 𝑦 𝑒𝑦 = න 𝑔 𝑦 𝑞 𝑦 𝑞 𝑦 𝑒𝑦 = 𝐹 𝑔 𝑦 𝑞 𝑦 ≈ 1 𝑂 ෍

𝑗=1 𝑂 𝑔 𝑦

𝑞 𝑦

estimator

Ω

𝑀𝑗 𝑦, 𝜕𝑗 𝑔 𝜕𝑗, 𝜕𝑝 𝜕𝑗 ⋅ 𝑜 𝑒𝜕𝑗 1 𝑂 ෍

𝑗=1 𝑂 𝑀𝑗 𝑦, 𝜕𝑗 𝑔 𝜕𝑗, 𝜕𝑝

𝜕𝑗 ⋅ 𝑜 𝑞 𝜕𝑗

Tricky Part!!

slide-35
SLIDE 35

Light Transport Algorithms

slide-36
SLIDE 36

Light Transport Algorithms

  • Path tracing
  • Light tracing
  • Bidirectional path tracing
  • Photon mapping
  • and many more…
slide-37
SLIDE 37

Path Tracing

slide-38
SLIDE 38

Light Tracing

slide-39
SLIDE 39

Bidirectional Path Tracing

slide-40
SLIDE 40

Photon Tracing

slide-41
SLIDE 41

Photon Tracing

slide-42
SLIDE 42

http://iliyan.com/publications/VertexMerging/comparison/

slide-43
SLIDE 43

Path Tracing Progressive Photon Mapping Bidirectional Path Tracing VCM

http://iliyan.com/publications/VertexMerging/comparison/

slide-44
SLIDE 44

Importance Sampling

slide-45
SLIDE 45

Direct Illumination

𝑀𝑠 𝑦, 𝜕𝑝 = න

Ω

𝑀 𝑦, 𝜕𝑗 𝑔 𝜕𝑗, 𝜕𝑝 𝜕𝑗 ⋅ 𝑜 𝑒𝜕𝑗

1 𝑂 ෍

𝑗=1 𝑂 𝑀𝑗 𝑦, 𝜕𝑗 𝑔 𝜕𝑗, 𝜕𝑝

𝜕𝑗 ⋅ 𝑜 𝑞 𝜕𝑗

  • 1. 𝑞 𝜕𝑗 ∝ 𝑀𝑗 𝑦, 𝜕𝑗 𝑔 𝜕𝑗, 𝜕𝑝

𝜕𝑗 ⋅ 𝑜 ?

  • 2. 𝑞 𝜕𝑗 ∝ 𝑀𝑗 𝑦, 𝜕𝑗 ?
  • 3. 𝑞 𝜕𝑗 ∝ 𝑔 𝜕𝑗, 𝜕𝑝

𝜕𝑗 ⋅ 𝑜 ?

slide-46
SLIDE 46

Uniform Sampling

slide-47
SLIDE 47

Importance Sampling

slide-48
SLIDE 48

Importance Sampling (Cont’d)

FN = 1 N ෍ 𝑔 𝑌𝑗 𝑞 𝑌𝑗 , 𝑥ℎ𝑓𝑠𝑓 𝑞(𝑌𝑗) ∝ 𝑔(𝑌𝑗)

Unknown!!

[Premože’10]

slide-49
SLIDE 49

Importance Sampling (Cont’d)

FN = 1 N ෍ 𝑔 𝑌𝑗 𝑞 𝑌𝑗 , 𝑥ℎ𝑓𝑠𝑓 𝑞(𝑌𝑗) ∝ 𝑔(𝑌𝑗)

Unknown!!

Bad choice of density function would increase the variance (to infinity)!!

[Premože’10]

slide-50
SLIDE 50

Emission Sampling

slide-51
SLIDE 51

BRDF Sampling

slide-52
SLIDE 52

High Throughput Connection

slide-53
SLIDE 53

Challenges

  • It’s hard to get the PDF of the convolution of

– Incoming radiance 𝑀 𝑦, 𝜕𝑗 and – BRDF 𝑔 𝜕𝑗, 𝜕𝑝

  • There’s an implicit visibility term within 𝑀 𝑦, 𝜕𝑗

– Visibility term can’t be derived before tracing

  • Using machine learning to adapt sampling distribution?
  • Dilemma

– Highly specular BRDFs with point light sources

slide-54
SLIDE 54

Highly Specular BRDF & Point Light

BRDF Sampling Light Sampling

slide-55
SLIDE 55

Multiple Importance Sampling

[Veach’95]

slide-56
SLIDE 56

Multiple Importance Sampling (Cont’d)

1 𝑜𝑔 ෍

𝑗=1 𝑜𝑔 𝑔 𝑌𝑗 𝑕 𝑌𝑗 𝑥𝑔(𝑌𝑗)

𝑞𝑔 𝑌𝑗 + 1 𝑜𝑕 ෍

𝑘=1 𝑜𝑕 𝑔 𝑍 𝑘 𝑕 𝑍 𝑘 𝑥 𝑕(𝑍 𝑘)

𝑞𝑕 𝑍

𝑘

  • 𝑜𝑙 is the number of samples taken from the 𝑞𝑙
  • the weighting functions 𝑥𝑙 take all of the different ways

that a sample 𝑌𝑗 𝑝𝑠 𝑍

𝑗 could have been generated

ws x = nsps x σ𝑗 𝑜𝑗𝑞𝑗 𝑦 ws x = nsps x

β

σ𝑗 𝑜𝑗𝑞𝑗 𝑦

𝛾

slide-57
SLIDE 57

Multiple Importance Sampling (Cont’d)

1 𝑜𝑔 ෍

𝑗=1 𝑜𝑔 𝑔 𝑌𝑗 𝑕 𝑌𝑗 𝑥𝑔(𝑌𝑗)

𝑞𝑔 𝑌𝑗 + 1 𝑜𝑕 ෍

𝑘=1 𝑜𝑕 𝑔 𝑍 𝑘 𝑕 𝑍 𝑘 𝑥 𝑕(𝑍 𝑘)

𝑞𝑕 𝑍

𝑘

  • 𝑜𝑙 is the number of samples taken from the 𝑞𝑙
  • the weighting functions 𝑥𝑙 take all of the different ways

that a sample 𝑌𝑗 𝑝𝑠 𝑍

𝑗 could have been generated

ws x = nsps x σ𝑗 𝑜𝑗𝑞𝑗 𝑦 ws x = nsps x

β

σ𝑗 𝑜𝑗𝑞𝑗 𝑦

𝛾