GAMES101 Lecture 17 - Materials and Appearances

GAMES101_Lecture_17.pdf

I. Materials and Appearances

img-27

Textures and appearances are closely related:

Some of the features from natural materials:

 

img-1

The term material is equivalent to BSDF.

Bidirectional Scattering Distribution Function, BSDF

 

Diffuse/Lambertian Material

img-2

img-3

From [Mitsuba render, Wenzel Jakob, 2010

Light is equally reflected in each output direction.

img-28

Suppose the incident lighting is uniform in radiance, and without self-emission we have:

Lo(ωo)=H2frLi(ωi)cosθidωi=frLiH2cosθidωi(since dωi=dA=sinθdθdϕ)=πfrLi

If the material absorbs no light, then fr=1/π.

On lambertian material we have

fr=ρπ,0ρ1

in which ρ is called albedo, or color.

 

Glossy Material

img-4

img-5

From [Mitsuba render, Wenzel Jakob, 2010

 

Ideal Reflective/Refractive Material

img-6

img-17

From [Mitsuba render, Wenzel Jakob, 2010

 

Perfect Specular Reflection

img-9

From PBRT

img-8

ωo+ωi=2cosθ n=2(ωin)n
ωo=ωi+2(ωin)n

θ and ϕ are obtained from the local coordinate system.

BRDFs for the perfect specular reflection are difficult to write.

 

Specular Refraction

Light refracts when it enters a new medium.

img-29

Snell's Law

Transmitted angle depends on

img-10

ηisinθi=ηtsinθt
MediumVaccumAir (sea level)Water (20°C)GlassDiamond
η1.01.000291.3331.5-1.62.42

Index of frefraction is wavelength dependent. These are averages.

 

Law of Refraction

ηisinθi=ηtsinθtcosθt=1sin2θt=1(ηiηt)2sin2θi(1)=1(ηiηt)2(1cos2θi)

Definition: Total internal reflection: When light is moving from a more optically dense medium to a less optically dense medium, i.e.,

ηiηt>1

then light incident on boundary from large enough angle will not exit the medium. The critical angle can be computed from equation 1 by substituting θt=π/2 into the equation.

 

 

 

Fresnel Reflection/Term

Reflectance depends on incident angle (and polarization of light).

img-11

This example: reflectance increases with grazing angle [Lafortune et al. 1997]

Fresnel Term

Dielectric, η=1.5:

img-12

 

Conductor:

img-13

 

Formulae

Accurate: polarization taken into consideration

n is related to η, the intrinsic property of the material.

RS=|n1cosθin2cosθtn1cosθi+n2cosθt|2=|n1cosθin21(n1n2sinθi)n1cosθi+n21(n1n2sinθi)|2
RP=|n1cosθtn2cosθin1cosθt+n2cosθi|2=|n11(n1n2sinθi)n2cosθin11(n1n2sinθi)+n2cosθi|2
Reff=12(RS+RP)

Approximate: Schlick's approximation

R(θ)=R0+(1R0)(1cosθ)5
R0=(n1n2n1+n2)2

 

Microfacet Material

State of art.

img-14

Microfacet Theory

img-15

Rough surface:

 

Microfacet: individual elements of surface act like mirrors

Key: The distribution of their normals. Each microfacet has its own normal.

img-20

Microfacet BRDF:

f(ωi,ωo)=F(ωi,h)G(ωi,ωo,h)D(h)4(n,ωi)(n,ωo)

In which:

 

Isotropic/Anisotropic Materials (BRDFs)

img-21

Key: Directionality of the underlying surface.

img-22

 

img-23

Anisotropic: Reflection depends on azimuthal angle ϕ

fr(θi,ϕi;θr,ϕr)fr(θi,θr,ϕrϕi)

 

II. Further on BRDFs

Properties of BRDFs

 

Measuring BRDFs

Target:

 

General Approach

img-31

 

Gonioreflectometer:

img-32

Spherical gantry at UCSD

 

Improving Efficiency

 

Challenges

 

Representing Measured BRDFs

Desirable qualities:

 

Tabular Representation

MERL BRDF Database [Matusik et al. 2004], 90×90×180 measurements

Store regularly-spaced samples in (θi,θo,|ϕiϕo|)

 

Appendix A: Microfacet Models

Reference: Microfacet Models (pbr-book.org)

Introduction

Many geometric-optics-based approaches to modeling surface reflection and transmission are based on the idea that rough surfaces can be modeled as a collection of small microfacets. They are often modeled as heightfields, where the distribution of facet orientations is described statistically.

img-33

 

The microfacet-based BRDF models work by statistically modeling the scattering of light from a large collection of microfacets.

 

The two main components of microfacet models are:

 

Three important geometric effects to consider with Microfacet Reflection Models:

img-34

 

Oren-Nayar Diffuse Reflection

Idea: Real-world objects do not exhibit perfect Lambertian reflection.

 

Approximation:

fr(ωi,ωo)=Rπ(A+Bmax(0,cos(ϕi,ϕo))sinαtanβ)

where if σ is in radians,

A=1σ22(σ2+0.33)
B=0.45σ2σ2+0.09
α=max(θi,θo)
β=min(θi,θo)

 

Microfacet Distribution Functions

One important characteristics of a microfacet surface is represented by the distribution function D(ωh), which gives the differential area of microfacets with the surface normal ωh. In pbrt, microfacet distribution functions are defined in the same BSDF coordinate system as BxDFs. As such,

Microfacet distribution functions must be

Beckmann Distribution

A widely used microfacet distribution function based on a Gaussian distribution of microfacet slops is due to Beckmann and Spizzichino.

The traditional definition of the Beckmann-Spizzichino model is

D(ωh)=etan2θh/α2πα2cos4θh

where if σ is the RMS slope of the microfacets, then α=2σ.

The anisotropic microfacet distribution function is

D(ωh)=etan2θh(cos2ϕh/αx2+sin2ϕh/αy2)παxαycos4θh

 

When programming, the algorithm directly translates the above equation, but pay special attention to the following issues:

 

Trowbridge-Reitz Distribution

Anisotropic variant given by

D(ωh)=1παxαycos4θh(1+tan2θh(cos2ϕh/αx2+sin2ϕh/αy2))2

In comparison to the Beckmann-Spizzichino model,

img-36

Usually, we specify αx and αy by roughness, which is between [0,1], and value close to zero correspond to near-perfect specular reflection.

 

Masking and Shadowing

Smith's Masking-Shadowing Function: Some microfacets will be invisible from a given viewing or illumination direction because,

  1. They are back-facing

  2. Some of the forward-facing microfacet area will be hidden due to being shadowed by back-facing microfacets.

This is described by

G1(ω,ωh)

which gives the fraction of microfacets with normal ωh that are visible from direction ω.

 

Normalization Constraint: A differential area dA, as shown in Figure 8.17, has area dAcosθ when viewed from a direction ω that makes an angle θ with the surface normal. The area of visible microfacets seen from this direction must also be equal to dAcosθ, which leads to a normalization constraint for G1:

cosθ=H2(n)G1(ω,ωh)max(0,ωωh)D(ωh)dωh

img-37

 

Compute G1 using Λ(ω): Because the microfacets form a heightfield, every back-facing microfacet shadows a forward-facing microfacet of equal projected area in the direction ω. If A+(ω) is the projected area of forward-facing microfacets as seen from the direction ω and A(ω) is the projected area of backward-facing microfacets, then cosθ=A+(ω)A(ω).

We can thus alternatively write the masking-shadowing function as the ratio of visible microfacets area to total forward-facing microfacet area:

G1(ω)=A+(ω)A(ω)A+(ω).

Shadowing-masking functions are traditionally expressed in terms of an auxiliary function Λ(ω), which measures invisible masked microfacet area per visible microfacet area.

Λ(ω)=A(ω)A+(ω)A(ω)=A(ω)cosθ

After some algebra we have

G1(ω)=11+Λ(ω).

Specifying Λ(ω): The microfacet distribution alone doesn't impose enough conditions to imply a specific Λ(ω) function.

 

Computing the interpolated α for anisotropic distributions: It is the easiest to compute Λ(ω) by taking their corresponding isotropic function and stretching the underlying surface according to the αx and αy values. Equivalently, one can compute an interpolated α value for the direction of interest and use that with the isotropic function.

α=cos2ϕhαx2+sin2ϕhαy2

img-38

 

Computing G(ωo,ωi): This function gives the fraction of microfacets in a differential area that are visible from both directions ωo and ωi. Defining G requires some additional assumptions. For starters,

 

The Torrance-Sparrow Model

fr(ωo,ωi)=D(ωh)G(ωo,ωi)Fr(ωo)4cosθocosθi

For very detailed derivation, refer to the PBR book. Basically, we assume that individual microfacets are perfectly specular, and therefore only those that have the direction of their normals matched with the orientation of ωh will reflect light.