Physically-Based Rendering Shih-Chin Weng shihchin.weng@gmail.com - - PowerPoint PPT Presentation

physically based rendering
SMART_READER_LITE
LIVE PREVIEW

Physically-Based Rendering Shih-Chin Weng shihchin.weng@gmail.com - - PowerPoint PPT Presentation

Physically-Based Rendering Shih-Chin Weng shihchin.weng@gmail.com What is PBR? The Chemical Brothers - Wide Open, The Mill Physically Based Rendering Simulate materials and lights based on physical laws or observations of real world more


slide-1
SLIDE 1

Physically-Based Rendering

Shih-Chin Weng

shihchin.weng@gmail.com

slide-2
SLIDE 2

What is PBR?

slide-3
SLIDE 3
slide-4
SLIDE 4
slide-5
SLIDE 5

The Chemical Brothers - Wide Open, The Mill

slide-6
SLIDE 6

Physically Based Rendering

Simulate materials and lights based on physical laws

  • r observations of real world more accurately.
slide-7
SLIDE 7

Stages of Photorealistic Rendering

  • 1. Measurement and acquisition of scene data

– BRDF, BSSRDF, BTF, etc.

  • 2. Light transport simulation

– Ray tracing, photon-mapping, radiosity, etc.

  • 3. Visual display

– Tone mapping

slide-8
SLIDE 8

What Is Light?

Video: What Is Light? by Kurzgesagt

slide-9
SLIDE 9

Video: What Is Light? by Kurzgesagt

slide-10
SLIDE 10

Geometric Optics

  • Assumption: the wavelength of light is much smaller

than the scale of interacted object

  • Light travels

– in straight lines – instantaneously through a medium

  • Light is not influenced by gravity or magnetic fields

– No diffraction, dispersion – But the movie “Interstellar” does simulate the light bent by gravity!!

slide-11
SLIDE 11

Light Matter Interaction

specular diffuse diffuse scattering particles

slide-12
SLIDE 12

Photo by Gabriel Gurrola

Snell’s Law

slide-13
SLIDE 13

Snell’s Law

𝑡𝑗𝑜 𝜄𝑗 𝜃𝑗 = 𝑡𝑗𝑜 𝜄𝑢 𝜃𝑢

Index of Refraction (IOR): 𝜃

𝜄𝑗 𝜄𝑗 𝜄𝑢

𝜃𝑗 𝜃𝑢

https://en.wikipedia.org/wiki/Snell%27s_law#/media/File:Snells_law_wavefronts.gif

slide-14
SLIDE 14

Snell’s Law

𝑡𝑗𝑜 𝜄𝑗 𝜃𝑗 = 𝑡𝑗𝑜 𝜄𝑢 𝜃𝑢

Index of Refraction (IOR): 𝜃

𝜄𝑗 𝜄𝑗 𝜄𝑢

𝜃𝑗 𝜃𝑢

https://en.wikipedia.org/wiki/Snell%27s_law#/media/File:Snells_law_wavefronts.gif

slide-15
SLIDE 15

Photo by Ales Krivec

Fresnel Effect

refraction reflection

slide-16
SLIDE 16

Photo by Ashes Sitoula

Fresnel Effect

F0

reflectance at normal more and more reflective as the angle of view approaches a grazing angle

slide-17
SLIDE 17

Fresnel

  • Fresnel reflectance

– the amount of reflected light w.r.t. the viewing angle

  • Relates the ratio of reflected and transmitted energy

as a function of

– Incident direction – Polarization – Materials’ properties

slide-18
SLIDE 18

Material Properties

Non-metal (dielectrics)

  • Only reflect 4~10% of

incoming light in average

  • The reflection intensity is

independent on the wavelength

  • No energy is absorbed

during reflection

– but might be absorbed during subsurface scattering

Metal

  • IOR strongly depends on the

wavelength

  • Immediately absorbs

refracted lights (i.e. no refraction)

– The reflected lights would change their color

slide-19
SLIDE 19

Fresnel Reflectance

[Real-time Rendering, 3/e, A K Peters 2008]

slide-20
SLIDE 20

Fresnel Reflectance

[Real-time Rendering, 3/e, A K Peters 2008]

