Com puter graphics III Light reflection, BRDF Jaroslav Kivnek, MFF - - PowerPoint PPT Presentation

com puter graphics iii light reflection brdf
SMART_READER_LITE
LIVE PREVIEW

Com puter graphics III Light reflection, BRDF Jaroslav Kivnek, MFF - - PowerPoint PPT Presentation

Com puter graphics III Light reflection, BRDF Jaroslav Kivnek, MFF UK Jaroslav.Krivanek@mff.cuni.cz Basic radiom etric quantities Image: Wojciech Jarosz CG III (NPGR010) - J. Kivnek 2015 Interaction of light with a surface


slide-1
SLIDE 1

Com puter graphics III – Light reflection, BRDF

Jaroslav Křivánek, MFF UK Jaroslav.Krivanek@mff.cuni.cz

slide-2
SLIDE 2

Basic radiom etric quantities

CG III (NPGR010) - J. Křivánek 2015

Image: Wojciech Jarosz

slide-3
SLIDE 3

Interaction of light with a surface

 Absorption  Reflection  Transmission / refraction  Reflective properties of materials determine

 the relation of reflected radiance Lr

to incom ing

radiance Li , and therefore

 the appearance of the object: color, glossiness, etc.

CG III (NPGR010) - J. Křivánek 2015

slide-4
SLIDE 4

Interaction of light with a surface

 Same illumination  Different materials Source: MERL BRDF database

CG III (NPGR010) - J. Křivánek 2015

slide-5
SLIDE 5

 Bidirectional reflectance distribution function  (cz: Dvousměrová distribuční funkce odrazu)

