Colors are light properties. In Chapter 3, Lights, we learned that the number of light properties depends on the lighting-reflection model selected for a 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.
Positional Lights
The light position is usually modeled as a uniform when the shader needs to know the position of the light. Therefore, a Phong model with a positional light would have four uniforms: ambient, diffuse, specular, and position.
For directional lights, the fourth uniform is the light direction. For more information, refer to Chapter 3, Lights.
The light position is usually modeled as a uniform when the shader needs to know the position of the light. Therefore, a Phong model with a positional light would have four uniforms: ambient, diffuse, specular, and position.
For directional lights, the fourth uniform is the light direction. For more information, refer to Chapter 3, Lights.
We have seen that each light property is represented by...