Phong Illumination model : the specular reflection part

One function that approximates this fall off is called the Phong Illumination model. This model has no physical basis, yet it is one of the most commonly used illumination models in computer graphics.

The cos f term is maximum when the surface is viewed from the mirror direction and falls off to 0 when viewed at 90 degrees away from it. The nshiny term controls the rate of this fall off.

Note that this equation is only valid for f < PI/2