Computer Graphics - Material Models - Philipp Slusallek - - PowerPoint PPT Presentation

computer graphics
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Philipp Slusallek

Computer Graphics

  • Material Models -
slide-2
SLIDE 2

REFLECTANCE PROPERTIES

2

slide-3
SLIDE 3

Appearance Samples

  • How do materials reflect light?

– At the same point / in the neighborhood (subsurface scattering)

3

slide-4
SLIDE 4

Material Samples

  • Anisotropic surfaces

4

anisotropic

slide-5
SLIDE 5

Material Samples

  • Complex surface meso-structure

5

slide-6
SLIDE 6

Material Samples

  • Lots of details: Fibers

6

slide-7
SLIDE 7

Material Samples

  • Photos of samples with light source at exactly the

same position

7

diffuse glossy mirror

slide-8
SLIDE 8

How to describe materials?

  • Surface roughness

– Cause of different reflection properties (often in combination):

  • Perfectly smooth: Mirror reflection
  • Slightly rough:

Glossy highlights, approx. in direction of reflection

  • Very rough:

Diffuse reflection, light reflected many times in material, looses directionality

  • Geometry

– 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)

  • Representation of reflection properties

– Bidirectional reflection distribution function (BRDF)

  • For reflections at a single point (approx.)

– More complex scattering functions (e.g. subsurface scattering)

  • Goal: Relightable representation of appearance

8

slide-9
SLIDE 9

Reflection Equation - Reflectance

  • Reflection equation

𝑀𝑝 𝑦, 𝜕𝑝 = න

Ω+

𝑔

𝑠 𝜕𝑗, 𝑦,𝜕𝑝 𝑀𝑗 𝑦, 𝜕𝑗 𝑑𝑝𝑡𝜄𝑗𝑒𝜕𝑗

  • BRDF Definition

– Ratio of reflected radiance to incident irradiance

𝑔

𝑠 𝜕𝑗,𝑦, 𝜕𝑝 = 𝑒𝑀𝑝 𝑦, 𝜕𝑝 𝑒𝐹𝑗(𝑦, 𝜕𝑗)

Units: 1

𝑡𝑠

9

slide-10
SLIDE 10

BRDF

  • BRDF describes surface reflection

– for light incident from direction 𝝏𝒋 = 𝜾𝒋, 𝝌𝒋 – observed from direction 𝝏𝒑 = 𝜾𝒑,𝝌𝒑

  • Bidirectional

– Depends on 2 directions 𝜕𝑗, 𝜕𝑝 and position 𝑦 (a 6-D function)

𝑔

𝑠 𝜕𝑗, 𝑦, 𝜕𝑝 = 𝑒𝑀𝑝 𝑦,𝜕𝑝

𝑒𝐹𝑗(𝑦,𝜕𝑗) = 𝑒𝑀𝑝(𝑦, 𝜕𝑝) 𝑀𝑗 𝑦, 𝜕𝑗 𝑑𝑝𝑡𝜄𝑗𝑒𝜕𝑗

10

slide-11
SLIDE 11

BRDF Properties

  • Helmholtz reciprocity principle

– BRDF remains unchanged if incident and reflected directions are interchanged – Due to physical principle of time reversal

𝑔

𝑠 𝜕𝑗,𝜕𝑝 = 𝑔 𝑠(𝜕𝑝,𝜕𝑗)

  • No surface structure: Isotropic BRDF

– Reflectivity independent of rotation around surface normal – BRDF has only 3 instead of 4 directional degrees of freedom

𝑔

𝑠(𝑦, 𝜄𝑗, 𝜄𝑝, 𝜒𝑝 − 𝜒𝑗)

11

slide-12
SLIDE 12

BRDF Properties

  • Characteristics

– BRDF units

  • Inverse steradian: 𝑡𝑠−1 (not really intuitive)

– Range of values: distribution function is positive, can be infinite

  • From 0 (no reflection in that direction)
  • to ∞ (perfect reflection into exactly one direction, 𝜀-function)

– Energy conservation law

  • Absorption physically unavoidable, no self-emission
  • Integral of 𝑔

𝑠 over outgoing directions integrates to less than one

– For any incoming direction

Ω+

𝑔

