The Phong reflection model is a shading model, used heavily in 3D computer graphics for assigning shades to each individual pixel that is rasterized of some abstract representation of an object such as a sphere or cone.
The Phong reflection model is a simplification of the more general rendering equation, which takes advantage of the following simplifications when deciding the shade of a pixel during rasterization of a surface:
- It is a local reflection model, i.e. it doesn't account for second-order reflections, as do raytracing or radiosity. In order to compensate for some of the losses of light, an extra ambient lighting term is added to the scene that is rendered.
- It divides the reflection from a surface into two subcomponents, specular reflection and diffuse reflection.
If we then define, for each material (which is typically assigned 1 to 1 for the objects in the scene, so that it is a sphere of material 1, which is a material which looks like e.g. copper, a cone of material 2, which is a material which looks like brass etc:
- specular reflection constant, the ratio of reflection of the specular term of incoming light
- diffuse reflection constant, the ratio of reflection of the diffuse term of incoming light
- 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
Then the shade value for each pixel can be calculated using this equation, which is the Phong shading equation:
(When we have color representations as RGB values, this equation will typically calculated individually for R, G and B intensities, which are then concatenated and written to the video frame buffer memory simultaneously.)