ITM-4B A0661106
Realtime Rendering CH9
PhysicallyBasedShading
Let the form of an object be what it may,


—light, shade, and perspective


will always make it beautiful.
— John Constable
Realtime Rendering CH9
Light
Shading Process
Shading Model
Material
Blending
1
2
3
4
5
PhysicallyBasedShading
PhysicallyBasedShading
Light
1
2
3
4
5
Light
l
PhysicallyBasedShading
Light
1
2
3
4
5
Light
l
Light
t
Monochromatic Polychromatic
Light
1
2
3
4
5
Light
l
Light
t
Monochromatic Polychromatic
PhysicallyBasedShading
PhysicallyBasedShading
Light
1
2
3
4
5
Light
t
Polychromatic
PhysicallyBasedShading
Light
1
2
3
4
5 Light
Monochromatic
PhysicallyBasedShading
Light
1
2
3
4
5
Light
t
Polychromatic
Light
Monochromatic
l
Light
Unpolarized
PhysicallyBasedShading
Light
1
2
3
4
5
t
Linearly Polarized
l
?
Light
Polarized
Light
1
2
3
4
5
Light


is modeled as an


Electromagnetic Transverse Wave
K
E
B
PhysicallyBasedShading
K
PhysicallyBasedShading
Light
1
2
3
4
5
λ
Wavelength
λ
Electric Field
Magnetic Field
E
B
Magnetic Vector
B
Electric Vector
E
Energy Transfer Direction
Light


is modeled as an


Electromagnetic Transverse Wave
K
PhysicallyBasedShading
Light
1
2
3
4
5
λ
Wavelength
λ
Electric Field
Magnetic Field
E
B
Electric Vector
E
Magnetic Vector
B
Energy Transfer Direction


Light waves carry Energy
PhysicallyBasedShading
Light
1
2
3
4
5
E


Light waves carry Energy
PhysicallyBasedShading
Light
1
2
3
4
5
Light waves carry Energy
Frequency
Wavelength
Light Speed
Period
Angular


Frequency
Wavenumber
Refractive Index
PhysicallyBasedShading
Light
1
2
3
4
5
Light waves carry Energy
Frequency
Wavelength
Light Speed
Period
Angular