𝑠 𝜕𝑗, 𝑦, 𝜕𝑝 𝑑𝑝𝑡𝜄𝑝𝑒𝜕𝑝 ≤ 1,

∀𝜕𝑗

  • Reflection only at the point of entry (𝒚𝒋 = 𝒚𝒑)

– Ignoring subsurface scattering (SSS)

12

slide-13
SLIDE 13

Standardized Gloss Model

  • Industry often uses only a subset of BRDF values

– Reflection only measured at discrete set of angles in plane of incidence

13

slide-14
SLIDE 14
  • BRDF is often shown as a slice of the 6D function

– Given point 𝑦 and given incident direction 𝜕𝑗

  • Show 3D polar plot (intensity as length of vector from origin)

– Often consists of some mostly diffuse component (here small)

  • and a somewhat glossy component (here rather large)

Reflection on an Opaque Surface

14

Diffuse hemisphere Glossy cone

slide-15
SLIDE 15

Reflection on an Opaque Surface

  • 2D plot varies with incident direction

– (and possibly location)

15

ω𝑝 ω𝑝 ω𝑝 𝜕𝑗

slide-16
SLIDE 16
  • Homog. & Isotropic BRDF – 3D
  • Invariant with respect to rotation about the normal

– Homogeneous and isotropic across surface – Only depends on azimuth difference to incoming angle

𝑔

𝑠

𝜄𝑗, 𝜒𝑗 → 𝜄𝑝, 𝜒𝑝 ⟹ 𝑔

𝑠 𝜄𝑗 → 𝜄𝑝, (𝜒𝑗−𝜒𝑝) = 𝑔 𝑠 𝜄𝑗 → 𝜄𝑝,Δ𝜒

16

ω𝑗 ω𝑝 𝑦 Δϕ

slide-17
SLIDE 17

Homogeneous BRDF – 4D

  • Homogeneous bidirectional reflectance

distribution function

– Ratio of reflected radiance to incident irradiance – Independent of position

𝑔

𝑠 𝜕𝑗 → 𝜕𝑝 = 𝑒𝑀𝑝 𝜕𝑝

𝑒𝐹𝑗(𝜕𝑗)

17

ω𝑝 ω𝑗

slide-18
SLIDE 18

Spatially Varying BRDF – 6D

  • Heterogeneous materials (standard model for BRDF)

– Dependent on position, and two directions – Reflection at the point of incidence

𝑔

𝑠 𝑦, 𝜕𝑗 → 𝜕𝑝

18

ω𝑝 ω𝑗 𝑦

slide-19
SLIDE 19

Homogeneous BSSRDF – 6D

  • Homogeneous bidirectional scattering surface

reflectance distribution function

– Assumes a homogeneous and flat surface – Only depends on the difference vector to the outgoing point

𝑔

𝑠 Δ𝑦, 𝜕𝑗 → 𝜕𝑝

19

ω𝑗 ω𝑝 ω𝑝 𝑦𝑝 𝑦𝑗 Δ𝑦

slide-20
SLIDE 20

BSSRDF – 8D

  • Bidirectional scattering surface reflectance

distribution function 𝑔

𝑠 (𝑦𝑗,𝜕𝑗) → (𝑦𝑝,𝜕𝑝)

20

ω𝑝 𝑦𝑝 𝑦𝑗 ω𝑗

slide-21
SLIDE 21

Generalization – 9D

  • Generalizations

– Add wavelength dependence

𝑔

𝑠 𝜇, (𝑦𝑗, 𝜕𝑗) → (𝑦𝑝,𝜕𝑝)

21

ω𝑝 𝑦𝑝 𝑦𝑗 ω𝑗

slide-22
SLIDE 22

Generalization – 10D

  • Generalizations

– Add wavelength dependence – Add fluorescence

  • Change to longer wavelength during scattering

𝑔

𝑠

𝑦𝑗, 𝜕𝑗,𝜇𝑗 → 𝑦𝑝, 𝜕𝑝,𝜇𝑝

22

ω𝑝 𝑦𝑝 𝑦𝑗 ω𝑗

slide-23
SLIDE 23

Generalization – 11D

  • Generalizations

– Add wavelength dependence – Add fluorescence (change to longer wavelength for reflection) – Time varying surface characteristics

𝑔

