In the previous chapter, we covered global versus local transformations, matrix stacks, animation timers, and various interpolation techniques. In this chapter, we start by examining how colors are structured and handled in WebGL and ESSL. We will discuss the use of colors in objects, lights, and scenes. Then, we will see how WebGL leverages the depth buffer for object occlusion when one object is in front of another, blocking it from view. Lastly, we will cover alpha blending, which allows us to combine the colors of objects when one is occluding the other, while also allowing us to create translucent objects.
In this chapter, we will cover the following topics:
- Using colors in objects.
- Assigning colors to light sources.
- Working with several light sources in the ESSL program.
- Learning how to use the depth test and the z-buffer.
- Learning...