Computer Graphics - BRDFs & Texturing - Hendrik Lensch - - PowerPoint PPT Presentation

computer graphics
SMART_READER_LITE
LIVE PREVIEW

Computer Graphics - BRDFs & Texturing - Hendrik Lensch - - PowerPoint PPT Presentation

Computer Graphics - BRDFs & Texturing - Hendrik Lensch Computer Graphics WS07/08 BRDFs and Texturing Overview Last time Radiance Light sources Rendering Equation & Formal Solutions Today Bidirectional


slide-1
SLIDE 1

Computer Graphics WS07/08 – BRDFs and Texturing

Computer Graphics

  • BRDFs & Texturing -

Hendrik Lensch

slide-2
SLIDE 2

Computer Graphics WS07/08 – BRDFs and Texturing

Overview

  • Last time

– Radiance – Light sources – Rendering Equation & Formal Solutions

  • Today

– Bidirectional Reflectance Distribution Function (BRDF) – Reflection models – Projection onto spherical basis functions – Shading

  • Next lecture

– Varying (reflection) properties over object surface: texturing

slide-3
SLIDE 3

Computer Graphics WS07/08 – BRDFs and Texturing

Reflection Equation - Reflectance

  • Reflection equation
  • BRDF

– Ratio of reflected radiance to incident irradiance

+

Ω

=

i i i i

  • i

