Writing ESSL programs
Let's now take a step back and take a look at the big picture. ESSL allows us to implement a lighting strategy provided that we define a shading method and a light reflection model. In this section, we will take a sphere as the object that we want to illuminate and we will see how the selection of a lighting strategy changes the scene.
We will see two scenarios for Goraud interpolation: with Lambertian and with Phong reflections; and only one case for Phong interpolation: under Phong shading the Lambertian reflection model is no different from a Phong reflection model where the ambient and specular components are set to zero.
Goraud shading with Lambertian reflections
The Lambertian reflection model only considers the interaction of diffuse material and diffuse light properties. In short, we assign the final color as:
Final Vertex Color = Id
where the following value is seen:
Id = Light Diffuse Property * Material Diffuse Property * Lambert coefficient
Under Goraud shading...