Phong shading

As we saw, Lambert shading paints each face by interpolating vertex colors. In contrast, Phong shading interpolates vertex normals to obtain a surface normal at each interior fragment, and then performs a lighting calculation at each fragment to determine its color.

Phong shading is more expensive than Lambert shading since it generally performs many more lighting calculations, covering each face with calculations rather than limiting them to vertices. The benefit is heightened realism. Consider specular highlights which occur when light reflects off a shiny surface into the eye. Under Lambert shading, specular highlights which we would expect in the interior of faces simply do not show up. Interior colors are obtained by blending vertex colors, so they cannot have features that the vertex colors lack. In contrast, because Phong shading performs a lighting calculation at every fragment, it can capture specular highlights anywhere on a face, even far from vertices. Interpolated normals simulate geometric curvature across the face.

Select Phong in the following program. Note the specular highlight may lie in the square interior far from the corner vertices. You can also control how shiny the surface is. Specular highlights are tight and well-defined in shiny surfaces, but diffuse and soft in matte surfaces. Because the specular highlight reflects toward your eye, it shifts across the surface as you rotate around the scene.

Phong shading