𝑠 𝑢, 𝑦𝑗, 𝜕𝑗, 𝜇𝑗 → 𝑦𝑝,𝜕𝑝, 𝜇𝑝

23

ω𝑝 𝑦𝑝 𝑦𝑗 ω𝑗

slide-24
SLIDE 24

Generalization – 12D

  • Generalizations

– Add wavelength dependence – Add fluorescence (change to longer wavelength for reflection) – Time varying surface characteristics – Phosphorescence

  • T

emporal storage of light

𝑔

𝑠

𝑦𝑗, 𝜕𝑗,𝑢𝑗, 𝜇𝑗 → 𝑦𝑝,𝜕𝑝,𝑢𝑝,𝜇𝑝

24

ω𝑝 𝑦𝑝 𝑦𝑗 ω𝑗

slide-25
SLIDE 25

Reflectance

  • Reflectance may vary with

– Illumination angle – Viewing angle – Wavelength – (Polarization, ...)

  • Variations due to

– 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

slide-26
SLIDE 26

BRDF Measurement

  • Gonio-Reflectometer
  • BRDF measurement

– Point light source position (𝜄𝑗, 𝜒𝑗) – Light detector position (𝜄𝑝, 𝜒𝑝)

  • 4 directional degrees of freedom
  • BRDF representation

– m incident direction samples – n outgoing direction samples – m*n reflectance values (large!!!) – Additional position dependent (6D)

26 Stanford light gantry

slide-27
SLIDE 27

Rendering from Measured BRDF

  • Linearity, superposition principle

– Continuous illumin.: integrating light distribution against BRDF – Sampled illumination: superimposing many point light sources

  • Interpolation

– Look-up of BRDF values during rendering – Sampled BRDF must be filtered

  • BRDF Modeling

– Fitting of parameterized BRDF models to measured data

  • Continuous, analytic function
  • No interpolation
  • Typically fast evaluation
  • Representation in a basis

– Often: Spherical harmonics (ortho-normal basis on sphere)

  • Or BTFs (bidirectional texture function)

– Mathematically elegant filtering, illumination-BRDF integration

27

Spherical Harmonics Red is positive, green negative [Wikipedia]

slide-28
SLIDE 28

BRDF Modeling

  • Phenomenological approach (not physically correct)

– Description of visual surface appearance – Composition of different terms:

  • Ideal diffuse reflection +

– Lambert’s law, interactions within material – Matte surfaces

  • Ideal specular/mirror reflection +

– Reflection law, reflection on a planar surface – Mirror surfaces

  • Glossy reflection

– “Directional diffuse”, reflection on surface that is somewhat rough – Shiny surface – Glossy highlights – Sometimes incorrectly called “specular”

28

slide-29
SLIDE 29

Reflection Geometry

  • Direction vectors (normalize):

– 𝑂: Surface normal – 𝐽: Light source direction vector – 𝑊: Viewpoint direction vector – 𝑆(𝐽): Reflection vector

  • 𝑆(𝐽) = −𝐽 + 2(𝐽 ⋅ 𝑂)𝑂

– 𝐼: Halfway vector

  • 𝐼 = (𝐽 + 𝑊) / |𝐽 + 𝑊|
  • Tangential surface: local plane

29

𝑺(𝑱) 𝑺(𝑾) 𝑰 𝑾 𝑱 𝑶 −𝑱 −𝑱 (𝑱 ⋅ 𝑶)𝑶 𝟑(𝑱 ⋅ 𝑶)𝑶 𝑶 𝑺(𝑱) 𝑱 𝑶 𝑺(𝑱) 𝑾 𝑰 𝑺(𝑾)

Top view

slide-30
SLIDE 30

Ideal Specular (Mirror) Reflection

  • Angle of reflectance equal to angle of incidence
  • Reflected vector in a plane with incident ray and

surface normal vector 𝑆 + 𝐽 = 2 cos 𝜾 𝑂 = 2 𝐽 ⋅ 𝑂 𝑂 ⟹ 𝑆(𝐽) = −𝐽 + 2(𝐽 ⋅ 𝑂) 𝑂

30

𝜄𝑗 𝑂 cos 𝜄 𝑺 I 𝜄𝑗 = 𝜄𝑝 𝜒𝑝 = 𝜒𝑗 + 180° 𝜒𝑝 𝜒𝑗