Frequency
Wavenumber
Refractive Index
Wave Impedance
Irradiance
Time
Spatial Position
Linearly Polarized
Light
Unpolarized
PhysicallyBasedShading
Light
1
2
3
4
5
tl
!
Light
Polarized
PhysicallyBasedShading
Light
1
2
3
4
5
Polarization
t
Light
Polarized
PhysicallyBasedShading
Light
1
2
3
4
5
Polarization
Light
Unpolarized
tl
Light
Polarized
PhysicallyBasedShading
Light
1
2
3
4
5
Polarization
Light
Unpolarized
tl
Light
Polarized
PhysicallyBasedShading
Light
1
2
3
4
5
Linearly Combined
PhysicallyBasedShading
Light
1
2
3
4
5
a
n
Constructive Interference Destructive Interference Incoherent Addition
Linearly Combined
PhysicallyBasedShading
Light
1
2
3
4
5
Linearly Combined
PhysicallyBasedShading
Light
1
2
3
4
5
Linearly Combined
Particles
PhysicallyBasedShading
Light
1
2
3
4
5
a
n
Particles
PhysicallyBasedShading
Light
1
2
3
4
5
Medias
PhysicallyBasedShading
Light
1
2
3
4
5
Increasing
Absorption
Increasing Scattering
Surfaces
PhysicallyBasedShading
Light
1
2
3
4
5
Surface
A
Surface
B
λa
λb
na
nb
Reflection
R
e
f
r
a
c
t
i
o
n
θa
θb
θa
λa
θb
Surfaces
PhysicallyBasedShading
Light
1
2
3
4
5
λa
=
λb
na
nb
=
na
nb
θa
sin( ) sin( )
Surface
A
Surface
B
λa
λb
na
nb
Reflection
R
e
f
r
a
c
t
i
o
n
θa
θb
θa
λa
Surfaces
PhysicallyBasedShading
Light
1
2
3
4
5
Surface Scattering
PhysicallyBasedShading
Light
1
2
3
4
5
Reflection
Surface A
Surface B
R
e
f
r
a
c
t
i
o
n
Surface Scattering
PhysicallyBasedShading
Light
1
2
3
4
5
Reflection
Surface A
Surface B
R
e
f
r
a
c
t
i
o
n
Reflections
Surface A
Surface B
Refractions
Surface A
Surface B
Surface Scattering
PhysicallyBasedShading
Light
1
2
3
4
5
Reflections
Refractions
Surface A
Surface B
Subsurface Scattering
PhysicallyBasedShading
Light
1
2
3
4
5
Reflections
Refractions
Surface A
Surface B
PhysicallyBasedShading
Light
1
2
3
4
5
Diffuse
Specular
Subsurface Scattering
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
Pinhole Camera
Radiance
View Ray
Camera Position
BRDF
Re
f
lectance
Bidirectional
Function
Distribution
Re
f
lectance
Bidirectional
Function
Distribution
Shading
Process
1
2
3
4
5
PhysicallyBasedShading
Re
f
lectance
Bidirectional
Function
Distribution
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
BRDF
Re
f
lectance
Bidirectional
Function
Distribution
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
BRDF
Diffuse Mirror
Glossy
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
BRDF
l
View Ray Vector
v
Light Vector
l
Camera
C
Radiance
View Ray
Camera Position
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
BRDF
l
View Ray Vector
v
Light Vector
l
Camera
C
Radiance
View Ray
Camera Position Radiance
Intersection Point
p
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
Radiance
View Ray
Camera Position Radiance
Intersection Point
BRDF
l
View Ray Vector
v
Light Vector
l
Camera
C
p
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
BRDF
l
View Ray Vector
v
Camera
C
Light Vector
l
Surface Normal
n
Incident


Light
Reflected


Light Irradiance
Radiance
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
BRDF
l
View Ray Vector
v
Camera
C
Light Vector
l
Surface Normal
n
Incident


Light
Reflected


Light Irradiance
Radiance
I
:
Prevent case which under the surface
II
:
Helmholtz Reciprocity
III
:
Conservation of Energy
Incident


Light
Reflected


Light Irradiance
Radiance
l
Light Vector
l
Camera
C
p
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
BRDF
l
View Ray Vector
v
Camera
C
Light Vector
l
Surface Normal
n
Radiance
View Ray
Camera Position Radiance
Intersection Point
Incident


Light
Reflected


Light Irradiance
Radiance
l
Light Vector
l
Camera
C
p
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
BRDF
l
View Ray Vector
v
Camera
C
Light Vector
l
Surface Normal
n
Radiance
View Ray
Camera Position Radiance
Intersection Point
Reflectance Equation
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
BRDF
l
View Ray Vector
v
Camera
C
Light Vector
l
Surface Normal
n
Radiance
Intersection Point
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
BRDF
View Ray Vector
v
Light Vector
l
Surface Normal
n
Tangent Normal
t
Radiance
Intersection Point
Input Radiance
i
Output Radiance
o
Output Vector
o
Input Vector
i
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
BRDF
Surface Normal
n
Tangent Normal
t
Radiance
Intersection Point
Input Radiance
i
Output Radiance
o
Output Vector
o
Input Vector
i
θi
θo
ϕo
ϕi
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
BRDF
Surface Normal
n
Tangent Normal
t
Radiance
Intersection Point
Input Radiance
i
Output Radiance
o
Output Vector
o
ϕi
ϕo
Input Vector
i
θi
θo
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
BRDF
Surface Normal
n
Tangent Normal
t
Radiance
Intersection Point
Input Radiance
i
Output Radiance
o
Output Vector
o
ϕi
ϕo
Input Vector
i
θi
θo
BRDF
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
Directional-Hemispherical Re
f
lectance
Tangent Normal
t
Input Radiance
i
Output Radiance
o
Output Vector
o
ϕi
ϕo
Input Vector
i
θi
θo
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
l
View Ray Vector
v
Camera
C
Light Vector
l
Surface Normal
n
Radiance
Intersection Point
Directional-Hemispherical Re
f
lectance
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
l
View Ray Vector
v
Camera
C
Light Vector
l
Surface Normal
n
Directional-Hemispherical Re
f
lectance
Reflectance Equation
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
Directional-Hemispherical Re
f
lectance
Hemispherical-Directional Re
f
lectance
View Ray
Entire Hemisphere
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
Hemispherical-Directional Re
f
lectance
Entire Hemisphere
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
Lambertian BRDF
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
Lambertian BRDF
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
Lambertian BRDF
Subsurface Albedo
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
Lambertian BRDF
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
Lambertian BRDF
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
BRDF
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
Illumination
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
Illumination
Light Vector Light Color
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
Illumination
Light Vector Light Color
Prevent Negative
PhysicallyBasedShading
Shading
Process
1
2
3
4
5
Illumination
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Fresnel Re
f
lectance
Surface A
Surface B
Surface Normal
n
Light Normal
l
n ∙ l
l′

