Exploring How Normals Affect Lighting
Lighting is a complex topic in graphics. So far, we’ve applied very simple ambient and diffuse lighting to a cube in Chapter 5, Let’s Light It Up! At the time, we discussed the lighting model of specular reflection but didn’t practically apply it as it requires the use of normals. For your convenience, Figure 5.2 of Chapter 5, Let’s Light It Up!, is repeated here as Figure 11.12:
Figure 11.12: The components of light that make up a final render
For ambient and diffuse lighting, the normal is not used and as such makes the surface of meshes appear flat with very little indication of the direction of the light source. To add specular lighting though, we need to know the normal.
Although we didn’t specify the normals for the cube in the light exercise in Chapter 5, Let’s Light It Up!, we were still able to get a lighting effect. However, this lighting was incorrect, as you will...