Philipp Slusallek
Computer Graphics
- Material Models -
Computer Graphics - Material Models - Philipp Slusallek - - PowerPoint PPT Presentation
Computer Graphics - Material Models - Philipp Slusallek REFLECTANCE PROPERTIES 2 Appearance Samples How do materials reflect light? At the same point / in the neighborhood (subsurface scattering) 3 Material Samples Anisotropic
2
– At the same point / in the neighborhood (subsurface scattering)
3
4
5
6
7
– Cause of different reflection properties (often in combination):
Glossy highlights, approx. in direction of reflection
Diffuse reflection, light reflected many times in material, looses directionality
– Macro structure: Described as explicit geometry (e.g. triangles) – Micro structure: Captured in scattering function (BRDF) – Meso structure: Difficult to handle: integrate into BRDF (offline simulation),use geometry and simulate (online)
– Bidirectional reflection distribution function (BRDF)
– More complex scattering functions (e.g. subsurface scattering)
8
Ω+
𝑠 𝜕𝑗, 𝑦,𝜕𝑝 𝑀𝑗 𝑦, 𝜕𝑗 𝑑𝑝𝑡𝜄𝑗𝑒𝜕𝑗
– Ratio of reflected radiance to incident irradiance
𝑠 𝜕𝑗,𝑦, 𝜕𝑝 = 𝑒𝑀𝑝 𝑦, 𝜕𝑝 𝑒𝐹𝑗(𝑦, 𝜕𝑗)
Units: 1
𝑡𝑠
9
– for light incident from direction 𝝏𝒋 = 𝜾𝒋, 𝝌𝒋 – observed from direction 𝝏𝒑 = 𝜾𝒑,𝝌𝒑
– Depends on 2 directions 𝜕𝑗, 𝜕𝑝 and position 𝑦 (a 6-D function)
𝑠 𝜕𝑗, 𝑦, 𝜕𝑝 = 𝑒𝑀𝑝 𝑦,𝜕𝑝
10
– BRDF remains unchanged if incident and reflected directions are interchanged – Due to physical principle of time reversal
𝑠 𝜕𝑗,𝜕𝑝 = 𝑔 𝑠(𝜕𝑝,𝜕𝑗)
– Reflectivity independent of rotation around surface normal – BRDF has only 3 instead of 4 directional degrees of freedom
𝑠(𝑦, 𝜄𝑗, 𝜄𝑝, 𝜒𝑝 − 𝜒𝑗)
11
– BRDF units
– Range of values: distribution function is positive, can be infinite
– Energy conservation law
𝑠 over outgoing directions integrates to less than one
– For any incoming direction
Ω+
𝑠 𝜕𝑗, 𝑦, 𝜕𝑝 𝑑𝑝𝑡𝜄𝑝𝑒𝜕𝑝 ≤ 1,
– Ignoring subsurface scattering (SSS)
12
– Reflection only measured at discrete set of angles in plane of incidence
13
– Given point 𝑦 and given incident direction 𝜕𝑗
– Often consists of some mostly diffuse component (here small)
14
Diffuse hemisphere Glossy cone
– (and possibly location)
15
ω𝑝 ω𝑝 ω𝑝 𝜕𝑗
– Homogeneous and isotropic across surface – Only depends on azimuth difference to incoming angle
𝑠
𝑠 𝜄𝑗 → 𝜄𝑝, (𝜒𝑗−𝜒𝑝) = 𝑔 𝑠 𝜄𝑗 → 𝜄𝑝,Δ𝜒
16
ω𝑗 ω𝑝 𝑦 Δϕ
– Ratio of reflected radiance to incident irradiance – Independent of position
𝑠 𝜕𝑗 → 𝜕𝑝 = 𝑒𝑀𝑝 𝜕𝑝
17
ω𝑝 ω𝑗
– Dependent on position, and two directions – Reflection at the point of incidence
𝑠 𝑦, 𝜕𝑗 → 𝜕𝑝
18
ω𝑝 ω𝑗 𝑦
– Assumes a homogeneous and flat surface – Only depends on the difference vector to the outgoing point
𝑠 Δ𝑦, 𝜕𝑗 → 𝜕𝑝
19
ω𝑗 ω𝑝 ω𝑝 𝑦𝑝 𝑦𝑗 Δ𝑦
𝑠 (𝑦𝑗,𝜕𝑗) → (𝑦𝑝,𝜕𝑝)
20
ω𝑝 𝑦𝑝 𝑦𝑗 ω𝑗
– Add wavelength dependence
𝑠 𝜇, (𝑦𝑗, 𝜕𝑗) → (𝑦𝑝,𝜕𝑝)
21
ω𝑝 𝑦𝑝 𝑦𝑗 ω𝑗
– Add wavelength dependence – Add fluorescence
𝑠
22
ω𝑝 𝑦𝑝 𝑦𝑗 ω𝑗
– Add wavelength dependence – Add fluorescence (change to longer wavelength for reflection) – Time varying surface characteristics
𝑠 𝑢, 𝑦𝑗, 𝜕𝑗, 𝜇𝑗 → 𝑦𝑝,𝜕𝑝, 𝜇𝑝
23
ω𝑝 𝑦𝑝 𝑦𝑗 ω𝑗
– Add wavelength dependence – Add fluorescence (change to longer wavelength for reflection) – Time varying surface characteristics – Phosphorescence
emporal storage of light
𝑠
24
ω𝑝 𝑦𝑝 𝑦𝑗 ω𝑗
– Illumination angle – Viewing angle – Wavelength – (Polarization, ...)
– Absorption – Surface micro-geometry – Index of refraction / dielectric constant – Scattering
25
Magnesium oxide; λ=0.5μm Aluminum; λ=0.5μm Aluminum; λ=2.0μm
Grazing angle rays
– Point light source position (𝜄𝑗, 𝜒𝑗) – Light detector position (𝜄𝑝, 𝜒𝑝)
– m incident direction samples – n outgoing direction samples – m*n reflectance values (large!!!) – Additional position dependent (6D)
26 Stanford light gantry
– Continuous illumin.: integrating light distribution against BRDF – Sampled illumination: 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
– Often: Spherical harmonics (ortho-normal basis on sphere)
– Mathematically elegant filtering, illumination-BRDF integration
27
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 surfaces
– “Directional diffuse”, reflection on surface that is somewhat rough – Shiny surface – Glossy highlights – Sometimes incorrectly called “specular”
28
– 𝑂: Surface normal – 𝐽: Light source direction vector – 𝑊: Viewpoint direction vector – 𝑆(𝐽): Reflection vector
– 𝐼: Halfway vector
29
𝑺(𝑱) 𝑺(𝑾) 𝑰 𝑾 𝑱 𝑶 −𝑱 −𝑱 (𝑱 ⋅ 𝑶)𝑶 𝟑(𝑱 ⋅ 𝑶)𝑶 𝑶 𝑺(𝑱) 𝑱 𝑶 𝑺(𝑱) 𝑾 𝑰 𝑺(𝑾)
Top view
30
𝜄𝑗 𝑂 cos 𝜄 𝑺 I 𝜄𝑗 = 𝜄𝑝 𝜒𝑝 = 𝜒𝑗 + 180° 𝜒𝑝 𝜒𝑗
−𝑱
𝜄𝑝
– 𝜺 𝒚 : zero everywhere except at 𝑦 = 0 – Unit integral iff domain contains 𝑦 = 0 (else zero) 𝑔
𝑠,𝑛 𝜕𝑗,𝑦, 𝜕𝑝 = 𝜍𝑡 𝜄𝑗
𝜀(𝑑𝑝𝑡𝜄𝑗 − 𝑑𝑝𝑡𝜄𝑝) cos 𝜄𝑗 𝜀 𝜒𝑗 − 𝜒𝑝 ± 𝜌 𝑀𝑝 𝑦, 𝜕𝑝 = න
Ω+
𝑔
𝑠,𝑛 𝜕𝑗,𝑦, 𝜕𝑝 𝑀𝑗 𝑦, 𝜕𝑗 𝑑𝑝𝑡𝜄𝑗𝑒𝜕𝑗 =
𝜍𝑡 𝜄𝑝 𝑀𝑗(𝑦, 𝜄𝑝, 𝜒𝑝 ± 𝜌)
– Ratio of reflected radiance in specular direction and incoming radiance – Dimensionless quantity between 0 and 1 𝜍𝑡 𝑦, 𝜄𝑗 = 𝑀𝑝(𝑦, 𝜄𝑝) 𝑀𝑗(𝑦, 𝜄𝑝)
31 L N R
o i
– Multiple scattering within the material (at very short range)
– Pressed magnesium oxide powder (or foam/snow)
– Almost never valid at grazing angles of incidence – Paint manufacturers attempt to create ideal diffuse paints
33 Highly reflective/refractive foam-like materials Highly reflective particles (e.g. magnesium oxide, plaster paper fibers) specular/ mirror glossy diffuse
– 𝜍𝑒: diffuse reflection coefficient, material property [1/sr]
– Lr,d = kd Li cosi = kd Li (I•N)
34
N I Lo= const
𝑔
𝑠,𝑒 𝜕𝑗,𝑦, 𝜕𝑝
= 𝑙𝑒 = 𝑑𝑝𝑜𝑡𝑢 = Τ 𝜍𝑒 𝜌 𝑡𝑠 with ρ𝑠 ∈ [0,1] 𝑀𝑝 𝑦, 𝜕𝑝 = 𝑙𝑒 න
Ω+
𝑀𝑗 𝑦, 𝜕𝑗 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
– Phong – Blinn-Phong
– Blinn – Cook & Torrance
38
– Lr,s = Li ks coske ɵRV
– Not energy conserving/reciprocal – Plastic-like appearance
– Still widely used in CG
39
I N R(I) V H
(RV) (HN)
R(I) R(V) H V I N
𝑠 𝜕𝑗,𝑦, 𝜕𝑝
– Cosine is non-zero between -90 and 90 degrees
40
𝑠 𝜕𝑗,𝑦, 𝜕𝑝
– Lr,s = Li ks coske ɵHN
– ɵRV → ɵHN – Special case: Light source, viewer far away
41
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 𝑙𝑏
42
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
43
glossy
+ + =
– Isotropic microfacet collection – Microfacets assumed as perfectly smooth reflectors
– Distribution of microfacets
– Planar reflection properties – Self-masking, shadowing
44
– σ standard deviation (RMS) of surface slope – Simple expansion to anisotropic model (σx, σy) – Empirical, not physics-based
– Convincing results – Good match to measured data
45
N I V
viewer
H
𝜄
microfacet
surface
– Is based on the microfacet model – BRDF is defined as the sum of a diffuse and a glossy component: where ρg and ρd are the glossy and diffuse coefficients. – Derivation of the glossy component κg is based on a physically derived theoretical reflectance model – (The original paper talks about “specular” instead of “glossy” as the glossy reflection originates from averaging the specular reflections of many microfacets)
46
𝑠 = 𝜆𝑒𝜍𝑒 + 𝜆𝜍;
– represents self-masking and shadowing effects of microfacets
– computed by Fresnel equation – Fraction of specularly reflected light for each planar microfacet
47
N I V
viewer
H
𝜄
microfacet
surface
– Index of refraction – Absorption coefficient – Both wavelength dependent
– i, t: Angle between ray & plane, incident & transmitted
48
– 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
49
– α : angle to average normal of surface – m : average slope of the microfacets
– Gaussian
1 𝜌𝑛2𝑑𝑝𝑡4𝛽 𝑓−(𝑢𝑏𝑜𝛽
𝑛 )2
– Used by Cook-Torrance
50
51
m=0.2 m=0.6
52
𝐻 = min 1, ) 2(ഫ 𝑂 ⋅ ഫ 𝐼)(ഫ 𝑂 ⋅ ഫ 𝑊 ഫ 𝑊 ⋅ ഫ 𝐼 , ) 2(ഫ 𝑂 ⋅ ഫ 𝐼)(ഫ 𝑂 ⋅ Ӊ 𝐽 ഫ 𝑊 ⋅ ഫ 𝐼 𝐻 = ) 2(ഫ 𝑂 ⋅ ഫ 𝐼)(ഫ 𝑂 ⋅ ഫ 𝑊 ഫ 𝑊 ⋅ ഫ 𝐼 𝐻 = ) 2(ഫ 𝑂 ⋅ ഫ 𝐼)(ഫ 𝑂 ⋅ Ӊ 𝐽 ഫ 𝑊 ⋅ ഫ 𝐼 𝐻 = 1
53
Phong: T
54
– Computation of reflected light (radiance) at every pixel – In ray tracing typically computed at every hit point – In rasterization computed per triangle/vertices/pixel
– Position of shaded point – Position of viewpoint – Position of light source and its description/parameters – Surface normal / local coordinate frame at shaded point – Reflectance model (BRDF)
55
– Fixed color per polygon/triangle
– Single per-surface normal – Single color per polygon – Evaluated at one of the vertices (➔ OpenGL) or at center
56
– Per-vertex normal
– Linear interpolation of the shaded colors
– Often results in shading artifacts along edges
reflection)
– Barycentric interpolation within triangle
57 [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
58 [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) – Non-representative normal vectors
59
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
60
– Replacing it with some point light sources
61