ri
2(n ∙ l)n
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Fresnel Re
f
lectance
Surface A
Surface B
Surface Normal
n
Light Normal
l
n ∙ l
l′

ri
2(n ∙ l)n
ri = 2(n ∙ l)n − l
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Fresnel Re
f
lectance
ri = 2(n ∙ l)n − l
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Fresnel Re
f
lectance
Glass
Metal
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Fresnel Re
f
lectance
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Fresnel Re
f
lectance
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Fresnel Re
f
lectance
Recursive Process
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Fresnel Re
f
lectance
Recursive Process
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Fresnel Re
f
lectance
Distinct of Colors
Surface Normal
n
elll
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Fresnel Re
f
lectance
Without Fresnel Reflectance
With Fresnel Reflectance
Comparison
na
Fresnel Re
f
lectance
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
External Reflectance
Surface
A
Surface
B
λa
λb
na
nb
Reflection
R
e
f
r
a
c
t
i
o
n
θi
θb
θr
λa
nb
>
Incident
F(θi)
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
F(θi)
Fresnel Re
f
lectance
External Reflectance
F(0∘
) F(90∘
)
Surface Normal
n
Incident
i
Normal Incidence
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Fresnel Re
f
lectance
External Reflectance
F(θi) F(n, l) ≈ F0 + (1 − F0)(1 − (n ∙ l)+
)5
-
>
Fresnel Re
f
lectance
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Glass Copper Aluminum
External Reflectance
Fresnel Re
f
lectance
75°
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
75° 75°
Glass Copper Aluminum
External Reflectance
θi
sin(θi)
sin(θi)
Fresnel Re
f
lectance
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
75° 75° 75°
sin(θi)
External Reflectance
Foreshortened
Fresnel Re
f
lectance
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
e
View Ray Vector
v
Surface Normal
n1
Surface Normal
n2
θ1
θ2
sin(θ1)
sin(θ2)
Dielectric Materials & Values
Fresnel Re
f
lectance
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
F(0∘
)
Metal Materials & Values
Fresnel Re
f
lectance
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
F(0∘
)
Substance Materials & Values
Fresnel Re
f
lectance
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
F(0∘
)
Fresnel Re
f
lectance
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Water
F0 =
(
n1 − n2
n1 + n2
)
2
Fresnel Re
f
lectance
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Water
F(0∘
)
Dielectric
Substance
Metal
Fresnel Re
f
lectance
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Parameterizing
F(0)
-
>
Specular
Diffuse ρss
-
>
Fresnel Re
f
lectance
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Parameterizing
F(0)
-
>
Specular
Diffuse ρss
-
>
Color Csurf
-
>
Not Matel Matel
1
0
m
Fresnel Re
f
lectance
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Parameterizing
F(0)
-
>
Specular
Diffuse ρss
-
>
Color Csurf
-
>
m
Not Matel Matel
1
0
#000000
Fresnel Re
f
lectance
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Parameterizing
Specular
Diffuse
Color
m
Not Matel Matel
1
0
Dielectric
F(0)
-
>
ρss
-
>
Csurf
-
>
na
Fresnel Re
f
lectance
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
External Reflectance
Surface
A
Surface
B
λa
λb
na
nb
Reflection
R
e
f
r
a
c
t
i
o
n
θi
θb
θr
λa
nb
>
Incident
F(θi)
na
Fresnel Re
f
lectance
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Internal Reflectance
Surface
A
Surface
B
λa
λb
na
nb
R
e
f
l
e
c
t
i
o
n
Refraction
θi
θb
θr
nb
Incident
F(θi)
λa
>
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Fresnel Re
f
lectance
Internal Reflectance
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Fresnel Re
f
lectance
Internal Reflectance
sin(θc) =
n1
n2
=
(
1 − F0
1 + F0 )
2
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Microgeometry
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Microgeometry
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Microgeometry
Shadowed Diffuse
Masking
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Microgeometry
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Microgeometry
Retroreflection
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Microgeometry
Retroreflection
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Microfacet Theory
NDF
NDF
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
Normal Distribution Function
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
NDF
D(m)
Microfacet


