Now consider lighting each pixel and recall the basic behavior of light from Section 4.1. The virtual world simulates the real-world physics, which includes the spectral power distribution and spectral reflection function. Suppose that a point-sized light source is placed in the virtual world. Using the trichromatic theory from Section 6.3, its spectral power distribution is sufficiently represented by R, G, and B values. If the viewing ray hits the surface as shown in Figure 7.2, then how should the object appear? Assumptions about the spectral reflection function are taken into account by a shading model. The simplest case is Lambertian shading, for which the angle that the viewing ray strikes the surface is independent of the resulting pixel R, G, B values. This corresponds to the case of diffuse reflection, which is suitable for a ``rough'' surface (recall Figure 4.4). All that matters is the angle that the surface makes with respect to the light source.
Let be the outward surface normal and let be a vector from the surface intersection point to the light source. Assume both and are unit vectors, and let denote the angle between them. The dot product yields the amount of attenuation (between 0 and ) due to the tilting of the surface relative to the light source. Think about how the effective area of the triangle is reduced due to its tilt. A pixel under the Lambertian shading model is illuminated as
Using vector notation, (7.1) can be compressed into
Steven M LaValle 2020-01-06