Phong reflection model

From Wikipedia, the free encyclopedia

In 3D computer graphics, the Phong reflection model is an illumination and shading model for assigning shades to points on a modeled surface. It was developed by Bui Tuong Phong in his University of Utah Ph.D. dissertation "Illumination for Computer Generated Pictures" in 1973, in conjunction with a method for interpolating the calculation for each individual pixel that is rasterized from a polygonal surface model; the interpolation technique is known as Phong shading, even when it is used with a reflection model other than Phong's.

The Phong reflection model can be treated as a simplification of the more general rendering equation; it takes advantage of the following simplifications when deciding the shade of a point on a surface:

  1. It is a local reflection model, i.e. it doesn't account for second-order reflections, as do ray tracing and radiosity. In order to compensate for the loss of some reflected light, an extra ambient lighting term is added to the scene that is rendered.
  2. It divides the reflection from a surface into three subcomponents, specular reflection, diffuse reflection, and ambient reflection.

If we first define, for each light source in the scene to be rendered, the components is and id, where these are the intensities (often as RGB values) of the specular and diffuse components of the light sources respectively. A single ia term controls the ambient lighting; it is sometimes computed as a sum of contributions from the light sources.

If we then define, for each material (which is typically assigned 1-to-1 for the object surfaces in the scene):

ks: specular reflection constant, the ratio of reflection of the specular term of incoming light
kd: diffuse reflection constant, the ratio of reflection of the diffuse term of incoming light (Lambertian reflectance)
ka: ambient reflection constant, the ratio of reflection of the ambient term present in all points in the scene rendered
α: is a shininess constant for this material, which decides how "evenly" light is reflected from a shiny spot

We further define lights as the set of all light sources, L is the direction vector from the point on the surface toward each light source, N is the normal at this point of the surface, R is the direction a perfectly reflected ray of light (represented as a vector) would take from this point of the surface, and V is the direction towards the viewer (such as a virtual camera).

Then the shade value for each surface point Ip is calculated using this equation, which is the Phong reflection model:

I_p = k_a i_a + \sum_\mathrm{lights} (k_d (L \cdot N) i_d + k_s (R \cdot V)^{\alpha}i_s).

The diffuse term does not use the direction towards the viewer (V), as the diffuse term is equal in all directions from the point, including the direction of the viewer. The specular term, however, is large only when the reflection vector R is nearly aligned with viewpoint vector V, as measured by the α power of the cosine of the angle between them, which is the dot product of the normalized direction vectors R and V. When α is large, representing an almost mirror-like reflection, the specular reflection will be very small because the high power of the cosine will go rapidly to zero with any viewpoint not aligned with the reflection.

When we have color representations as RGB values, this equation will typically be calculated individually for R, G and B intensities.

Phong reflection is an empirical model, which is not based on a physical description of light interaction, but instead on informal observation. Phong observed that for very shiny surfaces the specular highlight was small and the intensity fell off rapidly, while for duller surfaces it was larger and fell off more slowly.

This equation can be represented in a graphic way: Visual explanation of the Phong equation

Here the "ambient" and "diffuse" colors are the same; note that the intensity of the diffuse component varies with the direction of the surface whereas the ambient component is uniform. The "specular" color is white, reflecting almost all of the light hitting the surface, but only in very narrow highlights.

[edit] Phong shading interpolation method

Main article: Phong shading

Along with the reflection model for computing color at a surface point, Bui Tuong Phong also developed a method of interpolation to compute colors at every pixel in a rasterized triangle representing a surface patch. These topics are sometimes treated together under the term Phong shading, but here the latter term is used only for the interpolation method.

[edit] See also

In other languages