rendering equation
computer graphics • rendering equation © 2009 fabio pellacini • 1 physically-based rendering synthesis algorithms that compute images by simulation the physical behavior of light
computer graphics • rendering equation © 2009 fabio pellacini • 2 physically-based rendering
• advantages – predictive simulation • can be used for architecture, engineering, … – photorealistic • if simulation if correct, images will look real • disadvantages – (really) slow • simulation of physics is computationally very expensive – need accurate geometry, materials and lights • otherwise just a correct solution to the wrong problem
computer graphics • rendering equation © 2009 fabio pellacini • 3 models of light
• geometric optics – light particles travel in straight lines – light particles do not interact with each other – describes: emission, reflection/refraction, absorption [Stam et al., 1996] al., et [Stam
computer graphics • rendering equation © 2009 fabio pellacini • 4 models of light
• wave optics – light particles interact with each other – describes: diffraction, interference, polarization [Gondek et al., 1997] al., et [Gondek
computer graphics • rendering equation © 2009 fabio pellacini • 5 models of light
• quantum optics – light particles are like any other quantum particles – captures: fluorescence, phosphorescence [Glassner et al., 1997] al., et [Glassner
computer graphics • rendering equation © 2009 fabio pellacini • 6 rendering equation
• describe physical behavior of light in vacuum filled with objects – based on geometric optics principles – can be extended to describe participating media – can be extended to describe wavelenght dep.
computer graphics • rendering equation © 2009 fabio pellacini • 7 power and irradiance
• power: energy per unit time – measured in Watts = Joules/sec dQ Φ = dt • irradiance: power per unit area – measured in Watts/meter2 dΦ E = dA
computer graphics • rendering equation © 2009 fabio pellacini • 8 radiance
• power per unit projected area and solid angle – depends on position and direction (5D) d 2Φ d 2Φ dE L(x → Θ) = ⊥ = = dA dωΘ dAcosθΘdωΘ cosθΘdωΘ
cosθΘ = Nx ⋅Θ , Bekaert, Bala] Bala] Bekaert, , é [Dutr
computer graphics • rendering equation © 2009 fabio pellacini • 9 radiance most sensors readings (and your eyes) are proportional to radiance
computer graphics • rendering equation © 2009 fabio pellacini • 10 radiance notation
• notation follows [Dutré, Bekaert, Bala]
• radiance leaving from point x in direction Θ L(x → Θ) • radiance coming to point x from direction Ψ L(x ← Ψ) • solid angle for a direction Ψ
dωΨ • in general L(x → Θ) ≠ L(x ← Θ)
computer graphics • rendering equation © 2009 fabio pellacini • 11 radiance
• radiance is a function of wavelenght
L(x → Θ) = L(x → Θ,λ) ∫λ∈spectrum
• in practice, write equations for RGB – we will use simplified notation without carry around the wavelength explicitly
computer graphics • rendering equation © 2009 fabio pellacini • 12 radiance
• formulation between two points 2 2 2 d Φ d Φ rxy L(x → y) = = dAx cosθ xdωx→y dAxdAy cosθ x cosθ y
dAy cosθ y dωx→y = 2 rxy , Bekaert, Bala] Bala] Bekaert, , é [Dutr
computer graphics • rendering equation © 2009 fabio pellacini • 13 radiance properties
• invariance on straight paths in vacuum – from energy conservation L(x → y) = L(y ← x) • corollary: radiance does not change with distance [Shirley] [Shirley]
computer graphics • rendering equation © 2009 fabio pellacini • 14 material properties
• materials differ in the way they scatter energy – need physical description of light scattering , Bekaert, Bala] Bala] Bekaert, , é [Dutr
computer graphics • rendering equation © 2009 fabio pellacini • 15 BRDF
• bidirectional surface distribution function dL(x → Θ) dL(x → Θ) ρ(x,Ψ → Θ) = = dE(x ← Ψ) L(x ← Ψ)dωΨ cosθΨ , Bekaert, Bala] Bala] Bekaert, , é [Dutr
computer graphics • rendering equation © 2009 fabio pellacini • 16 BRDF properties
• reciprocity ρ(x,Ψ → Θ) = ρ(x,Θ → Ψ)
• energy conservation
∀Ψ : dL(x → Θ)cosθΘdωΘ ≤ dE(x ← Ψ) ⇒ ∫Θ∈Ω(x)
∀Ψ : ρ(x,Ψ → Θ)cosθΘdωΘ ≤1 ∫Θ∈Ω(x)
computer graphics • rendering equation © 2009 fabio pellacini • 17 hemispherical formulation
• need outgoing radiance in a given direction – from BRDF definition dL(x → Θ) ρ(x,Ψ → Θ) = L(x ← Ψ)dωΨ cosθΨ
– determine reflected radiance Lr by integration over all incoming light L (x ) dL(x ) r → Θ = ∫ → Θ =
= L(x ← Ψ)ρ(x,Ψ → Θ)cosθΨdωΨ ∫Ψ∈Ωx
computer graphics • rendering equation © 2009 fabio pellacini • 18 hemispherical formulation
• need outgoing radiance in a given direction – also consider light spontaneously emitted by surface
Le (x → Θ)
– total radiance is the sum of emitted and reflected
L(x → Θ) = Le (x → Θ) + Lr (x → Θ)
L(x → Θ) = Le (x → Θ) +
+ L(x ← Ψ)ρ(x,Ψ → Θ)cos(Nx ,Ψ)dωΨ ∫Ψ∈Ωx
computer graphics • rendering equation © 2009 fabio pellacini • 19 hemispherical formulation
L(x → Θ) = Le (x → Θ) +
+ L(x ← Ψ)ρ(x,Ψ → Θ)cosθΨdωΨ ∫Ψ∈Ωx , Bekaert, Bala] Bala] Bekaert, , é [Dutr
computer graphics • rendering equation © 2009 fabio pellacini • 20 intuition behind rendering equation
L(x → Θ) = Le (x → Θ) +
+ L(x ← Ψ)ρ(x,Ψ → Θ)cosθΨdωΨ ∫Ψ∈Ωx [Bala] [Bala] x x
L(x → Θ) Le (x → Θ) L(x ← Ψ) computer graphics • rendering equation © 2009 fabio pellacini • 21 intuition behind rendering equation
L(x → Θ) = Le (x → Θ) +
+ L(x ← Ψ)ρ(x,Ψ → Θ)cosθΨdωΨ ∫Ψ∈Ωx
integral equation
indicates radiance at equilibrium
computer graphics • rendering equation © 2009 fabio pellacini • 22 visible point formulation
• point visible from x in direction Ψ y = r(x,Ψ) • since energy is conserved in vacuum L(x ← Ψ) = L(y → −Ψ) • by substituting previous values in rendering eq.
L(x → Θ) = Le (x → Θ) +
+ L(r(x,Ψ) → −Ψ)ρ(x,Ψ → Θ)cosθΨdωΨ ∫Ψ∈Ωx
computer graphics • rendering equation © 2009 fabio pellacini • 23 visible point formulation
L(x → Θ) = Le (x → Θ) +
+ L(r(x,Ψ) → −Ψ)ρ(x,Ψ → Θ)cosθΨdωΨ ∫Ψ∈Ωx , Bekaert, Bala] Bala] Bekaert, , é [Dutr computer graphics • rendering equation © 2009 fabio pellacini • 24 area formulation
• compute solid angle visible from x to y
dAy cosθy dωΨ = 2 rxy , Bekaert, Bala] Bala] Bekaert, , é [Dutr computer graphics • rendering equation © 2009 fabio pellacini • 25 area formulation
• by changing domain from hemisphere to scene – and introducing explicit visibility evaluation V
L(x → Θ) = Le (x → Θ) +
cosθΨ cosθΘ + L(y → yx)ρ(x,Ψ → Θ) V (x,y)dAy ∫y∈S 2 rxy
xy N yx N cosθΨ cosθΘ ( ⋅ x )( ⋅ y ) G(x,y) = 2 = 2 rxy | x − y |
computer graphics • rendering equation © 2009 fabio pellacini • 26 area formulation
L(x → Θ) = Le (x → Θ) +
+ L(y → yx)ρ(x,Ψ → Θ)G(x,y)V (x,y)dAy ∫y∈S , Bekaert, Bala] Bala] Bekaert, , é [Dutr computer graphics • rendering equation © 2009 fabio pellacini • 27 transport formulation
∞ L L TL L TL TTL ... T i L = e + ⇒ e + e + e + = ∑ e i=0 , Bekaert, Bala] Bala] Bekaert, , é [Dutr computer graphics • rendering equation © 2009 fabio pellacini • 28 transport formulation
2 3 Le TLe T Le T Le [CornellPCG]
2 3 Le Le +TLe Le +...+T Le Le +...+T Le computer graphics • rendering equation © 2009 fabio pellacini • 29 direct and indirect illum. formulation
• direct illumination: radiance reaching a surface directly from the light – often efficient to sample using area formulation • indirect illumination: radiance reaching a surface after bouncing at least once on another surface – often efficient to sample using hemisphere formulation
computer graphics • rendering equation © 2009 fabio pellacini • 30 direct and indirect illum. formulation
L(x → Θ) = Le (x → Θ) + Lr (x → Θ)
L (x → Θ) = L(x ← Ψ)ρ(...)cosθ dω = r ∫ Ψ Ψ = L (x ← Ψ) + L (x ← Ψ) ρ(...)cosθ dω = ∫( e r ) Ψ Ψ
= Ld (x → Θ) + Li (x → Θ)
computer graphics • rendering equation © 2009 fabio pellacini • 31 direct illumination formulation
Ld (x → Θ) = Le (x ← Ψ)ρ(x,Ψ → Θ)cosθΨdωΨ ∫Ψ∈Ωx rewrite in area formulation
Ld (x → Θ) =
Le (x ← yx)ρ(x,xy → Θ)G(x,y)V (x,y)dAy ∫y∈lights surface
Ld (x → Θ) =
Le (x ← yx)ρ(x,xy → Θ)G(x,y)V (x,y)dAy ∑ y∈light l l ∫ computer graphics • rendering equation © 2009 fabio pellacini • 32 indirect illumination formulation
Ld (x → Θ) = Lr (x ← Ψ)ρ(x,Ψ → Θ)cosθΨdωΨ ∫Ψ∈Ωx
since Lr (x ← Ψ) = Lr (r(x,Ψ) → −Ψ)
Ld (x → Θ) =
Lr (r(x,Ψ) → −Ψ)ρ(x,Ψ → Θ)cosθΨdωΨ ∫Ψ∈Ωx
computer graphics • rendering equation © 2009 fabio pellacini • 33 hemispherical integration
• 2D square
x1 y1 I = f (x)dAX = f (x, y)dxdy ∫x∈S ∫x0 ∫y0 • 2D hemisphere
2π π I = f (Θ)dωΘ = f (ϕ,θ )sinθdϕdθ ∫Θ∈Ω ∫0 ∫0
computer graphics • rendering equation © 2009 fabio pellacini • 34 materials
computer graphics • rendering equation © 2009 fabio pellacini • 35 physically-based materials
• capture realistic appearance is necessary [CornellPCG]
computer graphics • rendering equation © 2009 fabio pellacini • 36 diffuse BRDF
• light is reflected equally in all directions ρ ρ(x,Ψ → Θ) = d π , Bekaert, Bala] Bala] Bekaert, , é [Dutr
computer graphics • rendering equation © 2009 fabio pellacini • 37 diffuse BRDF
• Lambertian shading model motivation dL(x → Θ) = ρ(x,Ψ → Θ)dE(x ← Ψ) = ρ = d cosθ L(x ← Ψ)dω = C k cosθ π Ψ Ψ l d
computer graphics • rendering equation © 2009 fabio pellacini • 38 specular BRDF
• light is reflected only in one direction
ρ(x,Ψ → Θ) ∝δ (Ψ,Θ) , Bekaert, Bala] Bala] Bekaert, , é [Dutr
computer graphics • rendering equation © 2009 fabio pellacini • 39 glossy BRDFs
• light is reflected in many directions unequally – many models exist , Bekaert, Bala] Bala] Bekaert, , é [Dutr
computer graphics • rendering equation © 2009 fabio pellacini • 40 glossy BRDFs – Phong and Blinn models
• Phong model
n n ρ(x,Ψ → Θ) = kd + ks cos θr = kd + ks (R⋅Θ)
• Blinn-Phong model
n ρ(x,Ψ → Θ) = kd + ks (N⋅H)
• issues: – non reciprocal – non energy conserving
computer graphics • rendering equation © 2009 fabio pellacini • 41 glossy BRDFs – modified Blinn-Phong model • modified Blinn-Phong model
ρ n + 2 n ρ(x,Ψ → Θ) = d + ρ (H ⋅Θ) π 2π s
• energy conservation
ρd + ρs ≤1
computer graphics • rendering equation © 2009 fabio pellacini • 42 glossy BRDFs – modified Phong model
• is modified Phong physically accurate?
photograph Phong accurate BRDF [LaFortune et al., 1997] [LaFortuneal., et
computer graphics • rendering equation © 2009 fabio pellacini • 43 glossy BRDFs – modified Phong model
• is modified Phong physically accurate?
Phong
accurate BRDF [LaFortune et al., 1997] [LaFortuneal., et
computer graphics • rendering equation © 2009 fabio pellacini • 44 glossy BRDFs – better models
• analytic model – physically motivated – hard to capture every material
• data-driven – measure light reflectance – encode in lookup table or fit – resample when rendering
computer graphics • rendering equation © 2009 fabio pellacini • 45 extending the rendering equation
computer graphics • rendering equation © 2009 fabio pellacini • 46 participating media [Fedkiw et al.] et [Fedkiw
computer graphics • rendering equation © 2009 fabio pellacini • 47 subsurface scattering [Jensen et al.] et [Jensen
computer graphics • rendering equation © 2009 fabio pellacini • 48 subsurface scattering [Jensen] [Jensen]
computer graphics • rendering equation © 2009 fabio pellacini • 49 subsurface scattering [Jensen et al.] et [Jensen
computer graphics • rendering equation © 2009 fabio pellacini • 50