phong model - graphics.stanford.edu

15
Page 1 CS348B Lecture 11 Pat Hanrahan, Spring 2004 Reflection Models Last lecture Reflection models The reflection equation and the BRDF Ideal reflection, refraction and diffuse Today Phong and microfacet models Gaussian height field on surface Self-shadowing Torrance-Sparrow model Next Anisotropic: Grooves and hair Translucency: Skin Phong Model

Upload: others

Post on 29-Dec-2021

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Phong Model - graphics.stanford.edu

Page 1

CS348B Lecture 11 Pat Hanrahan, Spring 2004

Reflection Models

Last lecture

Reflection models

The reflection equation and the BRDF

Ideal reflection, refraction and diffuse

Today

Phong and microfacet models

Gaussian height field on surface

Self-shadowing

Torrance-Sparrow model

Next

Anisotropic: Grooves and hair

Translucency: Skin

Phong Model

Page 2: Phong Model - graphics.stanford.edu

Page 2

CS348B Lecture 11 Pat Hanrahan, Spring 2004

Reflection Geometry

ˆ ˆcos iθ = •L N

ˆ ˆcos rθ = •E N

ˆ ˆˆ ˆ ˆ ˆcos ( ) ( )sθ = • = •

N NE R L R E L

ˆ ˆcos sθ ′ = •H N

ˆ ˆcos gθ = •E L

L

HN

ˆ ˆ( )N

R E

ˆˆ ˆ( )

NR L L ˆ

ˆ ˆ( )N

R LN

H E

ˆ ˆˆ

ˆ ˆ+

=+

L EH

L E

CS348B Lecture 11 Pat Hanrahan, Spring 2004

Phong Model

E

L

NR(L)

( )ˆˆ ˆ( )

s•

NE R L

E

L

N R(E)

( )ˆˆ ˆ( )

s•

NL R E

( ) ( )ˆ ˆ ˆ ˆ( ) ( )s s

• = •E R L L R EReciprocity:

Distributed light source!

Page 3: Phong Model - graphics.stanford.edu

Page 3

CS348B Lecture 11 Pat Hanrahan, Spring 2004s

Phong Model

Mirror Diffuse

CS348B Lecture 11 Pat Hanrahan, Spring 2004

Energy normalization

Energy normalize Phong Model

( )

( )2

2

2

ˆ( )

ˆˆ( )

ˆ ˆ( ) ( ) cos

ˆ ˆ( )

2cos

1

s

r i i

H

s

ir

H

s

H

H d

d

ds

ρ ω θ ω

ω

πθ ω

→ = •

≤ •

≤ =+

NN

NR

L R E

L R E

Page 4: Phong Model - graphics.stanford.edu

Page 4

Microfacet Model

CS348B Lecture 11 Pat Hanrahan, Spring 2004

Bouguer’s “little faces”

P. Bouguer, Treatise on Optics, 1760

Page 5: Phong Model - graphics.stanford.edu

Page 5

CS348B Lecture 11 Pat Hanrahan, Spring 2004

Reflection of the Sun from the Sea

Minnaert, Light and Color in theOutdoors, p. 28

α

CS348B Lecture 11 Pat Hanrahan, Spring 2004

Reflection Angles

cosh r θ=

PH H′

βα

γδ

α β γ δ+ = +

β α δ− =2γ α⇒ =

δ

Side viewrθ

βα

Assume L and E are at the same height h

L E

Page 6: Phong Model - graphics.stanford.edu

Page 6

CS348B Lecture 11 Pat Hanrahan, Spring 2004

Reflection Angles

H H′

αFront view

b

tanb

hα =

tan

tan

tan cos

b

rh

r

ψ

α

α θ

=

=

=

L

cosh r θ=

P

CS348B Lecture 11 Pat Hanrahan, Spring 2004

Analysis on the Sphere

N

Lˆˆ( )

NR L

α

2γ α=

γ

tan tan cosψ α θ=

Page 7: Phong Model - graphics.stanford.edu

Page 7

CS348B Lecture 11 Pat Hanrahan, Spring 2004

Solid Angle Distributions

iθ ′

rθ ′

( )

( )

sin

sin 2 2

2sin cos 2

4cos sin

4cos

r r r r

i i i

i i i i

i i i i

i h

d d d

d d

d d

d d

d

ω θ θ ϕ

θ θ ϕ

θ θ θ ϕ

θ θ θ ϕ

θ ω

=

′′=

′ ′ ′=

′ ′ ′=

′=

1

4 cosh

r i

d

d

ωω θ

=′

2

r i r

i

θ θ θ

θ

′ ′= +

′=

r iϕ ϕ=

r iθ θ′ ′=

CS348B Lecture 11 Pat Hanrahan, Spring 2004

Microfacet Distributions

iθ ′rθ ′

N HL

E

Microfacet

2

( )cosh h h

H

dA d dAω θ ω =∫

Total projected area

( )hdA ωArea distribution

( ) ( )/h hD dA dAω ω≡Microfacet distribution

2

( )cos 1h h h

H

D dω θ ω =∫

Probability distribution

Page 8: Phong Model - graphics.stanford.edu

Page 8

CS348B Lecture 11 Pat Hanrahan, Spring 2004

Microfacet Distribution Functions

Isotropic distributions

Characterize by half-angle

Examples:

Blinn

Torrance-Sparrow

Trowbridge-Reitz

11( ) coscD α α= 1

ln 2

ln cosc

β=

22( )

2 ( ) cD e αα −=2

2c

β=

23

3 2 23

( )(1 )cos 1

cD

α=

− −122

3 2

cos 1

cos 2c

ββ

−=

( ) ( )hD Dω α⇒1

( )2

D β =β

CS348B Lecture 11 Pat Hanrahan, Spring 2004

