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

computer graphics iii light reflection brdf
SMART_READER_LITE
LIVE PREVIEW

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

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


slide-1
SLIDE 1

Computer graphics III – Light reflection, BRDF

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

slide-2
SLIDE 2

Recap – Basic radiometric quantities

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

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 incoming

radiance Li , and therefore

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

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

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

slide-5
SLIDE 5

Recall the Phong shading model

( )

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

slide-6
SLIDE 6

I) Adopt radiometric notation

( )

r n s d

k k L L     cos cos ) ( ) (

i i i

  • +

=

i i

  • r

    −  =  = n n r r ) ( 2 cos

i r o n

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

Exact same thing as on the previous slide – just using physically-based notation.

r i

slide-7
SLIDE 7

BRDF corresponding to the original Phong shading model

i r n s d Orig Phong r

k k f   cos cos + =

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

BRDF:

i i

  • r

L L f  cos =

i r o n

r i

General definition of a BRDF Application of this definition to the Phong shading formula.

slide-8
SLIDE 8

◼ Bidirectional Reflectance Distribution Function

di Lr(o) o n Li(i) i

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

1 i i i i

  • r
  • i

  = →       L L fr

BRDF – Formal definition

„incoming“ „outgoing“ „reflected“

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

slide-9
SLIDE 9

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

slide-10
SLIDE 10

BRDF

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

◼ The BRDF is a model of the bulk behavior of light

  • n the microstructure when viewed from distance

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

slide-11
SLIDE 11

Surface roughness and blurred reflections

◼ The rougher the blurrier

Microscopic surface roughness

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

slide-12
SLIDE 12

Surface appearance and the BRDF

Appearance BRDF lobe (for four different viewing directions)

Souce: Ngan et al. Experimental analysis of BRDF models, http://people.csail.mit.edu/addy/research/brdf/ CG III (NPGR010) - J. Křivánek

slide-13
SLIDE 13

Surface appearance and the BRDF

Appearance BRDF lobe (for four different viewing directions)

Souce: Ngan et al. Experimental analysis of BRDF models, http://people.csail.mit.edu/addy/research/brdf/ CG III (NPGR010) - J. Křivánek

slide-14
SLIDE 14

Surface appearance and the BRDF

Appearance BRDF lobe (for four different viewing directions)

Souce: Ngan et al. Experimental analysis of BRDF models, http://people.csail.mit.edu/addy/research/brdf/ CG III (NPGR010) - J. Křivánek

slide-15
SLIDE 15

Surface appearance and the BRDF

Appearance BRDF lobe (for four different viewing directions)

Souce: Ngan et al. Experimental analysis of BRDF models, http://people.csail.mit.edu/addy/research/brdf/ CG III (NPGR010) - J. Křivánek

slide-16
SLIDE 16

BRDF properties

◼ Helmholz reciprocity (always holds in nature, a

physically-plausible BRDF model must follow it)

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

) ( ) (

i

  • i

    → = →

r r

f f

slide-17
SLIDE 17

BRDF properties

◼ Energy conservation

❑ A patch of surface cannot reflect more light energy than it

receives

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

slide-18
SLIDE 18

BRDF (an)isotropy

◼ Isotropic BRDF = invariant to a rotation around

surface normal

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

( ) ( ) ( )

i

  • i
  • i

i

  • i

i

, , , ; , , ; ,               − = + + =

r r r

f f f

slide-19
SLIDE 19

Surfaces with anisotropic BRDF

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

slide-20
SLIDE 20

Anisotropic BRDF

◼ Different microscopic roughness in different directions

(brushed metals, fabrics, …)

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

slide-21
SLIDE 21

Isotropic vs. anisotropic BRDF

◼ Isotropic BRDFs have only 3 degrees of freedom

❑ Instead of i and o it is enough to consider only D = 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 frame

(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

slide-22
SLIDE 22

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

slide-23
SLIDE 23

Reflection equation

◼ Total reflected radiance: integrate contributions of incident

radiance, weighted by the BRDF, over the hemisphere

 →  =

) ( i i

  • i

i i

  • r

d cos ) ( ) ( ) (

x H r

f L L      

upper hemisphere over x

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

= න

slide-24
SLIDE 24

Reflection equation

◼ Evaluating the reflectance equation renders images!!!

❑ Direct illumination ◼

Environment maps

Area light sources

etc.

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

slide-25
SLIDE 25

Energy conservation – More rigorous

◼ 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

 

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

  • i

 = → = = =

    

i i i i

  • i

i i i r i i i i

  • r

d L d d L f d L d L E B                

slide-26
SLIDE 26

Reflectance

◼ Ratio of the incoming and outgoing flux

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

◼ Hemispherical-hemispherical reflectance

❑ See the “Energy conservation” slide

◼ Hemispherical-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 H r

f a       

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

slide-27
SLIDE 27

Hemispherical-directional reflectance

◼ Nonnegative ◼ Less than or equal to 1

(energy conservation)

◼ Equal to directional-hemispherical

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

slide-28
SLIDE 28

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

slide-29
SLIDE 29

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

slide-30
SLIDE 30

BRDF components

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

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

slide-31
SLIDE 31

Ideal diffuse reflection

slide-32
SLIDE 32

Ideal diffuse reflection

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

slide-33
SLIDE 33

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

slide-34
SLIDE 34

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

slide-35
SLIDE 35

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

slide-36
SLIDE 36

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

slide-37
SLIDE 37

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

sky i i

) , ( L L =  x

sky i snow snow

  • L

L

d

 = 

White-out!!!

slide-38
SLIDE 38

Ideal mirror reflection

slide-39
SLIDE 39

Ideal mirror reflection

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

slide-40
SLIDE 40

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

slide-41
SLIDE 41

Nishino, Nayar: Eyes for Relighting, SIGGRAPH 2004

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

slide-42
SLIDE 42

The law of reflection

◼ Direction of the reflected ray (derive the formula)

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

i i

  −  = n n) ( 2

o n i o = i o = (i + ) mod 2

o i

slide-43
SLIDE 43

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 Image: Wikipedia

slide-44
SLIDE 44

BRDF of the ideal mirror

◼ BRDF of the ideal mirror is a Dirac delta distribution

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

) , ( ) ( ) , (

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

BRDF of the ideal mirror

◼ BRDF of the ideal mirror is a Dirac delta distribution ◼ Verification:

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

) , ( ) ( 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-46
SLIDE 46

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

slide-47
SLIDE 47

Ideal refraction

slide-48
SLIDE 48

Ideal refraction

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

slide-49
SLIDE 49

hi ho i o

Ideal refraction

◼ Index of refraction h

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

◼ Snell’s law

  • i

i

 h  h sin sin =

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

slide-50
SLIDE 50

Ideal refraction

◼ Direction of the refracted ray:

( )n

) cos 1 ( 1 cos

i 2 2 io i io i io

h  h  h  − − + − − =

  • i

io

h h h =

if < 0, total internal reflection Critical angle:

        =

i

  • c

i,

arcsin h h 

Image: wikipedia

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

slide-51
SLIDE 51

Snell’s window

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

https://en.wikipedia.org/wiki/Snell%27s_window View straight up from underwater. The above- water hemisphere is visible, compressed (as by a circular fisheye lens) into a circle (Snell's window) bounded by the critical angle. Everything outside the critical-angle circle is reflected from below the water.

slide-52
SLIDE 52

Snell’s window

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

https://en.wikipedia.org/wiki/Snell%27s_window A diver viewed from below who appears inside

  • f Snell's window.

The edge of Snell's window, in this case the boundary between reflected bottom (teal) and refracted sky and above-water structures (blue and gray)

slide-53
SLIDE 53

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

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

slide-54
SLIDE 54

◼ BRDF of the ideal refraction is a delta distribution:

BRDF of ideal refraction

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

i

  • i
  • i

i i 2 i 2

  • i

i

cos ) ( ) sin sin ( )) ( 1 ( ) , ; , (       h  h   h h      − − − = R ft

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

slide-55
SLIDE 55

Fresnel equations

slide-56
SLIDE 56

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

slide-57
SLIDE 57

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

slide-58
SLIDE 58

Fresnel equations

◼ Dielectrics

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

Image: Wikipedia

slide-59
SLIDE 59

Fresnel equations

◼ Dielectrics

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

slide-60
SLIDE 60

Fresnel equations

◼ Metals

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

slide-61
SLIDE 61

More on Fresnel equations in graphics

◼ https://seblagarde.wordpress.com/2013/04/29/memo-

  • n-fresnel-equations/

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

slide-62
SLIDE 62

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

slide-63
SLIDE 63

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

slide-64
SLIDE 64

Glossy reflection

slide-65
SLIDE 65

Glossy reflection

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

category

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

slide-66
SLIDE 66

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

slide-67
SLIDE 67

BRDF models

slide-68
SLIDE 68

BRDF modeling

BRDF is a model

  • f the bulk

behavior of light when viewing a surface from distance

BRDF models

Empirical

Physically based

Approximation

  • f measured

data

(a.k.a meso-scale)

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

slide-69
SLIDE 69

Empirical BRDF models

◼ 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

slide-70
SLIDE 70

BRDF corresponding to the original Phong shading model

i r n s d Orig Phong r

k k f   cos cos + =

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

i r o n

r i Problems: breaks symmetry & energy conservation

slide-71
SLIDE 71

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

slide-72
SLIDE 72

Physically-plausible BRDF models

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

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

slide-73
SLIDE 73

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

slide-74
SLIDE 74

Microfacet BRDF

◼ Analytically derived ◼ Used for modeling rough 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

slide-75
SLIDE 75

Microfacet 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

slide-76
SLIDE 76

Microfacet BRDF

Microfacet theory [Cook et Torrance 1982]

A perfect mirror

Reflection in a single direction

Outgoing light visible surface normal aligned with the half vector

Half Vector: 𝐼 =

𝑀+𝑊 𝑀+𝑊

Aggregation of micro-mirrors (micro-facets)

Each micro-mirror have a micro-normal

How many micro-mirror have their micro-normal aligned so that 𝐼 = 𝑂 ?

Statistical distribution: Normal Distribution Function (NDF)

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

slide-77
SLIDE 77

Microfacet BRDF

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

i i r h i r

F G D f       =

Fresnel term Geometry 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

slide-78
SLIDE 78

Approximation of measured 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 optimization required to find the BRDF

parameters

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

slide-79
SLIDE 79

BRDF measurements – Gonio-reflectometer

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

UTIA University of Bonn Stanford

slide-80
SLIDE 80

BRDF measurements – Gonio-reflectometer

◼ Realistic graphics lab at EPFL

❑ Probably the most advanced setup as of today ❑ http://rgl.epfl.ch/pages/lab/pgII

◼ In Prague, CZ

❑ The UTIA BTF database ◼

http://btf.utia.cas.cz/

❑ Czech Technical University, prof. Havran ◼

https://dcgi.fel.cvut.cz/publications/2017/havran-sensors- lightdrum

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

slide-81
SLIDE 81

Measured Material

◼ Techniques for speeding measurements

Mirrors

Objects coated by the material:

Sphere [Matusik et al 2003]

Cylinders [Ngan et al 2005]

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

[Matusik et al 2003]

slide-82
SLIDE 82

Surface appearance and the BRDF

Appearance BRDF lobe (for four different viewing directions)

Souce: Ngan et al. Experimental analysis of BRDF models, http://people.csail.mit.edu/addy/research/brdf/ CG III (NPGR010) - J. Křivánek

slide-83
SLIDE 83

Surface appearance and the BRDF

Appearance BRDF lobe (for four different viewing directions)

Souce: Ngan et al. Experimental analysis of BRDF models, http://people.csail.mit.edu/addy/research/brdf/ CG III (NPGR010) - J. Křivánek

slide-84
SLIDE 84

Surface appearance and the BRDF

Appearance BRDF lobe (for four different viewing directions)

Souce: Ngan et al. Experimental analysis of BRDF models, http://people.csail.mit.edu/addy/research/brdf/ CG III (NPGR010) - J. Křivánek

slide-85
SLIDE 85

Surface appearance and the BRDF

Appearance BRDF lobe (for four different viewing directions)

Souce: Ngan et al. Experimental analysis of BRDF models, http://people.csail.mit.edu/addy/research/brdf/ CG III (NPGR010) - J. Křivánek

slide-86
SLIDE 86

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

◼ BTDF

❑ Bidirectional transmittance

distribution function

❑ Described light transmission

◼ BSDF = BRDF+BTDF

❑ Bidirectional scattering

distribution function

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

slide-87
SLIDE 87

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

slide-88
SLIDE 88

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

slide-89
SLIDE 89

BSSRDF

◼ Sub-surface scattering makes surfaces looks “softer”

BRDF BSSRDF

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

slide-90
SLIDE 90

BSSRDF

BRDF BSSRDF

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

slide-91
SLIDE 91

References

◼ Substance3D, “The PBR guide – 2018 edition”

❑ https://www.substance3d.com/pbr-guide ❑ A light intro to get started and obtain a high-level

understanding

◼ Pharr, Jakob, Humphreys, “Physically-based

rendering”, 3rd edition

❑ Chapter 8: Reflection Models ◼

http://www.pbr-book.org/3ed-2018/Reflection_Models.html

❑ Chapter 9: Materials ◼

http://www.pbr-book.org/3ed-2018/Materials.html

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

slide-92
SLIDE 92

References – Industry practice

◼ Hill et al., “Practical Physically Based Shading in

Film and Game Production”, SIGGRAPH 2012 Course

❑ https://blog.selfshadow.com/publications/s2012-shading-

course/

◼ Implementing the Disney BSDF

❑ https://schuttejoe.github.io/post/disneybsdf/

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