Phong Illumination Model
A local illumination model EECS 487: Interactive • one bounce: light → surface → viewer
Lighting a single point Computer Graphics At the point: n Lecture 16: : surface normal (orientation of surface) l: light vector (surface to light) n • Phong Illumination Model v: viewing vector (surface to eye) ϕ • Shading θ: light angle of incidence θ l ϕ: viewing angle v
Phong Illumination Model Surface Reflection Coefficients Approximate surface color as Light sources: sum of three components: Approximate BRDFs: not physically based sd diffuse light intensity • an ideal diffuse component ss specular light intensity • a glossy/blurred specular component Modify surface color by changing reflection sa ambient light intensity • an ambient term coefficients based on: • material type m ambient color reflection • surface finish a m diffuse color reflection + = • texture maps d • what looks good ms specular color reflection
• artistic license mshi shininess (blurriness) • trial and error me emissive color intensity • personal library + = Diffuse Example Ideal Diffuse Reflectance Ideal diffuse surface reflects light equally in all directions, according to Lambert's cosine law: • amount of light energy that falls on surface and gets Where is the light? reflected is proportional to the incidence angle, θ • perceived brightness (reflectance) is view independent Where’s the normal direction at the brightest point? θ
Durand
Ideal Diffuse Reflectance Ideal Diffuse Model Amount of light energy that falls At the microscopic level, an ideal on surface is proportional to diffuse surface is a very rough surface incidence angle, θ: • microfacets are oriented in any which way cd = sd md cos θ • examples: chalk, clay, surface of moon Curless For normalized n and l: c = s m max((n•l), 0) d d d RTR2 • (n•l) < 0 cos θ < 0 θ > 90º, light source is behind surface • why must n and l be normalized? l n u·v θ u·v = u v cosθ ⇒ cosθ = u v Durand Diffuse Reflectance and Viewing Angle Ideal Specular/Mirror Reflectance
Lambert’s Cosine Law: amount of light energy that falls on Accounts for highlight seen on objects surface and gets reflected is proportional to incidence angle, θ i with smooth, shiny surfaces, such as: • cos θi = dot product of light vector with normal (both normalized) • metal • polished stone Shouldn’t the amount of energy reflected also be proportional • plastics to viewing angle, θ ? r • apples • no, whereas larger θi means • n skin energy arriving over area Recall: dA cos θi is spread across the sin (π/2 – θ) = cos θ larger area dA, larger θr simply means collecting energy from n the same area dA, but channelling it through the smaller area dA cos θ dA cos θ r θ Surface 2 π/2 − θ Surface 1
dA TP3, FvD94 Curless,Zhang
n Ideal Specular/Mirror Reflectance Phong Specular Reflection r
l v Reflection only at mirror angle Simulates a highlight θ θ φ • highlight intensity depends on viewing direction Reflection angle = incidence angle = θ Most intense specular reflection when v = r Model: all microfacets of mirror surface are oriented in the same How to compute r? direction as the surface itself • examples: mirrors, highly polished r = −l + 2(n•l)n n (in OpenGL, specular term is 0 if l • n = 0) metals r l 2(n ⋅ l)n (n ⋅ l)n
-l Durand Glossy Reflectors Glossy Real materials tend to deviate significantly from ideal Reflectors mirror reflectors ⇒ highlight and reflections are blurry Simple empirical model: Also known as: “rough specular”, “directional diffuse”, • we expect most of the reflected light to travel in or “glossy” reflection the direction of the ideal reflection ray • but due to variations in microfacet orientations, (there are no ideal diffuse surfaces either …) some of the light will be reflected just slightly off from the ideal reflected direction • as we angle away from the reflected ray, we expect to see less light reflected
Durand Durand
Surface Roughness Phong “Glossy” Reflection Model
Schlick As v angles away from r, specular reflection falls specular diffuse off, simulating “glossy” reflection:
Glossy Surface Less Shiny Surface Diffuse Surface Perfect Mirror v v increasing roughness
TP3 less glossy/ more glossy/blurry more specular Phong “Glossy” Reflection Model Material Glossiness
Phong specular model: To account for the shininess of different material: mshi cs = ss ms max((r • v), 0) cs = ss ms cos φ = ss ms max((r • v), 0) larger mshi gives tighter and shinier highlight, with sudden dropoff, simulating a more mirror-like surface cos φ
v n r r l v intensity φ specular
angle
mshi: RTR3
Phong Specular Reflection Blinn-Phong (Blinn-Torrance) Model
larger mshi , tighter highlight Back to micro facets:
• model surface by a collection of tiny mirrors