−𝑱

𝜄𝑝

slide-31
SLIDE 31

Mirror BRDF

  • Dirac Delta function 𝜺 𝒚

– 𝜺 𝒚 : zero everywhere except at 𝑦 = 0 – Unit integral iff domain contains 𝑦 = 0 (else zero) 𝑔

𝑠,𝑛 𝜕𝑗,𝑦, 𝜕𝑝 = 𝜍𝑡 𝜄𝑗

𝜀(𝑑𝑝𝑡𝜄𝑗 − 𝑑𝑝𝑡𝜄𝑝) cos 𝜄𝑗 𝜀 𝜒𝑗 − 𝜒𝑝 ± 𝜌 𝑀𝑝 𝑦, 𝜕𝑝 = න

Ω+

𝑔

𝑠,𝑛 𝜕𝑗,𝑦, 𝜕𝑝 𝑀𝑗 𝑦, 𝜕𝑗 𝑑𝑝𝑡𝜄𝑗𝑒𝜕𝑗 =

𝜍𝑡 𝜄𝑝 𝑀𝑗(𝑦, 𝜄𝑝, 𝜒𝑝 ± 𝜌)

  • Specular reflectance 𝜍𝑡

– Ratio of reflected radiance in specular direction and incoming radiance – Dimensionless quantity between 0 and 1 𝜍𝑡 𝑦, 𝜄𝑗 = 𝑀𝑝(𝑦, 𝜄𝑝) 𝑀𝑗(𝑦, 𝜄𝑝)

31 L N R

o i

slide-32
SLIDE 32

“Diffuse” Reflection

  • Theoretical explanation

– Multiple scattering within the material (at very short range)

  • Experimental realization

– Pressed magnesium oxide powder (or foam/snow)

  • Random mixture of tiny, highly reflective surfaces

– 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

slide-33
SLIDE 33

Diffuse Reflection Model

  • Light equally likely to be reflected in any output

direction (independent of input direction, idealized)

  • Constant BRDF

– 𝜍𝑒: diffuse reflection coefficient, material property [1/sr]

  • For each point light source

– Lr,d = kd Li cosi = kd Li (I•N)

34

N I Lo= const

𝑔

𝑠,𝑒 𝜕𝑗,𝑦, 𝜕𝑝

= 𝑙𝑒 = 𝑑𝑝𝑜𝑡𝑢 = Τ 𝜍𝑒 𝜌 𝑡𝑠 with ρ𝑠 ∈ [0,1] 𝑀𝑝 𝑦, 𝜕𝑝 = 𝑙𝑒 න

Ω+

𝑀𝑗 𝑦, 𝜕𝑗 cos𝜄𝑗 𝑒𝜕𝑗 = 𝑙𝑒𝐹 = 𝜍𝑒 𝜌[𝑡𝑠] 𝐹

i N I

Lr,d

slide-34
SLIDE 34

Lambertian Objects

35

𝛸0 ∝ 𝑀0 ⋅ Ω

Self-luminous spherical Lambertian light source 

𝛸1 ∝ 𝑀i ⋅ cos θ ⋅ Ω

Eye-light illuminated spherical Lambertian reflector  

slide-35
SLIDE 35

Lambertian Objects (?)

36

 Neither the Sun nor the Moon are Lambertian

  • Some absorption in photosphere
  • Path length through photosphere

longer from the Sun’s rim

  • Surface covered with fine dust
  • Dust visible best from slanted

viewing angle The Sun The Moon

slide-36
SLIDE 36

Glossy Reflection

  • Due to surface roughness
  • Empirical models

(phenomenological)

– Phong – Blinn-Phong

  • Physically-based models

– Blinn – Cook & Torrance

  • Sometimes incorrectly

called “specular”

38

slide-37
SLIDE 37

Phong Glossy Reflection Model

  • Simple experimental description: Cosine power lobe
  • Take angle to reflection direction to some power

– Lr,s = Li ks coske ɵRV

  • Issues

– Not energy conserving/reciprocal – Plastic-like appearance

  • Dot product & power

– Still widely used in CG

39

I N R(I) V H

(RV) (HN)

R(I) R(V) H V I N

𝑔

