As earlier chapters have addressed, the final color of a pixel is assigned in the fragment shader by setting an out ESSL variable. If all the fragments in the object have the same color, we can say the object has a constant color. Otherwise, the object is generally understood as having per-vertex color.
Use of Color in Objects
Constant Coloring
To obtain a constant color, we store the desired color in a uniform that is passed to the fragment shader. This uniform is usually called the object's diffuse material property. We can also combine object normals and light-source information to obtain a Lambert coefficient. We can use the Lambert coefficient to proportionally change the reflecting color depending on the angle on...