Colors are light properties. In Chapter 3, Lights, we saw that the number of light properties depend on the lighting reflection model selected for the scene. For instance, using a Lambertian reflection model we would only need to model one shader uniform: the light diffuse property/color. In contrast, if the Phong reflection model were selected, each light source would need to have three properties: the ambient, diffuse, and specular colors.
Note
The light position is usually also modeled as a uniform when the shader needs to know where the light source is. Therefore, a Phong model with a positional light would have four uniforms: ambient, diffuse, specular, and position.
For the case of directional lights, the fourth uniform is the light direction. Refer to the More on Lights: positional lights section discussed in Chapter 3, Lights!.
We have also seen that each light property is represented by a four-element array in JavaScript and that these arrays are mapped to the...