- BRDFs & Texturing -
Hendrik Lensch
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
Computer Graphics WS07/08 – BRDFs and Texturing Reflectionω Equation - Reflectance ω • Reflection equation ω L (x, ) = f ( , x, ) L (x,ω ) cosθ dω o o ∫ r i o i i i i Ω+ • BRDF – Ratio of reflected radiance to incident irradiance
ω dLo (x,ωo ) fr ( o , x,ωi ) = dEi (x,ωi )
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]
ω dL (ωx,ω ) f ( , x,ω ) = o o r o i dE (x, ) i i ω dLω (x, ) = o oθ dLi (x, i )cos i dωi
Computer Graphics WS07/08 – BRDFs and Texturing BRDF Properties • Helmholtz reciprocity principle – BRDF remains unchanged if incident and reflected directions are interchanged
fr (ωo ,ωi ) = fr (ωi ,ωo )
• Smooth surface: isotropic BRDF – reflectivity independent of rotation around surface normal – BRDF has only 3 instead of 4 directional degrees of freedom
fr (x,θi ,θo ,ϕo −ϕi )
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 ω f ( , x, )cos d ≤1 ∀ θ,ϕ ∫ r o i o o Ω
– Reflection only at the point of entry (xi = xo) • No subsurface scattering
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
Computer Graphics WS07/08 – BRDFs and Texturing Reflectance
• Reflectance may vary with – Illumination angle – Viewing angle – Wavelength – (Polarization, ...) • Variations due to Aluminum; λ=2.0μm – Absorption – Surface micro-geometry – Index of refraction / dielectric constant –Scattering Aluminum; λ=0.5μm
Magnesium; λ=0.5μm 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
Computer Graphics WS07/08 – BRDFs and Texturing Reflection Geometry
• Direction vectors (normalize): N –N: surface normal -(I•N)N –I: vector to the light source R(I) –V: viewpoint direction vector I –H: halfway vector -(I•N)N H= (I + V) / |I + V| –R(I): reflection vector R(I)= I -2(I•N)N I – Tangential surface: local plane Top view R(V)
H N R(I) N I R(I) I R(V) V V H
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
R+(-I) = 2 cosθ N = -2(I• N) N R(I) = I -2(I• N) N
I N R ϕ I o θ ϕ o θ
θ = θo ϕ = ϕo + 180°
Computer Graphics WS07/08 – BRDFs and Texturing Mirrorω BRDF • Dirac Delta functionω δ(x) – δ(x) : zero everywhereω except at x=0θ θ δ ϕ – Unit integralω iff integration domaiϕ n contains zero (zeroϕ otherwise) ω θ π ρ δ (cosθi − cosθωo ) fr,m ( o , x, i ) = s (θi )⋅ ⋅ ρ( i − o ± ) cos i θ θ ϕ L (x, ) = f ( , x, )L ( , )cos d = ( )L ( , ±π ) o o ∫ r,m o i i i i i i s i i o o Ω+
• Specular reflectance ρs – Ratio of reflected radiance in specular N direction and incoming radiance L R – Dimensionless quantity between 0 and 1
Φo (θo ) θi θo ρs ()θi = () Φi θi
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 ω
fr,d (ω o , x,ω i ) = kd = constω θ L (x, ) = k L (x, )cos d = k L (x, )cos dω = k E o o ∫ d i i i i d ∫ i i i i d Ω Ω –kd: diffuse coefficient, material property [1/sr]
I N Lo= const
Computer Graphics WS07/08 – BRDFs and Texturing ω θ Lambertian Diffuse ωReflection θ ω B = L (x, )cos d = L cos d = π L • Radiosity ∫ o o o o o ∫ o o o Ω ρ Ω B • Diffuse Reflectance = = π k d E d • Lambert’s Cosine Law B = ρd E = ρd Ei cosθi
• For each light source I –Lr,d = kd Li cosθi = kd Li (I•N) N
Lr,d
θi
Computer Graphics WS07/08 – BRDFs and Texturing Lambertian Objects
Self-Luminous Eye-light illuminated spherical Lambertian Light Source Spherical Lambertian Reflector
Φ0 ∝ L0 ⋅dΩ Φ1 ∝ L0 ⋅cosϕ ⋅dΩ
ϕ dΩ dΩ
Computer Graphics WS07/08 – BRDFs and Texturing Lambertian Objects II The Sun The Moon
• Absorption in photosphere • Surface covered with fine dust • Path length through photosphere • Dust on TV visible best from longer from the Sun’s rim slanted viewing angle ⇒ Neither the Sun nor the Moon are Lambertian
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
Computer Graphics WS07/08 – BRDFs and Texturing Glossy Reflection
Computer Graphics WS07/08 – BRDFs and Texturing Glossy Reflection
• Due to surface roughness • Empirical models – Phong – Blinn-Phong • Physical models –Blinn – Cook & Torrance
Computer Graphics WS07/08 – BRDFs and Texturing Phong Reflection Model • Cosine power lobe ω ke fr ( o , x,ωi ) = ks (R(I)⋅V ) ke –Lr,s = Li ks cos θRV • Dot product & power • Not energy conserving/reciprocal • Plastic-like appearance
R(V) θ H N HN R(I) N I θRV I R(I) V V H
Computer Graphics WS07/08 – BRDFs and Texturing Phong Exponent ke ω ke fr ( o , x,ωi ) = ks (R(I)⋅V ) • Determines size of highlight
Computer Graphics WS07/08 – BRDFs and Texturing Blinn-Phong Reflection Model • Blinn-Phong reflection model ω ke fr ( o , x,ωi ) = ks (H ⋅ N ) ke –Lr,s = Li ks cos θHN – θRV ⇒θHN – Light source, viewer far away –I, R constant: H constant
θHN less expensive to compute
R(V) θ H N HN R(I) N I θRV I R(I) V V H
Computer Graphics WS07/08 – BRDFs and Texturing Phong Illumination Model • Extended light sources: l point light sources
ke Lr = ka Li,a + kd ∑ Ll (Il ⋅ N) + ks ∑ Ll (R(Il )⋅V ) (Phong) l l
ke Lr = ka Li,a + kd ∑∑Ll (Il ⋅ N) + ks Ll (Hl ⋅ N) (Blinn) l l • 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
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
Computer Graphics WS07/08 – BRDFs and Texturing Ward Reflection Model • BRDF ρ 1 exp(− tan 2 ∠(H, N) / 2 ) f = d + ρ • r π s (I • N)(V • N) 4πσ 2 σ σ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 N
viewer H V θ I
surface microfacet
Computer Graphics WS07/08 – BRDFs and Texturing Physics-inspired BRDFs • Notion of reflecting microfacet • Specular reflectivity of the form D ⋅G ⋅ F (λ,θ ) f = λ i r π N ⋅V – 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
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:
fr = kd ρd + ks ρs ; kd + ks ≤1
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
Computer Graphics WS07/08 – BRDFs and Texturing Cook-Torrance Specular Term
N ρ F DG = λ viewer V H θ s π (N ⋅V )(N ⋅ I) I surface microfacet
• 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 F ≈ (1+ (V ⋅ N)) – relates incident light to reflected light for each planar microfacet • N·V : Proportional to visible surface area • N·I : Proportional to illuminated surface area
Computer Graphics WS07/08 – BRDFs and Texturing Microfacet Distribution Functions
• Isotropic Distributions D(ω)⇒ D(α ) α = N ⋅H