We’re ready to take a look at the first example in this chapter. We will work on a scene with per-fragment lighting that has three light sources.
Each light has a position and a diffuse color property. This means we have two uniforms per light. Perform the following steps:
- To keep things simple, we have assumed that the ambient color is the same for all three light sources. We have also removed the specular property. Open the ch06_02_wall_initial.html file in your browser.
- You will see a scene such as the one displayed in the following screenshot where two lights (red and green) illuminate a black wall:
- Open the ch06_02_wall-initial.html file using your code editor. We will update the ...