𝑠 𝜕𝑗,𝑦, 𝜕𝑝

= 𝑙𝑡 𝑆 𝐽 ⋅ 𝑊 𝑙𝑓 / 𝐽 ⋅ 𝑂

slide-38
SLIDE 38

Phong Exponent ke

  • Determines size of highlight
  • Beware: Non-zero contribution into the material !!!

– Cosine is non-zero between -90 and 90 degrees

40

𝑔

𝑠 𝜕𝑗,𝑦, 𝜕𝑝

= 𝑙𝑡 𝑆 𝐽 ⋅ 𝑊 𝑙𝑓 / 𝐽 ⋅ 𝑂

slide-39
SLIDE 39

Blinn-Phong Glossy Reflection

  • Same idea: Cosine power lobe

– Lr,s = Li ks coske ɵHN

  • Dot product & power

– ɵRV → ɵHN – Special case: Light source, viewer far away

  • I, R constant: H constant
  • ɵHN less expensive to compute

41

I N R(I) V H

(RV) (HN)

R(I) R(V) H V I N

𝑔

𝑠 𝜕𝑗,𝑦, 𝜕𝑝

= 𝑙𝑡 𝐼 ⋅ 𝑂 𝑙𝑓 / 𝐽 ⋅ 𝑂

slide-40
SLIDE 40

Different Types of Illumination

  • Three types of illumination
  • Ambient Illumination

– 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)

slide-41
SLIDE 41

Full Phong Illumination Model

  • Phong illumination model for multiple point light sources

– Diffuse reflection (contribution only depends on incoming cosine) – Ambient and Glossy reflection (Phong or Blinn-Phong)

  • Typically: Color of specular reflection 𝒍𝒕 is white

– Often separate specular and diffuse color (common extension, OGL)

  • Empirical model!

– Contradicts physics – Purely local illumination

  • Only direct light from the light sources + constant ambient term
  • Optimization: Lights & viewer assumed to be far away

43

glossy

+ + =

slide-42
SLIDE 42

Microfacet BRDF Model

  • Physically-Inspired Models

– Isotropic microfacet collection – Microfacets assumed as perfectly smooth reflectors

  • BRDF

– Distribution of microfacets

  • Often probabilistic distribution of orientation or V-groove assumption

– Planar reflection properties – Self-masking, shadowing

44

slide-43
SLIDE 43

Ward Reflection Model

  • BRDF

– σ standard deviation (RMS) of surface slope – Simple expansion to anisotropic model (σx, σy) – Empirical, not physics-based

  • Inspired by notion of reflecting microfacets

– Convincing results – Good match to measured data

45

N I V

viewer

H

𝜄

microfacet

surface

slide-44
SLIDE 44

Cook-Torrance Reflection Model

  • Cook-Torrance reflectance model

– 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

𝑔

𝑠 = 𝜆𝑒𝜍𝑒 + 𝜆𝑕𝜍𝑕;

𝜍𝑒 + 𝜍𝑕 ≤ 1

slide-45
SLIDE 45

Cook-Torrance Specular Term

  • D : Distribution function of microfacet orientations
  • G : Geometrical attenuation factor

– represents self-masking and shadowing effects of microfacets

  • F : Fresnel term

– computed by Fresnel equation – Fraction of specularly reflected light for each planar microfacet

  • N·V : Proportional to visible surface area
  • N·I : Proportional to illuminated surface area

47

N I V

viewer

H

𝜄

microfacet

surface

slide-46
SLIDE 46

Electric Conductors (e.g. Metals)

  • Assume ideally smooth surface
  • Perfect specular reflection of light, rest is absorbed
  • Reflectance is defined by Fresnel formula based on:

– Index of refraction  – Absorption coefficient  – Both wavelength dependent

  • Given for parallel and perpendicular polarized light

– i, t: Angle between ray & plane, incident & transmitted

  • For unpolarized light:

48

slide-47
SLIDE 47

Dielectrics (e.g. Glass)

  • Assume ideally smooth surface
  • Non-reflected light is perfectly transmitted: 1 - Fr

– They do not conduct electricity

  • Fresnel formula depends on:

– 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

  • Given for parallel and perpendicular polarized light
  • For unpolarized light:

49

slide-48
SLIDE 48

