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

computer graphics
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Philipp Slusallek & Arsène Pérard-Gayot

Computer Graphics

  • Material Models -
slide-2
SLIDE 2

Overview

  • Last time

– Light: radiance & light sources – Light transport: rendering equation & formal solutions

  • Today

– Reflectance properties:

  • Material models
  • Bidirectional Reflectance Distribution Function (BRDF)
  • Reflection models

– Shading

  • Next lecture

– Varying (reflection) properties over object surfaces: texturing

2

slide-3
SLIDE 3

REFLECTANCE PROPERTIES

3

slide-4
SLIDE 4

Appearance Samples

  • How do materials reflect light?

4

Translucency - subsurface scattering Opaque

slide-5
SLIDE 5

Material Samples

  • Anisotropic

5

anisotropic

slide-6
SLIDE 6

Material Samples

  • Complex surface meso-structure

6

slide-7
SLIDE 7

Material Samples

  • Fibers

7

slide-8
SLIDE 8

Material Samples

  • Photos of samples with light source at exactly the

same position

8

diffuse glossy mirror

slide-9
SLIDE 9

How to describe materials?

  • Reflection properties
  • Mechanical, chemical, electrical properties
  • Surface roughness
  • Geometry/meso-structure
  • Goal: relightable representation of appearance

9

slide-10
SLIDE 10

Reflection Equation - Reflectance

  • Reflection equation

𝑀𝑝 𝑦, 𝜕𝑝 =

Ω+

𝑔

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

  • BRDF

– Ratio of reflected radiance to incident irradiance

𝑔

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

𝑒𝐹𝑗(𝑦, 𝜕𝑗)

10

slide-11
SLIDE 11

BRDF

  • BRDF describes surface reflection

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

  • Bidirectional

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

𝑔

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

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

11

slide-12
SLIDE 12

BRDF Properties

  • Helmholtz reciprocity principle

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

𝑔

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

  • Smooth surface: isotropic BRDF

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

𝑔

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

12

slide-13
SLIDE 13

BRDF Properties

  • Characteristics

– BRDF units

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

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

  • From 0 (total absorption) to ∞ (reflection, 𝜀 -function)

– Energy conservation law

  • No self-emission
  • Possible absorption

Ω+

𝑔

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

∀𝜕𝑗

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

– No subsurface scattering

13

slide-14
SLIDE 14

Standardized Gloss Model

  • Industry often uses only a subset of BRDF values

– Reflection only measured at discrete set of angles

14

slide-15
SLIDE 15

Reflection of an Opaque Surface

15

slide-16
SLIDE 16

Reflection of an Opaque Surface

16

ω𝑝 ω𝑝 ω𝑝

slide-17
SLIDE 17

Isotropic BRDF – 3D

  • Invariant with respect to rotation about the normal

– Only depends on azimuth difference to incoming angle

𝑔

𝑠

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

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

17

ω𝑗 ω𝑝 𝑦 Δϕ

slide-18
SLIDE 18

Homogeneous BRDF – 4D

  • Homogeneous bidirectional reflectance

distribution function

– Ratio of reflected radiance to incident irradiance

𝑔

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

𝑒𝐹𝑗(𝜕𝑗)

18

ω𝑝 ω𝑗

slide-19
SLIDE 19

Spatially Varying BRDF – 6D

  • Heterogeneous materials (standard model for BRDF)

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

𝑔

𝑠 𝑦, 𝜕𝑗 → 𝜕𝑝

19

ω𝑝 ω𝑗 𝑦

slide-20
SLIDE 20

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

𝑔

𝑠 Δ𝑦, 𝜕𝑗 → 𝜕𝑝

20

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

slide-21
SLIDE 21

BSSRDF – 8D

  • Bidirectional scattering surface reflectance

distribution function 𝑔

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

21

ω𝑝 𝑦𝑝 𝑦𝑗 ω𝑗

slide-22
SLIDE 22

Generalization – 9D

  • Generalizations

– Add wavelength dependence

𝑔

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

22

ω𝑝 𝑦𝑝 𝑦𝑗 ω𝑗

slide-23
SLIDE 23

Generalization – 10D

  • Generalizations

– Add wavelength dependence – Add fluorescence

  • Change to longer wavelength during scattering

𝑔

𝑠

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

23

ω𝑝 𝑦𝑝 𝑦𝑗 ω𝑗

slide-24
SLIDE 24