Normals
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
NDF
∫m∈Θ
D(m)(n ∙ m)dm
Microfacet


Normals
D(m)
Surface Normal
n
View Ray Vector
v
Surface Normal
n
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
NDF
∫m∈Θ
D(m)(n ∙ m)dm
Microfacet


Normals
D(m) = 1
Surface Normal
n
View Ray Vector
v
Surface Normal
n
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
NDF
∫m∈Θ
D(m)(n ∙ m)dm
Microfacet


Normals
D(m) = v ∙ n
Surface Normal
n
View Ray Vector
v
Surface Normal
n
(n ∙ m)
∫m∈Θ
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
NDF
View Ray Vector
v
Surface Normal
n
Masking


Function
∫m∈Θ
= v ∙ n
Distribution of Visible Normals
(n ∙ m)
D(m)
G1(m, v)
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
NDF
G1(m, v) =
χ+
(m ∙ v)
1 + Λ(v)
χ+
(x) =
{
1, where x > 0,
0, where x ≤ 0.
Positive


Characteristic


Function
Masking


Function
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
micro-BRDF
Lo(l, v) =
∫l∈Ω
fr(l, v)Li(l)(n ∙ l)dl
BRDF
BRDF
fr(l, v) =
∫m∈Ω
fμ(l, v, m)G2(l, v, m)D(m)
(m ∙ l)+
|n ∙ l|
(m ∙ v)+
|n ∙ v|
dm
micro-BRDF Joint


Masking-Shadowing


Function
Masking


Function
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
micro-BRDF
BRDF
fr(l, v) =
∫m∈Ω
fμ(l, v, m)G2(l, v, m)D(m)
(m ∙ l)+
|n ∙ l|
(m ∙ v)+
|n ∙ v|
dm
micro-BRDF Joint


Masking-Shadowing


Function
G2(l, v, m) = G1(v ∙ m)G1(l ∙ m)
PhysicallyBasedShading
Shading
Model
1
2
3
4
5
micro-BRDF
PhysicallyBasedShading
Material
3
4
5
1
2
BRDF Models for Surface Re
f
lection
Light Vector
l
Half Vector
h
View Ray Vector
v
le
αh
αh
micro-BRDF
PhysicallyBasedShading
Material
3
4
5
1
2
fspec(l, v) =
F(h, l)G2(l, v, h)D(h)
4|n ∙ l||n ∙ v|
BRDF Models for Surface Re
f
lection
PhysicallyBasedShading
Material
3
4
5
1
2
BRDF Models
PhysicallyBasedShading
Material
3
4
5
1
2
Isotropic NDF
PhysicallyBasedShading
Material
3
4
5
1
2
Beckmann NDF
D(m) =
χi
(n ∙ m)
πα2
b(n ∙ m)4
exp
(
(n ∙ m)2
− 1
a2
b(n ∙ m)2 )
PhysicallyBasedShading
Blending
4
5
3
1
2

Physically Based Shading - Realtime Rendering CH9