Basic Light Reflection Model
(Based on material from Fundamentals
of Three-Dimensional Computer Graphics, A. Watt, Addison_Wesley,
1989)
(last update 10/31/00)
A Basic Light Reflection Model
In these notes we introduce a simple and widely used light reflection model. A reflection model describes the interaction of light with a surface, in terms of the properties of the surface and the nature of the incident light. It, combined with surface shading models, enables a two-dimensional synthetic image of a virtual scene to look real.
An illumination model on the other hand defines the nature of the light emanating from a source - the geometry of its intensity distribution, etc. Most computer graphics shaders use simple light reflection models and extremely simplified illumination models, usually point light sources. This simplified approach produces acceptable results in reasonable time using currently available computers and display devices.
The purpose of light reflection models is to render three-dimensional objects in two-dimensional images such that reality is mimicked to an acceptable level. The phrase 'acceptable level' depends on the context of the application. The higher the degree of reality required, the more complex the reflection model and the greater the processing demands. For example, simple models are used in realtime, interactive computer-generated imagery. In contrast, a television commercial comprising a short animated sequence may demand, for aesthetic reasons, a much richer reflection model and tens of minutes may be spent in generating each frame in the sequence.
Somewhere between these two extremes is the shading of solid models in CAD packages. Here a machine part may be designed interactively using a solid modelling capability. In the design phase a user of such a system may operate with wireframe models. To visualize the finished object most three-dimensional CAD systems have a shading option. This will use a basic reflection model to shade the surfaces of the object. Such a process running on a CAD workstation may run in real time or take tens of seconds to a few minutes to complete, depending on the capability of the workstation. Current workstations with hardware shaders are capable of shading hundreds of thousands of polygons per second.
Simple reflection - the Phong model
A basic reflection model has been in use in computer graphics since
the mid 1970s. It is with this model that we begin. Simple reflection
models attempt to simulate the way in which light interacts with a surface.
The 'standard' model in computer graphics that compromises between acceptable
results and processing cost is the Phong model. This models reflected
light in terms of a diffuse and specular component together with an ambient
light term. The reflected light intensity at every point on a surface
is taken to be the linear combination of these three reflection components.
(Note: There are some inadequacies in modeling reflection using only
these three terms.)
[The intensity and wavelength of light reflected from a surface depend
on incident wavelength, the angle of incidence, the nature (roughness)
of the surface material and its electrical properties (permittivity, permeability
and conductivity). The exact interaction is extremely complex.
For example, the same surface may be smooth for some wavelengths and rough
for others; or for the same wavelength, it may be rough or smooth for different
angles of incidence. Also we have the well-known empirical fact that
any surface, regardless of its roughness, will reflect specularly at grazing
incidence angles.]
Diffuse and specular light are both reflected components from the same surface. In the case of specular light we are viewing along or near to the mirror reflection direction. A smoothish surface tends to reflect a high intensity of incident light in this spectular direction. Diffuse light is scattered in all directions and is responsible for the color of the surface. This component of reflected light is due to incident light that has been both reflected and selectively absorbed according to material-dependent properties.
Diffuse reflection
Most objects that we see do not emit light of their own. Rather they absorb sunlight, or light emitted from an artificial source, and reflect part of it. This reflection is due to molecular interaction between the incident light and the surface material. A green object, for example, absorbs white light and reflects the green component in the light. The detailed nature of such interactions need not concern us, but we note that a surface reflects colored light when illuminated by white light and the colored reflected light is due to diffuse reflection.
A surface that is a perfect diffuser scatters light equally in all directions. This means that the amount of reflected light seen by the viewer does not depend on the viewer's position. Such surfaces are dull or matte and the intensity of diffuse reflected light is given by Lambert's law:
Id = Ii kd COS (theta) 0 =< theta =< pi/2
Ii is the intensity of the light source. Theta is the angle between the surface normal and a line from the surface point to the light source (considered as a point source). The constant kd is an approximation to the diffuse reflectivity which depends on the nature of the material and the wavelength of the incident light.
In the figure above, surface 1 is parallel to the light beam and theta is 90 degrees. Surface 2 is normal to the light source and theta is 0 degrees. For surface 3, theta is less than 90 degerees. Thus surface 1 would not be illuminated and surface 2 would be brighter than surface 3. kd is a constant between 0 and 1 that depends on the material.
The equation above can be written as the dot product of two unit vectors:
Id= Ii kd (L . N)
where N is the surface normal and L the direction vector from the light source to the point on the surface. If there is more than one light source then
Id= kd SUM [Ii,n (Ln . N)]
where Ln, is the direction vector from the nth light source to the point on the surface.
Ambient light
In the figure above, surface 1 is parallel to the light source (and therefore invisible to it) but visible to the viewer. Such a surface is made visible by ambient light. Otherwise it would be rendered black. Scenes illuminated only by a point light source are unnatural and hard, like illuminating a scene at night with a thin flashlight beam. Also, it is clearly unsatisfactory that surfaces that are visible from the view point, but invisible from the light source, are rendered black. This is not normally encountered naturally.
Ambient light is the result of multiple reflections from walls and objects, and is incident on a surface from all directions. It is modelled as a constant term for a particular object or surface using a constant ambient reflection coefficient. Combination of the diffuse and ambient terms gives:
I= Iaka + Ii kd (L . N)
Ambient light originates from the interaction of diffuse reflection from all the surfaces in the scene.
Distance
Now consider the role of distance. We can add a term that reduces light intensity as a function of the distance of the surface from the light source. This ensures that surfaces of the same color, but at different distances from the light source, are not assigned the same intensity. This also models the natural relationship of light energy reaching a surface to its distance from the light source. Since light sources are often considered to be at infinity, a measure equal to the distance from the view point to the surface can be used instead. The equation above then becomes:
I = laka + Ii kd (L . N) / (r + k)
where r is the distance to the view point and k is a constant. In applications where efficiency is critical this denominator may not be used. In contexts where depth cueing is important, a more complex model is used to simulate atmospheric haze and fading.
Specular reflection
Most surfaces in real life are not perfectly matte and do not behave as perfect diffusers of light. Surfaces usually have some glossiness. A perfectly glossy surface is a mirror. Glossy surfaces are different from matte surfaces in a number of important respects. Firstly, light specularly reflected from a glossy surface leaves the surface at angle theta, where theta is the angle that the incident beam makes with the surface (see the figure below). This means that the amount of specular reflection seen by a viewer depends on the viewer's position relative to the surface and the light source.
For a perfect mirror surface the angle of
reflection is equal to the angle of incidence.
Consider the case of a perfect glossy surface illuminated by a single point source. All the light from the source is reflected along one particular direction, the mirror direction, and will only be seen when the surface is viewed from this direction. The surface will only appear bright for a single viewing direction and dark for all others. In practice, specular reflection is not perfect and reflected light can be seen for viewing directions close to the direction of the reflected beam (see figure below). The area over which specular reflection is seen is commonly referred to as a highlight and this phrase describes a second important aspect of this type of reflection: the color of the specularly reflected light is different from that of the diffuse reflected light. In simple models of specular reflection the specular component is assumed to be the color of the light source. If, say, a green surface is illuminated with white light then the diffuse reflection component is green but the highlight or specular refelction is white.
For a single ray or a single point on the surface we can model specularly reflected light by considering two more vectors. In the figure below, L and N are as before, R is the direction along which specular light is reflected and V is the viewing direction. Phi is the angle between the viewing vector and the reflection vector (both unit vectors). For a perfect mirror this angle must be zero for any specular light to be seen. In practice, as we have already mentioned, specular reflection is seen over a range of phi that depends on the glossiness of the surface. Phong modeled this behaviour empirically by a term cosn (phi). For a perfect reflector n is infinite. A very glossy surface produces a small highlight area and n is large. As a surface becomes more and more matte the highlight areas become more spread out and their intensity diminishes in relation to the diffuse reflection component.
The light intensity equation becomes:
I= Iaka + Ii
[kd (L . N) + ks cosn (phi)] /
(r + k)
= Iaka +
Ii [kd (L . N) + ks (R . V)n]
/ (r + k)
(a) Diffuse reflection - light is scattered in all directions
from a point on the surface.
(b) Specular reflection - light is concentrated around the mirror
direction R.
phi and V used in the calculation of the specular
term.
(a) Large n simulates a glossy surface,
(b) small n simulates a less glossy surface.
ks is the specular reflection coefficient, usually taken to be a material-dependent constant. Phong used W(i) as the specular reflectivity, where W is actually a function of i, the incidence angle, however the equation with constant ks, is usually quoted as the Phong model.) The figure below shows the variation in light intensity at a point P on a surface calculated using the intensity equation above. The intensity variation is shown as a profile - a function of the orientation of V. The intensity at P is given by the length of V from P to its intersection with the profile. The semicircular part of the profile is the contribution from the ambient and diffuse terms. The specular part of the profile is shown for different values of n. Note that large values of n are required for a tight highlight to be obtained.
The light intensity at point P as a function of the orientation of
the viewing vector V.
Like the diffuse term this simple model of specular reflection is a local model. Only the interaction at a surface point from the light sources is considered. Light reflected onto the surface that originates from specular reflections in other objects is not considered. This is a much more severe constraint than the locality of the diffuse term. It excludes reflections of other objects in the surface of the object being rendered. This is solved by using a simple but extremely expensive global model for specular reflection called ray tracing.
Geometric considerations
The expense of computing light intensity can be considerably reduced by making some geometric assumptions and approximations. First, if the light source and the viewpoint are considered to be at infinity then L and V are constant over the scene. The vector R is expensive to calculate and, although Phong gives an efficient method for calculating R, it is better to use a vector H. This appears to have been first introduced by Blinn (1977). The specular term then becomes a function of N . H rather than R . V. H is the unit normal to a hypothetical surface that is oriented in a direction halfway between the light direction vector L and the viewing vector V:
H is the normal to a surface orientation that would reflect all the light along V.
The difference between using (a) R . V and (b) N . H
for a fixed value of n.
Note the difference in the intensity in direction
V.
H = (L + V)/2
This is the required orientation for a surface to reflect light along the direction V. It is easily seen that the angle between R and V is twice the angle between N and H but this can be compensated for, if necessary, by adjusting n. The figure above shows the difference in the highlight for a single value of n. The use of N . H 'spreads' the highlight over a greater area. the light intensity equation now becomes:
I = Iaka + Ii [kd(L . N) + ks(N . H)n] / (r + k)
This now means that the intensity I is solely a function of the surface normal N. If L and V are constant vectors then so is H. There are two implications of placing the light source at infinity. First, there is no variation of shading over a planar surface (ignoring the effect of the distance denominator (r + k)), because L is now a constant and N does not change over the surface. Second, the shape of the specular highlight changes. In general the variation in N . H over a surface is less if H is a constant than if H is calculated from a varying L.
Color
For colored objects the easiest approach is to model the specular highlights as white (for a white light source) and to control the color of the objects by appropriate setting of the diffuse reflection coefficients. We could use three intensity equations to create the image:
Ir = Ia kar
+ Ii [kdr(L . N) + ks(N . H)n]
Ig = Ia kag
+ Ii [kdg(L . N) + ks(N . H)n]
Ib = Ia kab
+ Ii [kdb(L . N) + ks(N . H)n]
Note that the specular term is common to all three equations. Summarizing these three equations as a single expression gives:
I(r, g, b) = Ia ka(r, g, b) + Ii [kd(r, g, b)(L . N) + ks(N . H)n]
It should be mentioned that this three-sample approach to color is a crude approximation and accurate treatment of color requires far more than three samples.
The following points summarize this simple model. Most of the inadequacies or assumptions of the model have been addressed using more complex lighting models.