Philipp Slusallek & Arsène Pérard-Gayot
Computer Graphics
- Material Models -
Computer Graphics - Material Models - Philipp Slusallek & Arsne - - PowerPoint PPT Presentation
Computer Graphics - Material Models - Philipp Slusallek & Arsne Prard-Gayot Overview Last time Light: radiance & light sources Light transport: rendering equation & formal solutions Today Reflectance
– Light: radiance & light sources – Light transport: rendering equation & formal solutions
– Reflectance properties:
– Shading
– Varying (reflection) properties over object surfaces: texturing
2
3
4
5
6
7
8
9
Ω+
𝑠 𝜕𝑗, 𝑦, 𝜕𝑝 𝑀𝑗 𝑦, 𝜕𝑗 𝑑𝑝𝑡𝜄𝑗𝑒𝜕𝑗
– Ratio of reflected radiance to incident irradiance
𝑠 𝜕𝑗, 𝑦, 𝜕𝑝 = 𝑒𝑀𝑝 𝑦, 𝜕𝑝
10
– for light incident from direction 𝝏𝒋 = 𝜾𝒋, 𝝌𝒋 – observed from direction 𝝏𝒑 = 𝜾𝒑, 𝝌𝒑
– Depends on 2 directions 𝜕𝑗, 𝜕𝑝 and position x (6-D function)
𝑠 𝜕𝑗, 𝑦, 𝜕𝑝 = 𝑒𝑀𝑝 𝑦, 𝜕𝑝
11
– BRDF remains unchanged if incident and reflected directions are interchanged – Due to physical law of time reversal
𝑠 𝜕𝑗, 𝜕𝑝 = 𝑔 𝑠(𝜕𝑝, 𝜕𝑗)
– Reflectivity independent of rotation around surface normal – BRDF has only 3 instead of 4 directional degrees of freedom
𝑠(𝜄𝑗, 𝑦, 𝜄𝑝, 𝜒𝑝 − 𝜒𝑗)
12
– BRDF units
– Range of values: distribution function is positive, can be infinite
– Energy conservation law
Ω+
𝑠 𝜕𝑗, 𝑦, 𝜕𝑝 𝑑𝑝𝑡𝜄𝑝𝑒𝜕𝑝 ≤ 1,
– No subsurface scattering
13
– Reflection only measured at discrete set of angles
14
15
16
ω𝑝 ω𝑝 ω𝑝
– Only depends on azimuth difference to incoming angle
𝑠
𝑠 𝜄𝑗 → 𝜄𝑝, (𝜒𝑗−𝜒𝑝) = 𝑔 𝑠 𝜄𝑗 → 𝜄𝑝, Δ𝜒
17
ω𝑗 ω𝑝 𝑦 Δϕ
– Ratio of reflected radiance to incident irradiance
𝑠 𝜕𝑗 → 𝜕𝑝 = 𝑒𝑀𝑝 𝜕𝑝
18
ω𝑝 ω𝑗
– Dependent on position, and two directions – Reflection at the point of incidence
𝑠 𝑦, 𝜕𝑗 → 𝜕𝑝
19
ω𝑝 ω𝑗 𝑦
– Assumes a homogeneous and flat surface – Only depends on the difference vector to the outgoing point
𝑠 Δ𝑦, 𝜕𝑗 → 𝜕𝑝
20
ω𝑗 ω𝑝 ω𝑝 𝑦𝑝 𝑦𝑗 Δ𝑦
𝑠 (𝑦𝑗, 𝜕𝑗) → (𝑦𝑝, 𝜕𝑝)
21
ω𝑝 𝑦𝑝 𝑦𝑗 ω𝑗
– Add wavelength dependence
𝑠 𝜇, (𝑦𝑗, 𝜕𝑗) → (𝑦𝑝, 𝜕𝑝)
22
ω𝑝 𝑦𝑝 𝑦𝑗 ω𝑗
– Add wavelength dependence – Add fluorescence
𝑠
23
ω𝑝 𝑦𝑝 𝑦𝑗 ω𝑗
– Add wavelength dependence – Add fluorescence (change to longer wavelength for reflection) – Time varying surface characteristics
𝑠 𝑢, 𝑦𝑗, 𝜕𝑗, 𝜇𝑗 → 𝑦𝑝, 𝜕𝑝, 𝜇𝑝
24
ω𝑝 𝑦𝑝 𝑦𝑗 ω𝑗
– Add wavelength dependence – Add fluorescence (change to longer wavelength for reflection) – Time varying surface characteristics – Phosphorescence
𝑠
25
ω𝑝 𝑦𝑝 𝑦𝑗 ω𝑗
– Illumination angle – Viewing angle – Wavelength – (Polarization, ...)
– Absorption – Surface micro-geometry – Index of refraction / dielectric constant – Scattering
26
Magnesium; λ=0.5μm Aluminum; λ=0.5μm Aluminum; λ=2.0μm
– Point light source position (𝜄𝑗, 𝜒𝑗) – Light detector position (𝜄𝑝, 𝜒𝑝)
– m incident direction samples – n outgoing direction samples – m*n reflectance values (large!!!)
27 Stanford light gantry
– Complex illumination: integrating light distribution against BRDF – Sampled computation: superimposing many point light sources
– Look-up of BRDF values during rendering – Sampled BRDF must be filtered
– Fitting of parameterized BRDF models to measured data
– Most appropriate: Spherical harmonics
– Mathematically elegant filtering, illumination-BRDF integration
28
Spherical Harmonics Red is positive, green negative [Wikipedia]
– Description of visual surface appearance – Composition of different terms:
– Lambert’s law, interactions within material – Matte surfaces
– Reflection law, reflection on a planar surface – Mirror
– Directional diffuse, reflection on surface that is somewhat rough – Shiny surface – Glossy highlights
29
– 𝑂: Surface normal – 𝐽: Light source direction vector – 𝑊: Viewpoint direction vector – 𝑆(𝐽): Reflection vector
– 𝐼: Halfway vector
30
𝑺(𝑱) 𝑺(𝑾) 𝑰 𝑾 𝑱 𝑶 −𝑱 −𝑱 (𝑱 ⋅ 𝑶)𝑶 𝟑(𝑱 ⋅ 𝑶)𝑶 𝑶 𝑺(𝑱) 𝑱 𝑶 𝑺(𝑱) 𝑾 𝑰 𝑺(𝑾)
Top view
31
𝜄𝑗 𝑂 cos 𝜄 𝑺 I 𝜄𝑗 = 𝜄𝑝 𝜒𝑝 = 𝜒𝑗 + 180° 𝜒𝑝 𝜒𝑗
−𝑱
𝜄𝑝
– 𝜺 𝒚 : zero everywhere except at 𝑦 = 0 – Unit integral iff domain contains 𝑦 = 0 (else zero)
𝑠,𝑛 𝜕𝑗, 𝑦, 𝜕𝑝 = 𝜍𝑡 𝜄𝑗
Ω+
𝑠,𝑛 𝜕𝑗, 𝑦, 𝜕𝑝 𝑀𝑗 𝑦, 𝜕𝑗 𝑑𝑝𝑡𝜄𝑗𝑒𝜕𝑗 =
– Ratio of reflected radiance in specular direction and incoming radiance – Dimensionless quantity between 0 and 1
32 L N R
o i
– If then – Which is impossible since sin( b) ≤1 total internal reflection
33
A B C n a (= n i) n b (= n t)
(assuming Cy = 0)
– kd: diffuse coefficient, material property [1/sr]
– Lr,d = kd Li cosi = kd Li (I•N)
34
N I Lo= const
𝑠,𝑒 𝜕𝑗, 𝑦, 𝜕𝑝
𝑀𝑝 𝑦, 𝜕𝑝 = 𝑙𝑒
Ω+ 𝑀𝑗 𝑦, 𝜕𝑗 cos 𝜄𝑗 𝑒𝜕𝑗 = 𝑙𝑒𝐹
i N I
Lr,d
35
𝛸0 ∝ 𝑀0 ⋅ Ω
Self-luminous spherical Lambertian light source
𝛸1 ∝ 𝑀i ⋅ cos θ ⋅ Ω
Eye-light illuminated spherical Lambertian reflector
36
longer from the Sun’s rim
viewing angle The Sun The Moon
– Multiple scattering with in the material (at very short range)
– Pressed magnesium oxide powder
– Almost never valid at grazing angles of incidence – Paint manufacturers attempt to create ideal diffuse paints
37
38
– Phong – Blinn-Phong
– Blinn – Cook & Torrance
39
– Lr,s = Li ks coske ɵRV
– Not energy conserving/reciprocal – Plastic-like appearance
– Still widely used in CG
40
I N R(I) V H
(RV) (HN)
R(I) R(V) H V I N
𝑠 𝜕𝑗, 𝑦, 𝜕𝑝
41
𝑠 𝜕𝑗, 𝑦, 𝜕𝑝
– Lr,s = Li ks coske ɵHN
– ɵRV → ɵHN – Special case: Light source, viewer far away
42
I N R(I) V H
(RV) (HN)
R(I) R(V) H V I N
𝑠 𝜕𝑗, 𝑦, 𝜕𝑝
– Global illumination is costly to compute – Indirect illumination (through interreflections) is typically smooth Approximate via a constant term 𝑀𝑗,𝑏 (incoming ambient illum) – Has no incoming direction, provide ambient reflection term 𝑙𝑏
43
Direct (with shadows) Global (with all interreflecions) Local (without shadows)
– Diffuse reflection (contribution only depends on incoming cosine) – Ambient and Glossy reflection (Phong or Blinn-Phong)
– Often separate specular and diffuse color (common extension, OGL)
– Contradicts physics – Purely local illumination
44
𝑚
𝑚
𝑚
𝑚
– Isotropic microfacet collection – Microfacets assumed as perfectly smooth reflectors
– Distribution of microfacets
– Planar reflection properties – Self-masking, shadowing
45
– σ standard deviation (RMS) of surface slope – Simple expansion to anisotropic model (σx, σy) – Empirical, not physics-based
– Convincing results – Good match to measured data
46
𝑠 = 𝜍𝑒
N I V
viewer
H
𝜄
microfacet
surface
– Is based on the microfacet model – BRDF is defined as the sum of a diffuse and a specular component: where ρs and ρd are the specular and diffuse coefficients. – Derivation of the specular component κs is based on a physically derived theoretical reflectance model
47
𝑠 = 𝜆𝑒𝜍𝑒 + 𝜆𝑡𝜍𝑡;
– represents self-masking and shadowing effects of microfacets
– computed by Fresnel equation – Fraction of specularly reflected light for each planar microfacet
48
N I V
viewer
H
𝜄
microfacet
surface
𝜇𝐸𝐻
– Index of refraction – Absorption coefficient – Both wavelength dependent
– i, t: Angle between ray & plane, incident & transmitted
49
– They do not conduct electricity
– Refr. index: speed of light in vacuum vs. medium – Refractive index in incident medium i = c0 / ci – Refractive index in transmitted medium t = c0 / ct
50
– α : angle to average normal of surface – m : average slope of the microfacets
ln 2 ln cos 𝑛 𝛽
𝑛 2
– Gaussian
1 𝜌𝑛2cos4𝛽 𝑓−(tan 𝛽
𝑛 )2
– Used by Cook-Torrance
51
52
m=0.2 m=0.6
53
𝐻 = min 1, ) 2( 𝑂 ⋅ 𝐼)( 𝑂 ⋅ 𝑊 𝑊 ⋅ 𝐼 , ) 2( 𝑂 ⋅ 𝐼)( 𝑂 ⋅ 𝐽 𝑊 ⋅ 𝐼 𝐻 = ) 2( 𝑂 ⋅ 𝐼)( 𝑂 ⋅ 𝑊 𝑊 ⋅ 𝐼 𝐻 = ) 2( 𝑂 ⋅ 𝐼)( 𝑂 ⋅ 𝐽 𝑊 ⋅ 𝐼 𝐻 = 1
54
Phong: Torrance:
55
56
– Fixed color per polygon/triangle
– Single per-surface normal – Single color per polygon – Evaluated at one of the vertices ( OGL) or at center
57
– Per-vertex normal
– Linear interpolation of the shaded colors
– Often results in shading artifacts along edges
reflection)
– Barycentric interpolation within triangle
58 [wikipedia]
𝑑 𝑏 𝑐 𝑞 𝑀𝑦~𝑔
𝑠 ω𝑝, 𝑜𝑦, ω𝑗 𝑀𝑗 cos 𝜄𝑗
𝑀𝑞 = λ1𝑀𝑏 + λ2𝑀𝑐 + λ3𝑀𝑑
– Linear interpolation of the surface normal – Shading is evaluated at every point separately – Smoother but still off due to hit point offset from apparent surface – Barycentric interpolation within triangle
59 [wikipedia]
𝑑 𝑏 𝑐 𝑞 𝑜𝑞 = λ1𝑜1 + λ2𝑜2 + λ3𝑜3 ∥ λ1𝑜1 + λ2𝑜2 + λ3𝑜3 ∥ 𝑀𝑞~𝑔
𝑠 ω𝑝, 𝑜𝑞, ω𝑗 𝑀𝑗 cos 𝜄𝑗
– Polygonal silhouette may not match the smooth shading – Perspective distortion
– Orientation dependence
– Shading discontinuities at shared vertices (T-edges) – Unrepresentative normal vectors
60
P P
T-edges Vertex normals are all parallel Shading at P is interpolated along different scan-lines when polygon rotates.
– Rasterization (OpenGL):
– Ray tracing
61
– Replacing it with some point light sources
62