Computer Graphics Shading
The Physics
2
Local vs. Global Illumination Models Example
Local model – direct and local interaction of Ambient each object with the Diffuse light.
Global model: interactions and exchange of light energy between Final different objects. Specular Image
3
Light Sources Ambient Light Point source (A): All light originates at a point Assume non-directional light in the environment Rays hit planar surface at different incidence angles Object illuminated with same light everywhere Parallel source (B): All light rays are parallel Looks like silhouette Rays hit a planar surface at identical incidence angles May be modeled as point source at infinity The Illumination equation I = Iaka Also called directional source Ia - ambient light Area source (C): Light originates at finite area in intensity space. k - fraction of Inbetween the point and parallel sources a B C ambient light reflected Also called distributed source A from surface. Also defines object color
5 6
Copyright Gotsman, Elber, Barequet, Karni, Sheffer Page 1 Computer Science, Technion Computer Graphics Shading
Diffuse Light Diffused Ball Dull surfaces such as solid matte plastic reflects incoming light uniformly in all directions. Called diffuse or Lambertian reflection Understand intensity as the number of photons per inch2. If a flow of m photos passing each second through an inch2 window orthogonal to the flow, is hitting the red surface, how many photons hit an inch2 of the surface ? Let θ is the angle between the direction of incoming light and normal to surface, and let L, N be corresponding unit vectors.
L N
Moon Paradox Diffuse Reflection
10
Reflection from a perfect mirror Specular Reflection
Assume object is a perfect mirror. L N R Shiny objects (e.g. metallic) reflect light in preferred θ θ α V direction R determined by surface normal N. L N R θ θ α V
Most objects are not ideal mirrors – also reflect in the immediate vicinity of R Lights emits the object in direction V only if V=R α=0 Phong Model – approximate attenuation by the form of cosnα (no real physical basis)
11 12
Copyright Gotsman, Elber, Barequet, Karni, Sheffer Page 2 Computer Science, Technion Computer Graphics Shading
Specular Reflection (Phong Model) Specular Reflection (cont’d) Illumination equation: Exponent n of cosine controls decay factor of attenuation ks - Specular reflection coefficient function: n - Specularity exponent No physical basis but looks good:
13 14
Retroreflector sends light back where it came from regardless of the angle of insidence
More on Illumination Equation For multiple light sources: shadingmodel