Generalization – 11D

  • Generalizations

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

𝑔

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

24

ω𝑝 𝑦𝑝 𝑦𝑗 ω𝑗

slide-25
SLIDE 25

Generalization – 12D

  • Generalizations

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

  • Temporal storage of light

𝑔

𝑠

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

25

ω𝑝 𝑦𝑝 𝑦𝑗 ω𝑗

slide-26
SLIDE 26

Reflectance

  • Reflectance may vary with

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

  • Variations due to

– Absorption – Surface micro-geometry – Index of refraction / dielectric constant – Scattering

26

Magnesium; λ=0.5μm Aluminum; λ=0.5μm Aluminum; λ=2.0μm

slide-27
SLIDE 27

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

27 Stanford light gantry

slide-28
SLIDE 28

Rendering from Measured BRDF

  • Linearity, superposition principle

– Complex illumination: integrating light distribution against BRDF – Sampled computation: 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

– Most appropriate: Spherical harmonics

  • Ortho-normal function basis on the sphere

– Mathematically elegant filtering, illumination-BRDF integration

28

Spherical Harmonics Red is positive, green negative [Wikipedia]

slide-29
SLIDE 29

BRDF Modeling

  • Phenomenological approach

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

  • Ideal diffuse reflection

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

  • Ideal specular reflection

– Reflection law, reflection on a planar surface – Mirror

  • Glossy reflection

– Directional diffuse, reflection on surface that is somewhat rough – Shiny surface – Glossy highlights

29

slide-30
SLIDE 30

Reflection Geometry

  • Direction vectors (normalize):

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

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

– 𝐼: Halfway vector

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

30

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

Top view

slide-31
SLIDE 31

Ideal Specular 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(𝐽 ⋅ 𝑂) 𝑂

31

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

−𝑱

𝜄𝑝

slide-32
SLIDE 32

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

𝜍𝑡 𝑦, 𝜄𝑗 = 𝑀𝑝(𝑦, 𝜄𝑝) 𝑀𝑗(𝑦, 𝜄𝑝)

32 L N R

o i

slide-33
SLIDE 33

Refraction in Dielectrics

  • Time required for light to travel from A to B through C
  • Fermat’s principle: light path of least traversal time
  • Snell’s law:
  • Special case possible when b < a

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

slide-34
SLIDE 34

Lambertian Diffuse Reflection

  • Light equally likely to be reflected in any output

direction (independent of input direction)

  • Constant BRDF

– kd: diffuse 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

𝑔

𝑠,𝑒 𝜕𝑗, 𝑦, 𝜕𝑝

= 𝑙𝑒 = 𝑑𝑝𝑜𝑡𝑢

𝑀𝑝 𝑦, 𝜕𝑝 = 𝑙𝑒

Ω+ 𝑀𝑗 𝑦, 𝜕𝑗 cos 𝜄𝑗 𝑒𝜕𝑗 = 𝑙𝑒𝐹

i N I

Lr,d

slide-35
SLIDE 35

Lambertian Objects

35

𝛸0 ∝ 𝑀0 ⋅ Ω

Self-luminous spherical Lambertian light source 

𝛸1 ∝ 𝑀i ⋅ cos θ ⋅ Ω

Eye-light illuminated spherical Lambertian reflector  

slide-36
SLIDE 36

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-37
SLIDE 37

“Diffuse” Reflection

  • Theoretical explanation

– Multiple scattering with in the material (at very short range)

  • Experimental realization

– Pressed magnesium oxide powder

  • Random mixture of tiny, highly reflective particles

– Almost never valid at grazing angles of incidence – Paint manufacturers attempt to create ideal diffuse paints

37

slide-38
SLIDE 38

Glossy Reflection

38

slide-39
SLIDE 39

Glossy Reflection

  • Due to surface roughness
  • Empirical models

(phenomenological)

– Phong – Blinn-Phong

  • Physically-based models

– Blinn – Cook & Torrance

39

slide-40
SLIDE 40

Phong Glossy Reflection Model

  • Simple 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

40

I N R(I) V H

(RV) (HN)

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

𝑔

𝑠 𝜕𝑗, 𝑦, 𝜕𝑝

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

slide-41
SLIDE 41

Phong Exponent ke

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

41

𝑔

𝑠 𝜕𝑗, 𝑦, 𝜕𝑝

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

slide-42
SLIDE 42

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

42

I N R(I) V H

(RV) (HN)

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