Microfacet Distribution Functions

  • Isotropic Distributions

– α : angle to average normal of surface – m : average slope of the microfacets

  • Blinn:
  • Torrance-Sparrow

– Gaussian

  • Beckmann

𝐸 𝛽 =

1 𝜌𝑛2𝑑𝑝𝑡4𝛽 𝑓−(𝑢𝑏𝑜𝛽

𝑛 )2

– Used by Cook-Torrance

50

𝐸 𝜕 ⇒ 𝐸 𝛽 𝛽 = ∠𝑂, 𝐼

slide-49
SLIDE 49

Beckman Microfacet Distribution

51

m=0.2 m=0.6

slide-50
SLIDE 50

Geometric Attenuation Factor

52

  • V-shaped grooves
  • Fully illuminated and visible
  • Partial masking of reflected light
  • Partial shadowing of incident light
  • Final

𝐻 = min 1, ) 2(ഫ 𝑂 ⋅ ഫ 𝐼)(ഫ 𝑂 ⋅ ഫ 𝑊 ഫ 𝑊 ⋅ ഫ 𝐼 , ) 2(ഫ 𝑂 ⋅ ഫ 𝐼)(ഫ 𝑂 ⋅ Ӊ 𝐽 ഫ 𝑊 ⋅ ഫ 𝐼 𝐻 = ) 2(ഫ 𝑂 ⋅ ഫ 𝐼)(ഫ 𝑂 ⋅ ഫ 𝑊 ഫ 𝑊 ⋅ ഫ 𝐼 𝐻 = ) 2(ഫ 𝑂 ⋅ ഫ 𝐼)(ഫ 𝑂 ⋅ Ӊ 𝐽 ഫ 𝑊 ⋅ ഫ 𝐼 𝐻 = 1

slide-51
SLIDE 51

Comparison Phong vs. Torrance

53

Phong: T

  • rrance:
slide-52
SLIDE 52

SHADING

54

slide-53
SLIDE 53

What is Shading?

  • Shading

– Computation of reflected light (radiance) at every pixel – In ray tracing typically computed at every hit point – In rasterization computed per triangle/vertices/pixel

  • What is required for shading

– 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

slide-54
SLIDE 54

Flat Shading Model

  • Most simple: Constant Shading

– Fixed color per polygon/triangle

  • Shading Model: Flat Shading

– Single per-surface normal – Single color per polygon – Evaluated at one of the vertices (➔ OpenGL) or at center

56

[wikipedia]

slide-55
SLIDE 55

Gouraud Shading Model

  • Shading Model: Gouraud Shading

– Per-vertex normal

  • Can be computed from adjacent triangle normals (e.g. by averaging)

– Linear interpolation of the shaded colors

  • Computed at all vertices and interpolated

– Often results in shading artifacts along edges

  • Mach Banding (i.e. discontinuous 1st derivative)
  • Flickering of highlights (when one of the normal generates strong

reflection)

– Barycentric interpolation within triangle

57 [wikipedia]

𝑑 𝑏 𝑐 𝑞 𝑀𝑦~𝑔

𝑠 ω𝑝,𝑜𝑦, ω𝑗 𝑀𝑗 cos 𝜄𝑗

𝑀𝑞 = λ1𝑀𝑏 + λ2𝑀𝑐 + λ3𝑀𝑑

slide-56
SLIDE 56

Phong Shading Model

  • Shading Model: Phong Shading

– 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𝜄𝑗

slide-57
SLIDE 57

Problems with Interpolated Shading

  • Issues

– Polygonal silhouette may not match the smooth shading – Perspective distortion

  • Interpolation in 2-D screen space rather than world space (==> later)

– Orientation dependence

  • Only for polygons
  • Not with triangles (here linear interpolation is rotation-invariant)

– 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.

slide-58
SLIDE 58

Occlusions

  • The point on the surface might be in shadow

– Rasterization (OpenGL):

  • Not easily done
  • Can use shadow map or shadow volumes (➔ later)

– Ray tracing

  • Simply trace ray to light source and test for occlusion

60

slide-59
SLIDE 59

Area Light sources

  • Typically approximated by sampling

– Replacing it with some point light sources

  • Often randomly sampled
  • Cosine distribution of power over angular directions at light source

61