dωi Lr(ωo) θo n Li(ωi) θi

] sr [ d cos ) ( ) ( d ) ( d ) ( d ) (

1 i i i i

  • r

i

  • r
  • i

⋅ ⋅ = = → ω θ ω ω ω ω ω ω L L E L fr

BRDF

“incoming” “outgoing” “reflected”

CG III (NPGR010) - J. Křivánek 2015

slide-6
SLIDE 6

BRDF

 Mathematical model of the reflection properties of a

surface

 Intuition

 Value of a BRDF = probability density,

describing the event that a light energy “packet”, or “photon”, coming from direction ωi gets reflected to the direction ωo.

 Range:

[

)

∞ ∈ → , ) (

  • i

ω ω

r

f

CG III (NPGR010) - J. Křivánek 2015

slide-7
SLIDE 7

BRDF

Westin et al. Predicting Reflectance Functions from Complex Surfaces, SIGGRAPH 1992.

 The BRDF is a m odel of the bulk behavior of light

  • n the microstructure when viewed from distance

CG III (NPGR010) - J. Křivánek 2015

slide-8
SLIDE 8

BRDF properties

 Helm holz reciprocity (always holds in nature, a

physically-plausible BRDF model must follow it)

CG III (NPGR010) - J. Křivánek 2015

) ( ) (

i

  • i

ω ω ω ω → = →

r r

f f

slide-9
SLIDE 9

BRDF properties

 Energy conservation

 Reflected flux per unit area (i.e. radiosity B) cannot be

larger than the incoming flux per unit surface area (i.e. irradiance E).

CG III (NPGR010) - J. Křivánek 2015

[ ]

1 cos ) ( cos cos ) ( ) ( cos ) ( cos ) (

  • i

≤ = → = = =

∫ ∫ ∫ ∫ ∫

i i i i

  • i

i i i r i i i i r

  • r

d L d d L f d L d L E B ω θ ω ω θ ω θ ω ω ω ω θ ω ω θ ω

slide-10
SLIDE 10

BRDF (an)isotropy

 Isotropic BRDF = invariant to a rotation around

surface normal

CG III (NPGR010) - J. Křivánek 2015

( ) ( ) ( )

i

  • i
  • i

i

  • i

i

, , , ; , , ; , φ φ θ θ φ φ θ φ φ θ φ θ φ θ − = + + =

r r r

f f f

slide-11
SLIDE 11

Surfaces with anisotropic BRDF

CG III (NPGR010) - J. Křivánek 2015

slide-12
SLIDE 12

Anisotropic BRDF

 Different microscopic roughness in different directions

(brushed metals, fabrics, … )

CG III (NPGR010) - J. Křivánek 2015

slide-13
SLIDE 13

Isotropic vs. anisotropic BRDF

 Isotropic BRDFs have only 3 degrees of freedom

 Instead of φi and φo it is enough to consider only ∆φ = φi – φo  But this is not enough to describe an anisotropic BRDF

 Description of an anisotropic BRDF

 φi and φo are expressed in a local coordinate fram e

(U, V, N)

U … tangent – e.g. the direction of brushing

V … binormal

N … surface normal … the Z axis of the local coordinate frame

CG III (NPGR010) - J. Křivánek 2015

slide-14
SLIDE 14

Reflection equation

 A.k.a. reflectance equation, illumination integral,

OVTIGRE (“outgoing, vacuum, time-invariant, gray radiance

equation”)

 “How much total light gets reflected in the direction ωo?“  From the definition of the BRDF, we have

i r

L f L ω θ ω ω ω ω d cos ) ( ) ( ) ( d

i i i

  • i
  • r

⋅ ⋅ → =

CG III (NPGR010) - J. Křivánek 2015

slide-15
SLIDE 15

Reflection equation

 Integrating the contributions dLr over the entire

hemisphere:

⋅ → ⋅ =

) ( i i

  • i

i i

  • r

d cos ) , ( ) , ( ) , (

x

x x x

H r

f L L ω θ ω ω ω ω dωi Lo(x, ωo) θo n Li(x, ωi) θi Lr(x, ωo)

upper hemisphere

  • ver x

CG III (NPGR010) - J. Křivánek 2015

slide-16
SLIDE 16

Reflection equation

 Evaluating the reflectance equation renders images!!!

 Direct illumination 

Environment maps

Area light sources

etc.

CG III (NPGR010) - J. Křivánek 2015

slide-17
SLIDE 17

Reflectance

 Ratio of the incom ing and outgoing flux

 A.k.a. „albedo“ (used mostly for diffuse reflection)

 Hem ispherical-hem ispherical reflectance

 See the “Energy conservation” slide

 Hem ispherical-directional reflectance

 The amount of light that gets reflected in direction ωo when

illuminated by the unit, uniform incoming radiance.

→ = =

) ( i i

  • i
  • d

cos ) , ( ) ( ) (

x

x

H r

f a ω θ ω ω ω ω ρ

CG III (NPGR010) - J. Křivánek 2015

slide-18
SLIDE 18

Hem ispherical-directional reflectance

 Nonnegative  Less than or equal to 1

(energy conservation)

 Equal to directional-hem ispherical

reflectance

 What is the percentage of the energy coming from the

incoming direction ωi that gets reflected (to any direction)?“

 Equality follows from the Helmholz reciprocity

[ ]

1 , ) (

ω ρ

CG III (NPGR010) - J. Křivánek 2015

slide-19
SLIDE 19

CG III (NPGR010) - J. Křivánek 2015

slide-20
SLIDE 20

CG III (NPGR010) - J. Křivánek 2015

slide-21
SLIDE 21

BRDF com ponents

General BRDF Ideal diffuse (Lambertian) Ideal specular Glossy, directional diffuse

CG III (NPGR010) - J. Křivánek 2015

slide-22
SLIDE 22

Ideal diffuse reflection

slide-23
SLIDE 23

Ideal diffuse reflection

CG III (NPGR010) - J. Křivánek 2015

slide-24
SLIDE 24

Ideal diffuse reflection

 A.k.a. Lambertian reflection

Johann Heinrich Lambert, „Photometria“, 1760.

 Postulate: Light gets reflected to all directions with the

same probability, irrespective of the direction it came from

 The corresponding BRDF is a constant function

(independent of ωi , ωo)

d r d r

f f

,

  • i

,

) ( = → ω ω

CG III (NPGR010) - J. Křivánek 2015

slide-25
SLIDE 25

Ideal diffuse reflection

 Reflection on a Lambertian surface:  View independent appearance

 Outgoing radiance Lo is independent of ωo

 Reflectance (derive)

E f L f L

d r H d r , ) ( i i i i ,

  • d

cos ) ( ) ( = =

x

ω θ ω ω

d r d

f , ⋅ = π ρ

irradiance

CG III (NPGR010) - J. Křivánek 2015

slide-26
SLIDE 26

Ideal diffuse reflection

 Mathematical idealization that does not exist in nature  The actual behavior of natural materials deviates from

the Lambertian assumption especially for grazing incidence angles

CG III (NPGR010) - J. Křivánek 2015

slide-27
SLIDE 27

White-out conditions

 Under a covered sky we cannot tell the shape of a terrain

covered by snow

 We do not have this problem

close to a localized light source.

 Why?

CG III (NPGR010) - J. Křivánek 2015

slide-28
SLIDE 28

White-out conditions

 We assume sky radiance independent of direction

(covered sky)

 We also assume Lambertian reflection on snow  Reflected radiance given by:

CG III (NPGR010) - J. Křivánek 2015

sky i i

) , ( L L = ω x

sky i snow snow

  • L

L

d

⋅ = ρ

White-out!!!

slide-29
SLIDE 29

Ideal m irror reflection

slide-30
SLIDE 30

Ideal m irror reflection

CG III (NPGR010) - J. Křivánek 2015

slide-31
SLIDE 31

CG III (NPGR010) - J. Křivánek 2015

slide-32
SLIDE 32

Nishino, Nayar: Eyes for Relighting, SIGGRAPH 2004

CG III (NPGR010) - J. Křivánek 2015

slide-33
SLIDE 33

The law of reflection

 Direction of the reflected ray (derive the formula)

CG III (NPGR010) - J. Křivánek 2015

i i

  • ω

ω ω − ⋅ = n n) ( 2 θo n θi θo = θi φo = (φi + π) mod 2π

φo φi

slide-34
SLIDE 34

Digression: Dirac delta distribution

 Definition (informal):  The following holds for any f:  Delta distribution is not a function (otherwise the

integrals would = 0)

CG III (NPGR010) - J. Křivánek 2015 Image: Wikipedia

slide-35
SLIDE 35

BRDF of the ideal m irror

 BRDF of the ideal mirror is a Dirac delta distribution

CG III (NPGR010) - J. Křivánek 2015

) , ( ) ( ) , (

  • i

i

  • r

π ϕ θ θ ϕ θ ± = L R L

i

  • i
  • i

i

  • i

i ,

cos ) ( ) cos (cos ) ( ) , ; , ( θ π ϕ ϕ δ θ θ δ θ ϕ θ ϕ θ ± − − = R f

m r

θo n θi θo = θi

Fresnel reflectance (see below) We want:

slide-36
SLIDE 36

BRDF of the ideal m irror

 BRDF of the ideal mirror is a Dirac delta distribution  Varification:

CG III (NPGR010) - J. Křivánek 2015

) , ( ) ( cos ) , ( cos ) ( ) cos (cos ) ( cos (.) (.) ) , (

r r i i i i i i i i

  • i
  • i

i i i i ,

  • r

π ϕ θ θ ω θ ϕ θ θ π ϕ ϕ δ θ θ δ θ ω θ ϕ θ ± = ± − − = =

∫ ∫

L R d L R d L f L

m r

slide-37
SLIDE 37

CG III (NPGR010) - J. Křivánek 2015

slide-38
SLIDE 38

Ideal refraction

slide-39
SLIDE 39

Ideal refraction

CG III (NPGR010) - J. Křivánek 2015

slide-40
SLIDE 40

ηi ηo ωi ωo

Ideal refraction

 Index of refraction η

 Water 1.33, glass 1.6, diamond 2.4  Often depends on the wavelength

 Snell’s law

  • i

i

θ η θ η sin sin =

CG III (NPGR010) - J. Křivánek 2015

slide-41
SLIDE 41

Ideal refraction

 Direction of the refracted ray:

( )n

) cos 1 ( 1 cos

i 2 2 io i io i io

  • θ

η θ η ω η ω − − + − − =

  • i

io

η η η =

if < 0, total internal reflection Critical angle:

        =

i

  • c

i,

arcsin η η θ

Image: wikipedia

CG III (NPGR010) - J. Křivánek 2015

slide-42
SLIDE 42

Ideal refraction

 Change of radiance

 Follows from the conservation of energy (flux)  When going from an optically rarer to a more dense

medium, light energy gets “compressed” in directions => higher energy density => higher radiance

2 2 i

  • i
  • L

L η η =

CG III (NPGR010) - J. Křivánek 2015

slide-43
SLIDE 43

 BRDF of the ideal refraction is a delta distribution:

BRDF of ideal refraction

CG III (NPGR010) - J. Křivánek 2015

i

  • i
  • i

i i 2 i 2

  • i

i

cos ) ( ) sin sin ( )) ( 1 ( ) , ; , ( θ π ϕ ϕ δ θ η θ η δ θ η η ϕ θ ϕ θ ± − − − = R ft

Fresnel transmittance Change of radiance Snell’s law Refracted ray stays in the incidence plane

slide-44
SLIDE 44

Fresnel equations

slide-45
SLIDE 45

Fresnel equations

 Read [frenel]  Ratio of the transmitted and reflected light depends on

the incident direction

 From above – more transmission  From the side – more reflection

 Extremely important for realistic rendering of glass,

water and other smooth dielectrics

 Not to be confused with

Fresnel lenses (used in lighthouses)

CG III (NPGR010) - J. Křivánek 2015

slide-46
SLIDE 46

Fresnel equations

 Dielectrics

CG III (NPGR010) - J. Křivánek 2015

Image: Wikipedia

slide-47
SLIDE 47

Fresnel equations

 Dielectrics

CG III (NPGR010) - J. Křivánek 2015

slide-48
SLIDE 48

Fresnel equations

From above

  • little reflection
  • more transmission

From the side

  • little transmission
  • more reflection

Try for yourself!!!

CG III (NPGR010) - J. Křivánek 2015

slide-49
SLIDE 49

Fresnel equations

 Metals

CG III (NPGR010) - J. Křivánek 2015

slide-50
SLIDE 50

CG III (NPGR010) - J. Křivánek 2015

slide-51
SLIDE 51

CG III (NPGR010) - J. Křivánek 2015

slide-52
SLIDE 52

Glossy reflection

slide-53
SLIDE 53

Glossy reflection

 Neither ideal diffuse nor ideal mirror  All real materials in fact fall in this

category

CG III (NPGR010) - J. Křivánek 2015

slide-54
SLIDE 54

Surface roughness and blurred reflections

 The rougher the blurrier

Microscopic surface roughness

CG III (NPGR010) - J. Křivánek 2015

slide-55
SLIDE 55

CG III (NPGR010) - J. Křivánek 2015

slide-56
SLIDE 56

BRDF m odels

slide-57
SLIDE 57

BRDF m odeling

BRDF is a model

  • f the bulk

behavior of light when viewing a surface from distance

BRDF m odels

Empirical

Physically based

Approximation

  • f measured

data

(a.k.a meso-scale)

CG III (NPGR010) - J. Křivánek 2015

slide-58
SLIDE 58

Em pirical BRDF m odels

 An arbitrary formula that takes ωi and ωo as arguments  ωi and ωo are sometimes denoted L (Light direction) a V

(Viewing direction)

 Example: Phong model  Arbitrary shading calculations (shaders)

CG III (NPGR010) - J. Křivánek 2015

slide-59
SLIDE 59

Phong shading m odel

( )

n s d

R V k L N k I C ) ( ) ( ⋅ + ⋅ = L R V N L N L N R − ⋅ = ) ( 2

CG III (NPGR010) - J. Křivánek 2015

slide-60
SLIDE 60

Phong shading m odel in the radiom etric notation

( )

r n s d

k k L L θ θ ω ω cos cos ) ( ) (

i i i

  • +

=

i i

  • r

ω ω ω θ − ⋅ = ⋅ = n n r r ) ( 2 cos BRDF

i i

  • r

L L f θ cos =

i r n s d Orig Phong r

k k f θ θ cos cos + = Original shading model

ωi r ωo n

CG III (NPGR010) - J. Křivánek 2015

slide-61
SLIDE 61

Physically-plausible Phong BRDF

 Modification to ensure reciprocity (symmetry) and

energy conservation

 Energy conserved when  It is still an empirical formula (i.e. it does not follow from

physical considerations), but at least it fulfills the basic properties of a BRDF

r n s d r

n f θ ρ π π ρ cos 2 2

modif Phong

+ + = 1 ≤ +

s d

ρ ρ

CG III (NPGR010) - J. Křivánek 2015

slide-62
SLIDE 62

Physically-plausible BRDF m odels

 E.g. Torrance-Sparrow / Cook-Torrance model  Based on the microfacet theory

CG III (NPGR010) - J. Křivánek 2015

slide-63
SLIDE 63

CG III (NPGR010) - J. Křivánek 2015

slide-64
SLIDE 64

Torrance-Sparrow BRDF

 Analytically derived  Used for modeling glossy surfaces (as the Phong model)

 Corresponds more closely to reality than Phong  Derived from a physical model of the surface

microgeometry (as opposed to “because it looks good”- approach used for the Phong model)

CG III (NPGR010) - J. Křivánek 2015

slide-65
SLIDE 65

Torrance-Sparrow BRDF

 Assumes that the macrosurface consists of randomly

  • riented microfacets

 We assume that each microfacet behaves as an ideal

mirror.

 We consider 3 phenomena:

Shadowing Masking Reflection

CG III (NPGR010) - J. Křivánek 2015

slide-66
SLIDE 66

Torrance-Sparrow BRDF

( ) ( , ) ( ) 4cos( )cos( )

i i r h i r

F G D f θ ω ω θ θ θ =

Fresnel term Geom etry term Models shadowing and masking Microfacet distribution Part of the macroscopic surface visible by the light source Part of the macroscopic surface visible by the viewer

CG III (NPGR010) - J. Křivánek 2015

slide-67
SLIDE 67

Approxim ation of m easured data

 We can fit any BRDF model to the data  Some BRDF models have been specifically designed for

the purpose of fitting measured data, e.g. Ward BRDF, Lafortune BRDF

 Nonlinear optim ization required to find the BRDF

parameters

CG III (NPGR010) - J. Křivánek 2015

slide-68
SLIDE 68

BRDF m easurem ents – Gonio-reflectom eter

CG III (NPGR010) - J. Křivánek 2015

slide-69
SLIDE 69

BRDF m odels vs. m easured data

CG III (NPGR010) - J. Křivánek 2015

slide-70
SLIDE 70

BRDF m odels vs. m easured data

CG III (NPGR010) - J. Křivánek 2015

slide-71
SLIDE 71

BRDF m odels vs. m easured data

CG III (NPGR010) - J. Křivánek 2015

slide-72
SLIDE 72

BRDF m odels vs. m easured data

CG III (NPGR010) - J. Křivánek 2015

slide-73
SLIDE 73

BRDF m odels vs. m easured data

CG III (NPGR010) - J. Křivánek 2015

slide-74
SLIDE 74

BRDF, BTDF, BSDF: What’s up with all these abbreviations?

 BTDF

 Bidirectional transm ittance

distribution function

 Described light transmission

 BSDF = BRDF+BTDF

 Bidirectional scattering

distribution function

CG III (NPGR010) - J. Křivánek 2015

slide-75
SLIDE 75

SBRDF, BTF

 SV-BRDF …

Spatially Varying BRDF

 BRDF parameters are spatially varying (can be given by a

surface texture)

 BTF …

Bidirectional Texture Function

 Used for materials with complex structure  As opposed to the BRDF, models even the meso-scale

CG III (NPGR010) - J. Křivánek 2015

slide-76
SLIDE 76

BSSRDF

 BRDF

 Light arriving at a point is reflected/ transmitted at the

same point

 No subsurface scattering considered

 BSSRDF

 Bi-directional surface scattering reflectance distribution

function

 Takes into account

scattering of light under the surface

CG III (NPGR010) - J. Křivánek 2015

slide-77
SLIDE 77

BSSRDF

 Sub-surface scattering makes surfaces looks “softer”

BRDF BSSRDF

CG III (NPGR010) - J. Křivánek 2015

slide-78
SLIDE 78

BSSRDF

BRDF BSSRDF

CG III (NPGR010) - J. Křivánek 2015