Computer graphics III – Light reflection, BRDF
Jaroslav Křivánek, MFF UK Jaroslav.Krivanek@mff.cuni.cz
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
Jaroslav Křivánek, MFF UK Jaroslav.Krivanek@mff.cuni.cz
CG III (NPGR010) - J. Křivánek
Image: Wojciech Jarosz
◼ Absorption ◼ Reflection ◼ Transmission / refraction ◼ Reflective properties of materials determine
❑ the relation of reflected radiance Lr to incoming
❑ the appearance of the object: color, glossiness, etc.
CG III (NPGR010) - J. Křivánek
◼ Same illumination ◼ Different materials Source: MERL BRDF database
CG III (NPGR010) - J. Křivánek
n s d
CG III (NPGR010) - J. Křivánek
r n s d
i i i
i i
CG III (NPGR010) - J. Křivánek
Exact same thing as on the previous slide – just using physically-based notation.
i r n s d Orig Phong r
CG III (NPGR010) - J. Křivánek
i i
General definition of a BRDF Application of this definition to the Phong shading formula.
◼ Bidirectional Reflectance Distribution Function
1 i i i i
−
CG III (NPGR010) - J. Křivánek
◼ Mathematical model of the reflection properties of a
◼ Intuition
❑ Value of a BRDF = probability density,
◼ Range:
r
CG III (NPGR010) - J. Křivánek
Westin et al. Predicting Reflectance Functions from Complex Surfaces, SIGGRAPH 1992.
◼ The BRDF is a model of the bulk behavior of light
CG III (NPGR010) - J. Křivánek
◼ The rougher the blurrier
Microscopic surface roughness
CG III (NPGR010) - J. Křivánek
Souce: Ngan et al. Experimental analysis of BRDF models, http://people.csail.mit.edu/addy/research/brdf/ CG III (NPGR010) - J. Křivánek
Souce: Ngan et al. Experimental analysis of BRDF models, http://people.csail.mit.edu/addy/research/brdf/ CG III (NPGR010) - J. Křivánek
Souce: Ngan et al. Experimental analysis of BRDF models, http://people.csail.mit.edu/addy/research/brdf/ CG III (NPGR010) - J. Křivánek
Souce: Ngan et al. Experimental analysis of BRDF models, http://people.csail.mit.edu/addy/research/brdf/ CG III (NPGR010) - J. Křivánek
◼ Helmholz reciprocity (always holds in nature, a
CG III (NPGR010) - J. Křivánek
i
r r
◼ Energy conservation
❑ A patch of surface cannot reflect more light energy than it
CG III (NPGR010) - J. Křivánek
◼ Isotropic BRDF = invariant to a rotation around
CG III (NPGR010) - J. Křivánek
i
i
i
r r r
CG III (NPGR010) - J. Křivánek
◼ Different microscopic roughness in different directions
CG III (NPGR010) - J. Křivánek
◼ 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 … 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
◼ A.k.a. reflectance equation, illumination integral,
◼ “How much total light gets reflected in the direction o?“ ◼ From the definition of the BRDF, we have i r
i i i
CG III (NPGR010) - J. Křivánek
◼ Total reflected radiance: integrate contributions of incident
) ( i i
i i
x H r
CG III (NPGR010) - J. Křivánek 2015
◼ Evaluating the reflectance equation renders images!!!
❑ Direct illumination ◼
Environment maps
◼
Area light sources
◼
etc.
CG III (NPGR010) - J. Křivánek
◼ Reflected flux per unit area (i.e. radiosity B) cannot be
CG III (NPGR010) - J. Křivánek
i i i i
i i i r i i i i
◼ 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
) ( i i
x H r
CG III (NPGR010) - J. Křivánek
◼ Nonnegative ◼ Less than or equal to 1
◼ Equal to directional-hemispherical
❑ What is the percentage of the energy coming from the
❑ Equality follows from the Helmholz reciprocity
CG III (NPGR010) - J. Křivánek
CG III (NPGR010) - J. Křivánek
CG III (NPGR010) - J. Křivánek
General BRDF Ideal diffuse (Lambertian) Ideal specular Glossy, directional diffuse
CG III (NPGR010) - J. Křivánek
CG III (NPGR010) - J. Křivánek
◼ A.k.a. Lambertian reflection
❑
Johann Heinrich Lambert, „Photometria“, 1760.
◼ Postulate: Light gets reflected to all directions with the
◼ The corresponding BRDF is a constant function
d r d r
,
,
CG III (NPGR010) - J. Křivánek
◼ Reflection on a Lambertian surface: ◼ View independent appearance
❑ Outgoing radiance Lo is independent of o
◼ Reflectance (derive)
d r H d r , ) ( i i i i ,
x
d r d
CG III (NPGR010) - J. Křivánek
◼ Mathematical idealization that does not exist in nature ◼ The actual behavior of natural materials deviates from
CG III (NPGR010) - J. Křivánek
◼ Under a covered sky we cannot tell the shape of a terrain
◼ We do not have this problem
◼ Why?
CG III (NPGR010) - J. Křivánek
◼ We assume sky radiance independent of direction
◼ We also assume Lambertian reflection on snow ◼ Reflected radiance given by:
CG III (NPGR010) - J. Křivánek
sky i i
sky i snow snow
d
CG III (NPGR010) - J. Křivánek
CG III (NPGR010) - J. Křivánek
Nishino, Nayar: Eyes for Relighting, SIGGRAPH 2004
CG III (NPGR010) - J. Křivánek
◼ Direction of the reflected ray (derive the formula)
CG III (NPGR010) - J. Křivánek
i i
◼ Definition (informal): ◼ The following holds for any f: ◼ Delta distribution is not a function (otherwise the
CG III (NPGR010) - J. Křivánek Image: Wikipedia
◼ BRDF of the ideal mirror is a Dirac delta distribution
CG III (NPGR010) - J. Křivánek
i
i
i
i ,
m r
o n i o = i
◼ BRDF of the ideal mirror is a Dirac delta distribution ◼ Verification:
CG III (NPGR010) - J. Křivánek
r r i i i i i i i i
i i i i ,
m r
CG III (NPGR010) - J. Křivánek
CG III (NPGR010) - J. Křivánek
hi ho i o
◼ Index of refraction h
❑ Water 1.33, glass 1.6, diamond 2.4 ❑ Often depends on the wavelength
◼ Snell’s law
i
CG III (NPGR010) - J. Křivánek
◼ Direction of the refracted ray:
i 2 2 io i io i io
io
i
i,
Image: wikipedia
CG III (NPGR010) - J. Křivánek
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.
CG III (NPGR010) - J. Křivánek
https://en.wikipedia.org/wiki/Snell%27s_window A diver viewed from below who appears inside
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)
◼ Change of radiance
❑ Follows from the conservation of energy (flux) ❑ When going from an optically rarer to a more dense
2 2 i
CG III (NPGR010) - J. Křivánek
◼ BRDF of the ideal refraction is a delta distribution:
CG III (NPGR010) - J. Křivánek
i
i i 2 i 2
i
◼ Read [frenel] ◼ Ratio of the transmitted and reflected light depends on
❑ From above – more transmission ❑ From the side – more reflection
◼ Extremely important for realistic rendering of glass,
◼ Not to be confused with
CG III (NPGR010) - J. Křivánek
From above
From the side
Try for yourself!!!
CG III (NPGR010) - J. Křivánek
◼ Dielectrics
CG III (NPGR010) - J. Křivánek
Image: Wikipedia
◼ Dielectrics
CG III (NPGR010) - J. Křivánek
◼ Metals
CG III (NPGR010) - J. Křivánek
◼ https://seblagarde.wordpress.com/2013/04/29/memo-
CG III (NPGR010) - J. Křivánek
CG III (NPGR010) - J. Křivánek
CG III (NPGR010) - J. Křivánek
◼ Neither ideal diffuse nor ideal mirror ◼ All real materials in fact fall in this
CG III (NPGR010) - J. Křivánek
CG III (NPGR010) - J. Křivánek
◼
◼
❑
❑
❑
(a.k.a meso-scale)
CG III (NPGR010) - J. Křivánek
◼ An arbitrary formula that takes i and o as arguments ◼ i and o are sometimes denoted L (Light direction) a V
◼ Example: Phong model ◼ Arbitrary shading calculations (shaders)
CG III (NPGR010) - J. Křivánek
i r n s d Orig Phong r
CG III (NPGR010) - J. Křivánek
◼ Modification to ensure reciprocity (symmetry) and
◼ Energy conserved when ◼ It is still an empirical formula (i.e. it does not follow from
r n s d r
modif Phong
s d
CG III (NPGR010) - J. Křivánek
◼ E.g. Torrance-Sparrow / Cook-Torrance model ◼ Based on the microfacet theory
CG III (NPGR010) - J. Křivánek
CG III (NPGR010) - J. Křivánek
◼ 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
CG III (NPGR010) - J. Křivánek
◼ Assumes that the macrosurface consists of randomly
◼ We assume that each microfacet behaves as an ideal
◼ We consider 3 phenomena:
CG III (NPGR010) - J. Křivánek
◼
Reflection in a single direction
◼
Outgoing light visible surface normal aligned with the half vector
◼
Half Vector: 𝐼 =
𝑀+𝑊 𝑀+𝑊
◼
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
i i r h i r
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
◼ We can fit any BRDF model to the data ◼ Some BRDF models have been specifically designed for
◼ Nonlinear optimization required to find the BRDF
CG III (NPGR010) - J. Křivánek
CG III (NPGR010) - J. Křivánek
UTIA University of Bonn Stanford
◼ 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
◼ Techniques for speeding measurements
❑
❑
◼
Sphere [Matusik et al 2003]
◼
Cylinders [Ngan et al 2005]
CG III (NPGR010) - J. Křivánek
[Matusik et al 2003]
Souce: Ngan et al. Experimental analysis of BRDF models, http://people.csail.mit.edu/addy/research/brdf/ CG III (NPGR010) - J. Křivánek
Souce: Ngan et al. Experimental analysis of BRDF models, http://people.csail.mit.edu/addy/research/brdf/ CG III (NPGR010) - J. Křivánek
Souce: Ngan et al. Experimental analysis of BRDF models, http://people.csail.mit.edu/addy/research/brdf/ CG III (NPGR010) - J. Křivánek
Souce: Ngan et al. Experimental analysis of BRDF models, http://people.csail.mit.edu/addy/research/brdf/ CG III (NPGR010) - J. Křivánek
◼ BTDF
❑ Bidirectional transmittance
❑ Described light transmission
◼ BSDF = BRDF+BTDF
❑ Bidirectional scattering
CG III (NPGR010) - J. Křivánek
◼ SV-BRDF … Spatially Varying BRDF
❑ BRDF parameters are spatially varying (can be given by a
◼ 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
◼ BRDF
❑ Light arriving at a point is reflected/transmitted at the
❑ No subsurface scattering considered
◼ BSSRDF
❑ Bi-directional surface scattering reflectance distribution
❑ Takes into account
CG III (NPGR010) - J. Křivánek
◼ Sub-surface scattering makes surfaces looks “softer”
BRDF BSSRDF
CG III (NPGR010) - J. Křivánek
BRDF BSSRDF
CG III (NPGR010) - J. Křivánek
◼ Substance3D, “The PBR guide – 2018 edition”
❑ https://www.substance3d.com/pbr-guide ❑ A light intro to get started and obtain a high-level
◼ Pharr, Jakob, Humphreys, “Physically-based
❑ 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
◼ Hill et al., “Practical Physically Based Shading in
❑ https://blog.selfshadow.com/publications/s2012-shading-
◼ Implementing the Disney BSDF
❑ https://schuttejoe.github.io/post/disneybsdf/
CG III (NPGR010) - J. Křivánek