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 accurately.
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
What Is Light? Video: What Is Light? by Kurzgesagt
Video: What Is Light? by Kurzgesagt
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!!
Light Matter Interaction specular diffuse diffuse scattering particles
Snell’s Law Photo by Gabriel Gurrola
Snell’s Law 𝑡𝑗𝑜 𝜄 𝑗 𝜃 𝑗 = 𝑡𝑗𝑜 𝜄 𝑢 𝜃 𝑢 𝜄 𝑗 𝜄 𝑗 𝜃 𝑗 Index of Refraction (IOR): 𝜃 𝜃 𝑢 𝜄 𝑢 https://en.wikipedia.org/wiki/Snell%27s_law#/media/File:Snells_law_wavefronts.gif
Snell’s Law 𝑡𝑗𝑜 𝜄 𝑗 𝜃 𝑗 = 𝑡𝑗𝑜 𝜄 𝑢 𝜃 𝑢 𝜄 𝑗 𝜄 𝑗 𝜃 𝑗 Index of Refraction (IOR): 𝜃 𝜃 𝑢 𝜄 𝑢 https://en.wikipedia.org/wiki/Snell%27s_law#/media/File:Snells_law_wavefronts.gif
Fresnel Effect reflection refraction Photo by Ales Krivec
Fresnel Effect more and more reflective as the angle of view approaches a grazing angle F0 reflectance at normal Photo by Ashes Sitoula
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
Material Properties Non-metal (dielectrics) Metal • Only reflect 4~10% of • IOR strongly depends on the incoming light in average wavelength • The reflection intensity is • Immediately absorbs independent on the refracted lights (i.e. no wavelength refraction) • No energy is absorbed – The reflected lights would during reflection change their color – but might be absorbed during subsurface scattering
Fresnel Reflectance [ Real-time Rendering , 3/e, A K Peters 2008]
Fresnel Reflectance [ Real-time Rendering , 3/e, A K Peters 2008]
Fresnel Reflectance [ Real-time Rendering , 3/e, A K Peters 2008]
Fresnel Reflectance [ Real-time Rendering , 3/e, A K Peters 2008]
Reflection goes to 100% at grazing angle! Fresnel Reflectance [ Real-time Rendering , 3/e, A K Peters 2008]
Fresnel for unpolarized light F r = 1 2 + 𝑠 2 2 𝑠 ∥ ⊥ Dielectric r ∥ = η t cos 𝜄 𝑗 − 𝜃 𝑗 cos 𝜄 𝑢 𝜄 𝑗 𝜄 𝑗 η t cos 𝜄 𝑗 + 𝜃 𝑗 cos 𝜄 𝑢 r ⊥ = η i cos 𝜄 𝑗 − 𝜃 𝑢 cos 𝜄 𝑢 𝜃 𝑗 η i cos 𝜄 𝑗 + 𝜃 𝑢 cos 𝜄 𝑢 𝜃 𝑢 Conductor 𝜄 𝑢 2 = η 2 + k 2 cos 2 θ 𝑗 − 2η cos 𝜄 𝑗 + 1 r ∥ η 2 + k 2 cos 2 θ 𝑗 + 2η cos 𝜄 𝑗 + 1 2 = η 2 + k 2 − 2η cos 𝜄 𝑗 + cos 2 𝜄 𝑗 r ⊥ η 2 + k 2 + 2η cos 𝜄 𝑗 + cos 2 𝜄 𝑗
Radiometry the total amount 𝛸 measured at inner and outer sphere is the same (equals to the radiant flux of the point light) dQ Radiant flux Φ = dt (J/sec) The total amount of energy passing through a region of surface per unit time Φ 𝑒𝛸 Irradiance 𝐹 = 𝐹 = 4𝜌𝑠 2 𝑒𝐵 r Pre area incoming flux at a surface Radiant Exitance or Radiosity 𝑁 = 𝐶 = 𝑒𝛸 𝑒𝐵
Lambert’s Cosine Law 𝑒𝐵 𝑒𝐵 𝑒𝐵 = 𝑒𝐵′ cos 𝜄 𝜄 𝐹 = 𝑒𝛸 𝑒𝐵 𝐹 1 = 𝑒𝛸 𝐹 2 = 𝑒𝛸 𝑒𝐵′ = cos 𝜄 𝑒𝛸 = 𝐹 1 cos 𝜄 𝑒𝐵 𝑒𝐵
Solidangle Ω = A r 2 – The total area on a unit sphere subtended by the object – A set of directions – Measured in steradians (sr) – Often denoted as 𝜕
Radiance 𝑒𝜕 flux 𝑒 2 𝛸 𝑒 2 𝛸 𝑀 = 𝑒𝜕𝑒𝐵 ⊥ = 𝑒𝜕𝑒𝐵 𝑑𝑝𝑡 𝜄 𝑒𝐵 ⊥ 𝑒𝐵 solidangle projected area The density of photons passing near x and traveling in directions near ω
B idirectional 𝑔(𝜄 𝑗 , 𝜚 𝑗 , 𝜄 𝑝 , 𝜚 𝑝 ) = 𝑔(𝜕 𝑗 , 𝜕 𝑝 ) R eflection D istribution 𝑜 𝜕 𝑝 𝜕 𝑗 𝜄 𝑝 𝜄 𝑗 F unction 𝑐 𝜚 𝑝 𝜚 𝑗 Ԧ 𝑢
BRDF Definition outgoing radiance 𝑔 𝜕 𝑗 , 𝜕 𝑝 = 𝑒𝑀 𝑠 𝜕 𝑝 𝑒𝑀 𝑠 𝜕 𝑝 𝑒𝐹 𝑗 (𝜕 𝑗 ) = 𝑀 𝑗 𝜕 𝑗 𝑑𝑝𝑡 𝜄 𝑗 𝑒𝜕 𝑗 incoming irradiance
𝒕𝒒𝒇𝒐𝒆𝒋𝒐𝒉 BRDF Definition 𝒋𝒐𝒅𝒑𝒏𝒇 outgoing radiance 𝑔 𝜕 𝑗 , 𝜕 𝑝 = 𝑒𝑀 𝑠 𝜕 𝑝 𝑒𝑀 𝑠 𝜕 𝑝 𝑒𝐹 𝑗 (𝜕 𝑗 ) = 𝑀 𝑗 𝜕 𝑗 𝑑𝑝𝑡 𝜄 𝑗 𝑒𝜕 𝑗 incoming irradiance
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
from Disney Animation http://www.disneyanimation.com/technology/brdf.html [ Image courtesy of Disney. ]
Isotropic vs. Anisotropic • Isotropic BRDFs are independent of incident azimuth angle 𝜚 isotropic anisotropic
BRDF Acquisition [Marschner et al. 1999] [White et al, JAO 98]
MERL 100 http://www.merl.com/brdf/ “A Data - Driven Reflectance Model”, Matusik et al., SIG’03
BRDF Data Fitting [Ngan et al., 2005]
Microfacet Model
Microfacet Model Ԧ 𝑚 + Ԧ 𝑤 macrogeometry ℎ = Ԧ 𝑚 + Ԧ 𝑤
Microfacet Model Ԧ 𝑚 + Ԧ 𝑤 macrogeometry ℎ = Ԧ 𝑚 + Ԧ 𝑤
microfacet: ideal mirror Microfacet Model 𝑛 𝑤 Ԧ 𝜄 𝑛 Ԧ 𝜄 𝑛 𝑚 Ԧ 𝑚 + Ԧ 𝑤 macrogeometry ℎ = Ԧ 𝑚 + Ԧ 𝑤
General Microfacet BRDF Normal Distribution Function (NDF) Geometric Term Fresnel reflectance 𝑤 = 𝑒𝑗𝑔𝑔𝑣𝑡𝑓 + 𝐸 𝜄 ℎ 𝐺 𝜄 𝑒 𝐻(𝜄 𝑚 , 𝜄 𝑤 ) 𝑠 Ԧ 𝑔 𝑚, Ԧ 4 𝑑𝑝𝑡 𝜄 𝑚 𝑑𝑝𝑡 𝜄 𝑤 The ratio of micro-surface area visible to the light, viewer 𝜄 𝑚 , 𝜄 𝑤 : angle between Ԧ 𝑤 and normal 𝑚, Ԧ 𝜄 ℎ : angle between normal and ℎ 𝜄 𝑒 : difference between Ԧ 𝑤) and ℎ 𝑚 (𝑝𝑠 Ԧ
Fresnel • Schlick’s approximation 1 − 𝑑𝑝𝑡 𝜄 𝑗 5 𝐺 𝑇𝑑ℎ𝑚𝑗𝑑𝑙 = 𝐺 0 + 1 − 𝐺 0 2 η 2 −𝜃 1 – Where F 0 = η 2 +𝜃 1 • a.k.a. reflectance at normal, normal reflectance, etc. ? What if 𝜃 2 = 𝜃 1 𝑇𝑑ℎ𝑚𝑗𝑑𝑙 = 1 − 𝑑𝑝𝑡 𝜄 𝑗 5 ≠ 0 • 𝐺 should be zero but 𝐺
NDF (Normal Distribution Function) Ԧ 𝑚+𝑤 • Half vector ℎ = Ԧ 𝑚+𝑤 • As for perfect mirror microfacets, we can only see those facets whose normal vector 𝑛 = ℎ
Highlights at Grazing Angles Photo by Liu Zai Hou
Data Fitting of Acquired Data [Ngan et al. , SIG’04]
Highlights at Grazing Angles [Ngan et al. , SIG’04]
Data Fitting of Acquired Data (Cont’d) [Ngan et al. , SIG’04]
NDF (Cont’d) • Measures area density of microsurface with respect to microsurface normal 𝐸 𝜕 = න 𝜀 𝜕 𝜕 𝑛 𝑞 𝑛 𝑒𝑞 𝑛 ℳ microsurface
NDF (Cont’d) • Measures area density of microsurface with respect to microsurface normal 𝐸 𝜕 = න 𝜀 𝜕 𝜕 𝑛 𝑞 𝑛 𝑒𝑞 𝑛 ℳ microsurface
NDF (Cont’d) • Measures area density of microsurface with respect to microsurface normal Ω 𝐸 𝜕 = න 𝜀 𝜕 𝜕 𝑛 𝑞 𝑛 𝑒𝑞 𝑛 ℳ microsurface
NDF (Cont’d) • Measures area density of microsurface with respect to microsurface normal Ω 𝐸 𝜕 = න 𝜀 𝜕 𝜕 𝑛 𝑞 𝑛 𝑒𝑞 𝑛 ℳ 𝜕 𝑛 : ℳ → Ω microsurface
NDF (Cont’d) 𝑛𝑗𝑑𝑠𝑝𝑡𝑣𝑠𝑔𝑏𝑑𝑓 𝑏𝑠𝑓𝑏 = න 𝑒𝑞 𝑛 = න 𝐸 𝜕 𝑛 𝑒𝜕 𝑛 ℳ Ω 𝑞𝑠𝑝𝑘𝑓𝑑𝑢𝑓𝑒 𝑛𝑗𝑑𝑠𝑝𝑡𝑣𝑠𝑔𝑏𝑑𝑓 𝑏𝑠𝑓𝑏 = න 𝜕 𝑛 ⋅ 𝜕 𝐸 𝜕 𝑛 𝑒𝜕 𝑛 Ω projection 𝜕 : normal of macrosurface
Masking/Shadowing masking shadowing
Conservation of Projected Area [Heitz ‘14] cos 𝜄 𝑝 = න 𝐻 1 𝜕 𝑝 , ω 𝑛 𝜕 𝑝 , ω 𝑛 𝐸 𝜕 𝑛 𝑒𝜕 𝑛 Ω masking function
Conservation of Projected Area [Heitz ‘14] cos 𝜄 𝑝 = න 𝐻 1 𝜕 𝑝 , ω 𝑛 𝜕 𝑝 , ω 𝑛 𝐸 𝜕 𝑛 𝑒𝜕 𝑛 Ω masking function
BRDF Validation • What makes it physically-based? 1. Reciprocity: f l, v = f v, l 2. Positivity: f l, v > 0 Ω 𝑔 𝑚, 𝑤 cos 𝜄 𝑗 𝑒𝜕 𝑗 ≤ 1 3. Energy conservation: What do we miss?
Multiple Surface Bounces? [Heitz, 2015]
Recommend
More recommend