slide-21
SLIDE 21

Fresnel Reflectance

[Real-time Rendering, 3/e, A K Peters 2008]

slide-22
SLIDE 22

Fresnel Reflectance

[Real-time Rendering, 3/e, A K Peters 2008]

slide-23
SLIDE 23

Fresnel Reflectance

[Real-time Rendering, 3/e, A K Peters 2008]

Reflection goes to 100% at grazing angle!

slide-24
SLIDE 24

Fresnel

𝜄𝑗 𝜄𝑗 𝜄𝑢

𝜃𝑗 𝜃𝑢

Fr = 1 2 𝑠

∥ 2 + 𝑠 ⊥ 2 Dielectric

r∥ = ηt cos 𝜄𝑗 − 𝜃𝑗 cos 𝜄𝑢 ηt cos 𝜄𝑗 + 𝜃𝑗 cos 𝜄𝑢 r⊥ = ηi cos 𝜄𝑗 − 𝜃𝑢 cos 𝜄𝑢 ηi cos 𝜄𝑗 + 𝜃𝑢 cos 𝜄𝑢

Conductor

r∥

2 = η2 + k2 cos2 θ𝑗 − 2η cos 𝜄𝑗 + 1

η2 + k2 cos2 θ𝑗 + 2η cos 𝜄𝑗 + 1 r⊥

2 = η2 + k2 − 2η cos 𝜄𝑗 + cos2 𝜄𝑗

η2 + k2 + 2η cos 𝜄𝑗 + cos2 𝜄𝑗 for unpolarized light

slide-25
SLIDE 25

Radiometry

Radiant flux Φ =

dQ dt (J/sec) The total amount of energy

passing through a region of surface per unit time

Irradiance 𝐹 =

𝑒𝛸 𝑒𝐵 Pre area incoming flux at a surface

Radiant Exitance or Radiosity

𝑁 = 𝐶 = 𝑒𝛸 𝑒𝐵 𝐹 = Φ 4𝜌𝑠2

the total amount 𝛸 measured at inner and outer sphere is the same (equals to the radiant flux of the point light) r

slide-26
SLIDE 26

Lambert’s Cosine Law

𝐹 = 𝑒𝛸 𝑒𝐵

𝑒𝐵 = 𝑒𝐵′ cos 𝜄 𝑒𝐵

𝐹1 = 𝑒𝛸 𝑒𝐵 𝐹2 = 𝑒𝛸 𝑒𝐵′ = cos 𝜄 𝑒𝛸 𝑒𝐵 = 𝐹1 cos 𝜄

𝜄 𝑒𝐵

slide-27
SLIDE 27

Solidangle

– The total area on a unit sphere subtended by the object – A set of directions – Measured in steradians (sr) – Often denoted as 𝜕 Ω = A r2

slide-28
SLIDE 28

Radiance

𝑀 = 𝑒2𝛸 𝑒𝜕𝑒𝐵⊥ = 𝑒2𝛸 𝑒𝜕𝑒𝐵 𝑑𝑝𝑡 𝜄

flux projected area solidangle

𝑒𝐵 𝑒𝜕 𝑒𝐵⊥ The density of photons passing near x and traveling in directions near ω

slide-29
SLIDE 29

Bidirectional Reflection Distribution Function

𝑐 Ԧ 𝑢 𝑜

𝜕𝑗 𝜕𝑝 𝜄𝑗 𝜄𝑝 𝜚𝑗 𝜚𝑝

𝑔(𝜄𝑗, 𝜚𝑗, 𝜄𝑝, 𝜚𝑝) = 𝑔(𝜕𝑗, 𝜕𝑝)

slide-30
SLIDE 30

BRDF Definition

𝑔 𝜕𝑗, 𝜕𝑝 = 𝑒𝑀𝑠 𝜕𝑝 𝑒𝐹𝑗(𝜕𝑗) = 𝑒𝑀𝑠 𝜕𝑝 𝑀𝑗 𝜕𝑗 𝑑𝑝𝑡 𝜄𝑗 𝑒𝜕𝑗

  • utgoing radiance

incoming irradiance

slide-31
SLIDE 31

BRDF Definition

