This recipe implements the Phong reflection model with all the three components of light, that is, ambient (A), diffuse (D), and specular (S), which we looked at in the previous recipes. This illumination technique is also known as ADS or Gouraud shading. The Gouraud shading technique is per-vertex shading because the fragment's color is calculated in the vertex shader by using each vertex's position information.
This recipe combines the effect of our ambient (A), diffuse (D), and specular (S) illumination, which we have implemented in our previous recipes, using the Phong reflection model technique. Mathematically, it's the summation of ambient, diffuse, and specular fragment colors:
Gouraud shading color = ambient color + diffuse color + specular color
Before implementing the Gouraud shading, it's advisable to understand ambient, diffuse, and specular illumination techniques thoroughly, as mentioned in this chapter.