r

  • ω

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

) , ( ) , ( ) , , (

i i

  • i
  • r

x dE x dL x f ω ω ω ω =

slide-4
SLIDE 4

Computer Graphics WS07/08 – BRDFs and Texturing

Bidirectional Reflectance Distribution Function

  • BRDF describes surface reflection for light incident from direction

(θi,φi) observed from direction (θο,φο)

  • Bidirectional

– Depends on two directions and position (6-D function)

  • Distribution function

– Can be infinite

  • Unit [1/sr]

i i i i

  • i

i

  • i
  • r

d x dL x dL x dE x dL x f ω θ ω ω ω ω ω ω cos ) , ( ) , ( ) , ( ) , ( ) , , ( = =

slide-5
SLIDE 5

Computer Graphics WS07/08 – BRDFs and Texturing

BRDF Properties

  • Helmholtz reciprocity principle

– BRDF remains unchanged if incident and reflected directions are interchanged

  • Smooth surface: isotropic BRDF

– reflectivity independent of rotation around surface normal – BRDF has only 3 instead of 4 directional degrees of freedom

) , ( ) , (

  • i

r i

  • r

f f ω ω ω ω = ) , , , (

i

  • i

r x

f ϕ ϕ θ θ −

slide-6
SLIDE 6

Computer Graphics WS07/08 – BRDFs and Texturing

BRDF Properties

  • Characteristics

– BRDF units [sr--1]

  • Not intuitive

– Range of values:

  • From 0 (absorption) to ∞ (reflection, δ -function)

– Energy conservation law

  • No self-emission
  • Possible absorption

– Reflection only at the point of entry (xi = xo)

  • No subsurface scattering

ϕ θ ω θ ω ω , 1 cos ) , , ( ∀ ≤

Ω

  • i
  • r

d x f

slide-7
SLIDE 7

Computer Graphics WS07/08 – BRDFs and Texturing

BRDF Measurement

  • Gonio-Reflectometer
  • BRDF measurement

– point light source position (θ,ϕ) – light detector position (θo ,ϕo)

  • 4 directional degrees of freedom
  • BRDF representation

– m incident direction samples (θ,ϕ) – n outgoing direction samples (θo ,ϕo) – m*n reflectance values (large!!!)

Stanford light gantry

slide-8
SLIDE 8

Computer Graphics WS07/08 – BRDFs and Texturing

Reflectance

  • Reflectance may vary with

– Illumination angle – Viewing angle – Wavelength – (Polarization, ...)

  • Variations due to

– Absorption – Surface micro-geometry – Index of refraction / dielectric constant – Scattering

Magnesium; λ=0.5μm Aluminum; λ=0.5μm Aluminum; λ=2.0μm

slide-9
SLIDE 9

Computer Graphics WS07/08 – BRDFs and Texturing

BRDF Modeling

  • Phenomenological approach

– Description of visual surface appearance

  • Ideal specular reflection

– Reflection law – Mirror

  • Glossy reflection

– Directional diffuse – Shiny surfaces

  • Ideal diffuse reflection

– Lambert’s law – Matte surfaces

slide-10
SLIDE 10

Computer Graphics WS07/08 – BRDFs and Texturing

Reflection Geometry

  • Direction vectors (normalize):

– N: surface normal – I: vector to the light source – V: viewpoint direction vector – H: halfway vector

H= (I + V) / |I + V|

– R(I): reflection vector

R(I)= I - 2(I•N)N

– Tangential surface: local plane

R(I) R(V) H V I N I I

  • (

(I I•

  • N

N) )N N

  • (

(I I•

  • N

N) )N N N R(I) I N R(I) V H R(V)

Top view

slide-11
SLIDE 11

Computer Graphics WS07/08 – BRDFs and Texturing

Ideal Specular Reflection

  • Angle of reflectance equal to angle of incidence
  • Reflected vector in a plane with incident ray and

surface normal vector

θ θo N R I θ = θo ϕ = ϕo + 180° ϕo ϕ

I

R+(-I) = 2 cosθ N = -2(I• N) N R(I) = I - 2(I• N) N

slide-12
SLIDE 12

Computer Graphics WS07/08 – BRDFs and Texturing

Mirror BRDF

  • Dirac Delta function δ(x)

– δ(x) : zero everywhere except at x=0 – Unit integral iff integration domain contains zero (zero otherwise)

  • Specular reflectance ρs

– Ratio of reflected radiance in specular direction and incoming radiance – Dimensionless quantity between 0 and 1

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

, ,

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

+

Ω

  • i

i s i i i i i i

  • m

r

  • i

i

  • i

i s i

  • m

r

L d L x f x L x f

L N R

θo θi

( ) ( ) ( )

i i

  • i

s

θ Φ θ Φ = θ ρ

slide-13
SLIDE 13

Computer Graphics WS07/08 – BRDFs and Texturing

Diffuse Reflection

  • Light equally likely to be reflected in any output

direction (independent of input direction)

  • Constant BRDF

– kd: diffuse coefficient, material property [1/sr]

E k d x L k d x L k x L k x f

d i i i i d i i i i d

  • d

i

  • d

r

= = = = =

∫ ∫

Ω Ω

ω θ ω ω θ ω ω ω ω cos ) , ( cos ) , ( ) , ( const ) , , (

,

N I Lo= const

slide-14
SLIDE 14

Computer Graphics WS07/08 – BRDFs and Texturing

  • Radiosity
  • Diffuse Reflectance
  • Lambert’s Cosine Law
  • For each light source

– Lr,d = kd Li cosθi = kd Li (I•N)

Lambertian Diffuse Reflection

d d

k E B π ρ = =

θi N I

L Lr,d

r,d

  • L

d L d x L B cos cos ) , ( π ω θ ω θ ω = = =

∫ ∫

Ω Ω

i i d d

E E B θ ρ ρ cos = =

slide-15
SLIDE 15

Computer Graphics WS07/08 – BRDFs and Texturing

Lambertian Objects

Ω ⋅ ∝ Φ d L0

Self-Luminous spherical Lambertian Light Source dΩ

Ω ⋅ ⋅ ∝ Φ d L ϕ cos

1

Eye-light illuminated Spherical Lambertian Reflector dΩ ϕ

slide-16
SLIDE 16

Computer Graphics WS07/08 – BRDFs and Texturing

Lambertian Objects II

⇒ Neither the Sun nor the Moon are Lambertian

  • Absorption in photosphere
  • Path length through photosphere

longer from the Sun’s rim

  • Surface covered with fine dust
  • Dust on TV visible best from

slanted viewing angle The Sun The Moon

slide-17
SLIDE 17

Computer Graphics WS07/08 – BRDFs and Texturing

“Diffuse” Reflection

  • Theoretical explanation

– Multiple scattering

  • Experimental realization

– Pressed magnesium oxide powder – Almost never valid at high angles of incidence

Paint manufacturers attempt to create ideal diffuse paints

slide-18
SLIDE 18

Computer Graphics WS07/08 – BRDFs and Texturing

Glossy Reflection

slide-19
SLIDE 19

Computer Graphics WS07/08 – BRDFs and Texturing

Glossy Reflection

  • Due to surface roughness
  • Empirical models

– Phong – Blinn-Phong

  • Physical models

– Blinn – Cook & Torrance

slide-20
SLIDE 20

Computer Graphics WS07/08 – BRDFs and Texturing

Phong Reflection Model

  • Cosine power lobe

– Lr,s = Li ks coske θRV

  • Dot product & power
  • Not energy conserving/reciprocal
  • Plastic-like appearance

R(I) R(V) H V I N I N R(I) V H

θ θRV

RV

θ θHN

HN

( )

e

k s i

  • r

V I R k x f ⋅ = ) ( ) , , ( ω ω

slide-21
SLIDE 21

Computer Graphics WS07/08 – BRDFs and Texturing

Phong Exponent ke

  • Determines size of highlight

( )

e

k s i

  • r

V I R k x f ⋅ = ) ( ) , , ( ω ω

slide-22
SLIDE 22

Computer Graphics WS07/08 – BRDFs and Texturing

Blinn-Phong Reflection Model

  • Blinn-Phong reflection model

– Lr,s = Li ks coske θHN – θRV ⇒ θHN – Light source, viewer far away – I, R constant: H constant

θHN less expensive to compute R(I) R(V) H V I N I N R(I) V H

θ θRV

RV

θ θHN

HN

( )

e

k s i

  • r

N H k x f ⋅ = ) , , ( ω ω

slide-23
SLIDE 23

Computer Graphics WS07/08 – BRDFs and Texturing

Phong Illumination Model

  • Extended light sources: l point light sources
  • Color of specular reflection equal to light source
  • Heuristic model

– Contradicts physics – Purely local illumination

  • Only direct light from the light sources
  • No further reflection on other surfaces
  • Constant ambient term
  • Often: light sources & viewer assumed to be far away

(Blinn) ) ( ) ( L Phong) ( ) ) ( ( ) ( L

, r , r

∑ ∑ ∑ ∑

⋅ + ⋅ + = ⋅ + ⋅ + =

l k l l l s l l d a i a l k l l l s l l d a i a

e e

N H L k N I L k L k V I R L k N I L k L k

slide-24
SLIDE 24

Computer Graphics WS07/08 – BRDFs and Texturing

Microfacet Model

  • Isotropic microfacet collection
  • Microfacets assumed as perfectly smooth reflectors
  • BRDF

– Distribution of microfacets

  • Often probabilistic distribution of orientation or V-groove assumption

– Planar reflection properties – Self-masking, shadowing

slide-25
SLIDE 25

Computer Graphics WS07/08 – BRDFs and Texturing

Ward Reflection Model

  • BRDF

฀ σ standard deviation (RMS) of surface slope – Simple expansion to anisotropic model (σx, σy) – Empirical, not physics-based – Inspired by notion of reflecting microfacets – Convincing results – Good match to measured data

2 2 2

4 ) / ) , ( tan exp( ) )( ( 1 πσ σ N H N V N I ρ π ρ f

s d r

∠ −

  • +

=

N I V

viewer

H

θ

microfacet

surface

slide-26
SLIDE 26

Computer Graphics WS07/08 – BRDFs and Texturing

Physics-inspired BRDFs

  • Notion of reflecting microfacet
  • Specular reflectivity of the form

– D : statistical microfacet distribution – G : geometric attenuation, self-shadowing – F : Fresnel term, wavelength, angle dependency of reflection along mirror direction – N•V : flaring effect at low angle of incidence

  • Cook-Torrance model

– F : wavelength- and angle-dependent reflection – Metal surfaces

V N F G D f

i r

⋅ ⋅ ⋅ = π θ λ

λ

) , (

slide-27
SLIDE 27

Computer Graphics WS07/08 – BRDFs and Texturing

Cook-Torrance Reflection Model

  • Cook-Torrance reflectance model is based on the

microfacet model. The BRDF is defined as the sum of a diffuse and specular components: where ks and kd are the specular and diffuse coefficients.

  • Derivation of the specular component ρs is based on a

physically derived theoretical reflectance model

1 ; ≤ + + =

s d s s d d r

k k k k f ρ ρ

slide-28
SLIDE 28

Computer Graphics WS07/08 – BRDFs and Texturing

Cook-Torrance Specular Term

  • D : Distribution function of microfacet orientations
  • G : Geometrical attenuation factor

– represents self-masking and shadowing effects of microfacets

  • Fλ : Fresnel term

– computed by Fresnel equation – relates incident light to reflected light for each planar microfacet

  • N·V : Proportional to visible surface area
  • N·I : Proportional to illuminated surface area

) )( ( I N V N DG F

s

⋅ ⋅ = π ρ

λ

N I V

viewer

H θ microfacet

surface

λ λ

)) ( 1 ( N V F ⋅ + ≈

slide-29
SLIDE 29

Computer Graphics WS07/08 – BRDFs and Texturing

Microfacet Distribution Functions

  • Isotropic Distributions

฀ α : angle to average normal of surface – Characterized by half-angle β

  • Blinn
  • Torrance-Sparrow
  • Beckmann

– m : average slope of the microfacets – Used by Cook-Torrance

( )

[ ]2

/ tan 4 2 cos

4 1

m

e m D

α

α α

=

( )

2

2 ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ −

=

α β

α e D

( )

α α

β cos ln 2 ln

cos = D

( )

2 1 = β D

( ) ( )

H N⋅ = ⇒ α α ω D D

N I V

viewer

H θ microfacet

surface

slide-30
SLIDE 30

Computer Graphics WS07/08 – BRDFs and Texturing

Beckman Microfacet Distribution Function

m=0.2 m=0.6

slide-31
SLIDE 31

Computer Graphics WS07/08 – BRDFs and Texturing

Geometric Attenuation Factor

  • V-shaped grooves
  • Fully illuminated and visible
  • Partial masking of reflected light
  • Partial shadowing of incident light

⎭ ⎬ ⎫ ⎩ ⎨ ⎧ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ = ) ( ) )( ( 2 , ) ( ) )( ( 2 , 1 min H V I N H N H V V N H N G 1 = G ) ( ) )( ( 2 H V V N H N G ⋅ ⋅ ⋅ = ) ( ) )( ( 2 H V I N H N G ⋅ ⋅ ⋅ =

slide-32
SLIDE 32

Computer Graphics WS07/08 – BRDFs and Texturing

Comparison Phong vs. Torrance

slide-33
SLIDE 33

Computer Graphics WS07/08 – BRDFs and Texturing

Texturing

slide-34
SLIDE 34

Computer Graphics WS07/08 – BRDFs and Texturing

Simple Illumination

  • No illumination
  • Constant colors
  • Parallel light
  • Diffuse reflection
slide-35
SLIDE 35

Computer Graphics WS07/08 – BRDFs and Texturing

Standard Illumination

  • Parallel light
  • Specular reflection

Object properties constant over surface

  • Multiple local light sources
  • Different BRDFs
slide-36
SLIDE 36

Computer Graphics WS07/08 – BRDFs and Texturing

Texturing

Locally varying

  • bject characteristics
  • 2D Image Textures
  • Shadows
  • Bump-Mapping
  • Reflection textures
slide-37
SLIDE 37

Computer Graphics WS07/08 – BRDFs and Texturing

Texture-modulated Quantities

  • Modulation of object surface properties
  • Reflectance

– Color (RGB), diffuse reflection coefficient kd – Specular reflection coefficient ks

  • Opacity (α)
  • Normal vector

– N(P)= N(P+ t N) or N= N+dN – „Bump mapping“ or „Normal mapping“

  • Geometry

– P= P + dP – „Displacement mapping“

  • Distant illumination

– “Environment mapping“, “Reflection mapping“

slide-38
SLIDE 38

Computer Graphics WS07/08 – BRDFs and Texturing

Texture Mapping Transformations

Texture Space (2-D) Object Space (3-D) Image Space (2-D)

Texture-Surface Transformation Viewing/Projection Transformation The texture is mapped onto a surface in 3-D object space, which is then mapped to the screen by the viewing projection. These two mappings are composed to find the overall 2-D texture space to 2-D image space mapping, and the intermediate 3-D space is often

  • forgotten. This simplification suggests texture mapping’s close ties with

image warping and geometric distortion. Texture space (u,v) Object space (xo,yo,zo) Screen space (x,y)

slide-39
SLIDE 39

Computer Graphics WS07/08 – BRDFs and Texturing

2D Texturing

  • 2D texture mapped onto object
  • Object projected onto 2D screen
  • 2D→2D: warping operation
  • Uniform sampling ?
  • Hole-filling/blending ?
slide-40
SLIDE 40

Computer Graphics WS07/08 – BRDFs and Texturing

Texture Mapping in a Ray Tracer

  • approximation:

– ray hits surface – surface location corresponds to coordinate inside a texture

slide-41
SLIDE 41

Computer Graphics WS07/08 – BRDFs and Texturing

Texture Mapping in a Ray Tracer

  • approximation:

– ray hits surface – surface location corresponds to coordinate inside a texture

slide-42
SLIDE 42

Computer Graphics WS07/08 – BRDFs and Texturing

Interpolation 1D

  • How to interpolate the color of the pixel?

c3 c2 c0 c1

slide-43
SLIDE 43

Computer Graphics WS07/08 – BRDFs and Texturing

Interpolation 1D

  • How to interpolate the color of the pixel?

s 1-s

c3 c2 c0 c1

slide-44
SLIDE 44

Computer Graphics WS07/08 – BRDFs and Texturing

Interpolation 2D

  • How to interpolate the color of the pixel?

s 1-s

c3 c2 c0 c1

slide-45
SLIDE 45

Computer Graphics WS07/08 – BRDFs and Texturing

Interpolation 2D

  • How to interpolate the color of the pixel?
  • 1D: i0 = (1-t)c0 + tc1

i1 = (1-t)c3 + tc2

  • 2D: c = (1-s) i0 + s i1

t t 1-t s 1-s

c3 c2 c0 c1