Let's cover an example of implementing lighting using Phong shading:
- Open the ch03_04_sphere_Phong.html file in your browser. The page will look similar to the following screenshot:
- The interface is very similar to the Goraud example's interface. As previously described, it is quite evident how the Phong shading combined with Phong lighting delivers a more realistic scene. Experiment with the controls widget to see the immediate result of this new lighting model.
What just happened?
We have seen Phong shading and Phong lighting in action. We explored the source code for the vertex and fragment shaders. We also modified the different parameters of the model and observed the immediate effect of the changes on the scene.