Exhibit #3: Vertex Phong Lighting
What we did here
We upgraded the lighting model from Lambert to Phong:
- We added new uniforms for
specularColor
(a 3-vector like the diffuse color) and phongExponent
(a float).
- The lighting computations in the vertex shader include the specular component as well as the diffuse component.
- The varying variable
surfaceColor
and the fragment shader remain unchanged.