𝑔 𝜕𝑗, 𝜕𝑝 = 𝑒𝑀𝑠 𝜕𝑝 𝑒𝐹𝑗(𝜕𝑗) = 𝑒𝑀𝑠 𝜕𝑝 𝑀𝑗 𝜕𝑗 𝑑𝑝𝑡 𝜄𝑗 𝑒𝜕𝑗

  • utgoing radiance

incoming irradiance

𝒕𝒒𝒇𝒐𝒆𝒋𝒐𝒉 𝒋𝒐𝒅𝒑𝒏𝒇

slide-32
SLIDE 32

Properties of BRDFs

  • Helmholtz reciprocity

– symmetric surface reflectance 𝑔 𝜕𝑗, 𝜕𝑝 = 𝑔(𝜕𝑝, 𝜕𝑗)

  • Positivity

𝑔 𝜕𝑗, 𝜕𝑝 ≥ 0

  • Energy conservation

– Total amount of outgoing energy must be less than or equal to the incoming energy

slide-33
SLIDE 33

http://www.disneyanimation.com/technology/brdf.html

[Image courtesy of Disney.]

from Disney Animation

slide-34
SLIDE 34

Isotropic vs. Anisotropic

  • Isotropic BRDFs are independent of incident azimuth

angle 𝜚

isotropic anisotropic

slide-35
SLIDE 35

BRDF Acquisition

[White et al, JAO 98] [Marschner et al. 1999]

slide-36
SLIDE 36

MERL 100

http://www.merl.com/brdf/

“A Data-Driven Reflectance Model”, Matusik et al., SIG’03

slide-37
SLIDE 37

BRDF Data Fitting

[Ngan et al., 2005]

slide-38
SLIDE 38

Microfacet Model

slide-39
SLIDE 39

Microfacet Model

ℎ = Ԧ 𝑚 + Ԧ 𝑤 Ԧ 𝑚 + Ԧ 𝑤 macrogeometry

slide-40
SLIDE 40

Microfacet Model

ℎ = Ԧ 𝑚 + Ԧ 𝑤 Ԧ 𝑚 + Ԧ 𝑤 macrogeometry

slide-41
SLIDE 41

Microfacet Model

𝜄𝑛 𝜄𝑛 𝑛 Ԧ 𝑚 Ԧ 𝑤 ℎ = Ԧ 𝑚 + Ԧ 𝑤 Ԧ 𝑚 + Ԧ 𝑤 microfacet: ideal mirror macrogeometry

slide-42
SLIDE 42

General Microfacet BRDF

𝑔

𝑠 Ԧ

𝑚, Ԧ 𝑤 = 𝑒𝑗𝑔𝑔𝑣𝑡𝑓 + 𝐸 𝜄ℎ 𝐺 𝜄𝑒 𝐻(𝜄𝑚, 𝜄𝑤) 4 𝑑𝑝𝑡 𝜄𝑚 𝑑𝑝𝑡 𝜄𝑤

Normal Distribution Function (NDF) Fresnel reflectance Geometric Term 𝜄𝑚, 𝜄𝑤: angle between Ԧ 𝑚, Ԧ 𝑤 and normal 𝜄ℎ: angle between normal and ℎ 𝜄𝑒: difference between Ԧ 𝑚 (𝑝𝑠 Ԧ 𝑤) and ℎ

The ratio of micro-surface area visible to the light, viewer

slide-43
SLIDE 43

Fresnel

  • Schlick’s approximation

𝐺

𝑇𝑑ℎ𝑚𝑗𝑑𝑙 = 𝐺 0 + 1 − 𝐺

1 − 𝑑𝑝𝑡 𝜄𝑗 5 – Where F0 =

η2−𝜃1 η2+𝜃1 2

  • a.k.a. reflectance at normal, normal reflectance, etc.

? What if 𝜃2 = 𝜃1

  • 𝐺 should be zero but 𝐺

𝑇𝑑ℎ𝑚𝑗𝑑𝑙 = 1 − 𝑑𝑝𝑡 𝜄𝑗 5 ≠ 0

slide-44
SLIDE 44

NDF (Normal Distribution Function)

  • Half vector ℎ =

