What is phong illumination?

Phong illumination, also known as the phong reflection, is used in computer graphics to calculate the way surfaces in 3D space reflect light. The Phong illumination model represents a more advanced way of simulating light reflection than simpler models. It adds realism to images by using the mathematical formulas to calculate the color of each pixel on a surface.

Components of phong illumination

Phong illumination is based on the three primary lighting components, each of which are explained below.

Ambient reflection

Ambient reflection is scattered evenly all across a scene without a specific direction.

  • It ensures that the objects within the scene receive some light, leaving no areas entirely dark or shadowed.

Diffuse reflection

Diffuse or Lambertian reflection is a common form of light reflection used in computer graphics. It describes the way light interacts with the surface of objects.

  • When light hits an object, it gets scattered in multiple directions rather than reflecting in a single direction.

  • It provides the basic colors and shadings to the objects.

Specular reflection

Specular reflection is a phenomenon that occurs when light interacts with a smooth and shiny surface, such as a mirror or a polished metal.

  • The behavior of the specular reflection can be described by considering the interaction between the incident light waves and the surface. 

  • The incident light is reflected in a single but opposite outgoing direction.

Calculation of phong illumination

Give below are the complete details on how to calculate phong illumination based on the primary lighting components.

Ambient reflection

For an ambient reflection coefficient (kak_a) and intensity (IaI_a), the ambient reflection component (IambI_{amb}) can be calculated as given below.

Diffuse reflection

For a diffuse reflection coefficient (kdk_d), a light intensity (IlI_l), a normal vector (n\mathbf{n}), and a light direction vector (l\mathbf{l}), the diffuse light component (IdiffI_{diff}) can be calculated as follows.

Note: The maxmax function ensures that the negative diffuse reflections are bounded to zero.

Specular reflection

For a given specular reflection coefficient (ksk_s), a light intensity (IlI_l), a unit vector (e\mathbf{e}), a reflection direction vector (r\mathbf{r}), and a surface shining constant (pp), the specular reflection can be calculated as mentioned below.

Note: The maxmax function ensures that the negative specular reflections are bounded to zero.

Total illumination

To get the total illumination (II) of a point on the surface, add all the three lighting components as shown below.

The above equation provides the basic idea behind the phong illumination model. However, these calculations are more complex as they have to account for multiple light sources, shadows and other factors in the scene.

Phong illumination
Phong illumination

Free Resources

Copyright ©2024 Educative, Inc. All rights reserved