Gaussian Rough Surface

Gaussian distribution

of heights

Gaussian distribution

of slopes

Beckmann

2

221( )

2

z

p z e σ

πσ

−=

2

2

tan

2 2

1( )

cosmD e

m

α

απ α

−=

2m

στ

=

σ

τ

θz

x

Page 9: Phong Model - graphics.stanford.edu

Page 9

Torrance-Sparrow Model

CS348B Lecture 11 Pat Hanrahan, Spring 2004

Torrance-Sparrow Model

( ) ( )h hdA D dAω ω=

( )cos ( )

( )cos ( )h i i i i h h

i i i i h h

d L d dA d

L d D dAd

ω θ ω ω ωω θ ω ω ω

′ ′Φ =′ ′=

( )cos

( )cos ( )r i r r r

i i i i h h

dL d dA

L d D d dA

ω ω θ ωω θ ω ω ω

∴ →′ ′=

r hd dΦ = Φ

( )cosr r i r r rd dL d dAω ω θ ωΦ = →ˆ ˆcos iθ = •L Nˆ ˆcos iθ ′ = •L H

iθ ′N H

L

Page 10: Phong Model - graphics.stanford.edu

Page 10

CS348B Lecture 11 Pat Hanrahan, Spring 2004

Torrance-Sparrow Model

( ) ( )

( )( )

( )

( )cos ( )

cos ( )cos

( )cos

cos cos

( )

4cos cos

r i rr i r

i i

i i i i h h

r r i i i i

h hi

i r r

h

i r

dLf

dE

L d D d dA

d dA L d

D d

d

D

ω ωω ωω

ω θ ω ω ωθ ω ω θ ω

ω ωθθ θ ωωθ θ

→→ ≡

′ ′=

′=

=

N HL

E

i id dω ω′ =

( )cos

( )cos ( )r i r r r

i i i i h h

dL d dA

L d D d dA

ω ω θ ωω θ ω ω ω→

′ ′=

Self-Shadowing

Page 11: Phong Model - graphics.stanford.edu

Page 11

CS348B Lecture 11 Pat Hanrahan, Spring 2004

Shadows on Rough Surfaces

Without self-shadowing With self-shadowing

CS348B Lecture 11 Pat Hanrahan, Spring 2004

Self-Shadowing Function

Probability of shadowing

( )2 2/ 222 ( ) erfc / 2mm

e mµµ µπ µ

− Λ = −

( )11 erfc / 2

2( )

1 ( )

mS

µθ

µ

− =+ Λ

σ

τ

θz

x

Page 12: Phong Model - graphics.stanford.edu

Page 12

CS348B Lecture 11 Pat Hanrahan, Spring 2004

Self-Shadowing Function

From Smith, 1967

W=m

CS348B Lecture 11 Pat Hanrahan, Spring 2004

Self-Consistency Condition

The sum of the areas of the illuminated surface projected onto the plane normal to the direction of incidence is independent of the roughness of the surface, and equal to the projected area of the underlying mean plane.

( ) ( )cos cosS D d αθ α θ ω θ′ =∫

Page 13: Phong Model - graphics.stanford.edu

Page 13

CS348B Lecture 11 Pat Hanrahan, Spring 2004

Torrance-Sparrow Theory

( )

( ) ( ) ( ) ( )

4 cos cos

r i r

i i r

i r

f

F S S D

ω ωθ θ θ α

θ θ

→′

=

CS348B Lecture 11 Pat Hanrahan, Spring 2004

Torrance-Sparrow Comparison

Magnesium Oxide

Page 14: Phong Model - graphics.stanford.edu

Page 14

CS348B Lecture 11 Pat Hanrahan, Spring 2004

Torrance-Sparrow Comparison

Aluminum

Self-Shadowing

V-Groove Model

Page 15: Phong Model - graphics.stanford.edu

Page 15

CS348B Lecture 11 Pat Hanrahan, Spring 2004

Self-Shadowing: V-Groove Model

Assumptions (Torrance-Sparrow)

1. Symmetric, longitudinal, isotropically-distributed

2. Upper edges lie in plane

1aG =

ˆ ˆ ˆ ˆ2( )( )ˆ ˆ( )bG

• •=

•N H N E

H E

ˆ ˆ ˆ ˆ2( )( )ˆ ˆ( )cG

• •=

•N H N L

H L

min( , , )a b cG G G G=

CS348B Lecture 11 Pat Hanrahan, Spring 2004

Self-Shadowing: V-Groove Model

1

sin1

sinˆ ˆ ˆ ˆ ˆ ˆ ˆ ˆ2( )( )

ˆ ˆ

ˆ ˆ ˆ ˆ2( )( )ˆ ˆ

mG

lm

l

= −

= −

• − • + • •=

•• •

=•

H E H E N H N EH E

N H N EH E

α

m l

sin

sin

m m

l l=

sin cos

cos sini

i

l

l

θθ′=′=

( )( )

2

2

sin sin 2

sin cos 2 cos sin 2

cos cos 2 sin sin 2

cos (1 2 sin ) sin 2 cos sin

cos (1 2 cos ) sin 2 cos sin

cos 2 cos cos cos sin sin

cos 2 cos cos

cos 2 cos cos

ˆ

i i

i i

i i

i i i

i i

i r

m l

l l

ψψ ψ

θ ψ θ ψ

θ ψ θ ψ ψ

θ α θ α α

θ α α θ α θ

θ α α θ

θ α θ

= += +

′ ′= +

′ ′= − +

′ ′= − +

′ ′ ′′= − −

′ ′= − +

′= −

= •H ( ) ( )ˆ ˆ ˆ ˆ ˆ2− • •E N H N E

iθ ′

ψ ψsin cos

cos sin

ψ αψ α==