𝑔

𝑠 𝜕𝑗, 𝑦, 𝜕𝑝

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

slide-43
SLIDE 43

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 𝑙𝑏

𝑀𝑝 𝑦, 𝜕𝑝 = 𝑙𝑏𝑀𝑗,𝑏

43

Direct (with shadows) Global (with all interreflecions) Local (without shadows)

slide-44
SLIDE 44

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

44

𝑀𝑠 = 𝑙𝑏𝑀𝑗,𝑏 + 𝑙𝑒

𝑚

𝑀𝑚(𝐽𝑚 ⋅ 𝑂) + 𝑙𝑡

𝑚

𝑀𝑚 𝑆 𝐽𝑚 ⋅ 𝑊 𝑙𝑓 (𝑄ℎ𝑝𝑜𝑕) 𝑀𝑠 = 𝑙𝑏𝑀𝑗,𝑏 + 𝑙𝑒

𝑚

𝑀𝑚(𝐽𝑚 ⋅ 𝑂) + 𝑙𝑡

𝑚

𝑀𝑚 𝐼𝑚 ⋅ 𝑂 𝑙𝑓 (𝐶𝑚𝑗𝑜𝑜)

slide-45
SLIDE 45

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

45

slide-46
SLIDE 46

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

46

𝑔

𝑠 = 𝜍𝑒

𝜌 + 𝜍𝑡 𝐽 ⋅ 𝑂 𝑊 ⋅ 𝑂 exp − 𝑢𝑏𝑜2 ∠𝐼, 𝑂 𝜏2 4𝜌𝜏2

N I V

viewer

H

𝜄

microfacet

surface

slide-47
SLIDE 47

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

𝑔

𝑠 = 𝜆𝑒𝜍𝑒 + 𝜆𝑡𝜍𝑡;

𝜍𝑒 + 𝜍𝑡 ≤ 1

slide-48
SLIDE 48

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

48

N I V

viewer

H

𝜄

microfacet

surface

𝜆𝑡 = 𝐺

𝜇𝐸𝐻

𝜌(𝑂 ⋅ 𝑊)(𝑂 ⋅ 𝐽)

slide-49
SLIDE 49

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:

49

slide-50
SLIDE 50

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:

50

slide-51
SLIDE 51

Microfacet Distribution Functions

  • Isotropic Distributions

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

  • Blinn: 𝐸 𝛽 = cos−

ln 2 ln cos 𝑛 𝛽

  • Torrance-Sparrow 𝐸 𝛽 = 𝑓− ln 2 𝛽

𝑛 2

– Gaussian

  • Beckmann

𝐸 𝛽 =

1 𝜌𝑛2cos4𝛽 𝑓−(tan 𝛽

𝑛 )2

– Used by Cook-Torrance

51

𝐸 𝜕 ⇒ 𝐸 𝛽 𝛽 = ∠𝑂, 𝐼

slide-52
SLIDE 52

Beckman Microfacet Distribution

52

m=0.2 m=0.6

slide-53
SLIDE 53

Geometric Attenuation Factor

53

  • 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-54
SLIDE 54

Comparison Phong vs. Torrance

54

Phong: Torrance:

slide-55
SLIDE 55

SHADING

55

slide-56
SLIDE 56

What is necessary?

  • View point position
  • Light source description
  • Reflectance model
  • Surface normal / local coordinate frame

56

slide-57
SLIDE 57

Surface Normals – Triangle Mesh

  • 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 ( OGL) or at center

57

[wikipedia]

slide-58
SLIDE 58

Surface Normals – Triangle Mesh

  • 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

58 [wikipedia]

𝑑 𝑏 𝑐 𝑞 𝑀𝑦~𝑔

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

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

slide-59
SLIDE 59

Surface Normals – Triangle Mesh

  • 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

59 [wikipedia]

𝑑 𝑏 𝑐 𝑞 𝑜𝑞 = λ1𝑜1 + λ2𝑜2 + λ3𝑜3 ∥ λ1𝑜1 + λ2𝑜2 + λ3𝑜3 ∥ 𝑀𝑞~𝑔

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

slide-60
SLIDE 60

Problems in 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) – 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.

slide-61
SLIDE 61

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

61

slide-62
SLIDE 62

Area Light sources

  • Typically approximated by sampling

– Replacing it with some point light sources

  • Often randomly sampled
  • Cosine distribution of power over angular directions

62