Ԧ 𝑚+𝑤 Ԧ 𝑚+𝑤

  • As for perfect mirror microfacets, we can only see

those facets whose normal vector 𝑛 = ℎ

slide-45
SLIDE 45

Photo by Liu Zai Hou

Highlights at Grazing Angles

slide-46
SLIDE 46

Data Fitting of Acquired Data

[Ngan et al., SIG’04]

slide-47
SLIDE 47

Highlights at Grazing Angles

[Ngan et al., SIG’04]

slide-48
SLIDE 48

Data Fitting of Acquired Data (Cont’d)

[Ngan et al., SIG’04]

slide-49
SLIDE 49
  • Measures area density of microsurface with respect

to microsurface normal

𝐸 𝜕 = න

𝜀𝜕 𝜕𝑛 𝑞𝑛 𝑒𝑞𝑛

NDF (Cont’d)

microsurface

slide-50
SLIDE 50
  • Measures area density of microsurface with respect

to microsurface normal

𝐸 𝜕 = න

𝜀𝜕 𝜕𝑛 𝑞𝑛 𝑒𝑞𝑛

NDF (Cont’d)

microsurface

slide-51
SLIDE 51
  • Measures area density of microsurface with respect

to microsurface normal

𝐸 𝜕 = න

𝜀𝜕 𝜕𝑛 𝑞𝑛 𝑒𝑞𝑛

NDF (Cont’d)

microsurface Ω

slide-52
SLIDE 52
  • Measures area density of microsurface with respect

to microsurface normal

𝐸 𝜕 = න

𝜀𝜕 𝜕𝑛 𝑞𝑛 𝑒𝑞𝑛

NDF (Cont’d)

microsurface Ω 𝜕𝑛: ℳ → Ω

slide-53
SLIDE 53

NDF (Cont’d)

𝑛𝑗𝑑𝑠𝑝𝑡𝑣𝑠𝑔𝑏𝑑𝑓 𝑏𝑠𝑓𝑏 = න

𝑒𝑞𝑛 = න

Ω

𝐸 𝜕𝑛 𝑒𝜕𝑛

𝜕𝑕: normal of macrosurface

𝑞𝑠𝑝𝑘𝑓𝑑𝑢𝑓𝑒 𝑛𝑗𝑑𝑠𝑝𝑡𝑣𝑠𝑔𝑏𝑑𝑓 𝑏𝑠𝑓𝑏 = න

Ω

𝜕𝑛 ⋅ 𝜕𝑕 𝐸 𝜕𝑛 𝑒𝜕𝑛

projection

slide-54
SLIDE 54

Masking/Shadowing

masking shadowing

slide-55
SLIDE 55

Conservation of Projected Area

[Heitz ‘14]

cos 𝜄𝑝 = න

Ω

𝐻1 𝜕𝑝, ω𝑛 𝜕𝑝, ω𝑛 𝐸 𝜕𝑛 𝑒𝜕𝑛

masking function

slide-56
SLIDE 56

Conservation of Projected Area

[Heitz ‘14]

cos 𝜄𝑝 = න

Ω

𝐻1 𝜕𝑝, ω𝑛 𝜕𝑝, ω𝑛 𝐸 𝜕𝑛 𝑒𝜕𝑛

masking function

slide-57
SLIDE 57

BRDF Validation

  • What makes it physically-based?
  • 1. Reciprocity: f l, v = f v, l
  • 2. Positivity: f l, v > 0
  • 3. Energy conservation: ׬

Ω 𝑔 𝑚, 𝑤 cos 𝜄𝑗 𝑒𝜕𝑗 ≤ 1

What do we miss?

slide-58
SLIDE 58

Multiple Surface Bounces?

[Heitz, 2015]

slide-59
SLIDE 59

References

  • Physically-based Rendering. SIGGRAPH Course Notes 2011~15.
  • Ngan et al., Experimental Analysis of BRDF Models. Technical Report 2005.
  • Eric Heitz, Understanding the Masking-Shadowing Function. SIG’14.
  • Brent Burley, Physically Based Shading at Disney. SIG’12 Course Note.
  • Steve Marschner, Microfacet models for refection and refraction, Cornell

University, CS 6630, Fall 2015.