Game Development Reference
In-Depth Information
Figure 10.25. Surfaces more perpendicular to the light rays receive more light per unit area
Notice that, in both cases, the perpendicular distance between the rays
is the same. (Due to an optical illusion in the diagram, the rays on the right
may appear to be farther apart, but they are not.) So, the perpendicular
distance between the rays is the same, but notice that on the right side of
Figure 10.25, they strike the object at points that are farther apart. The
surface on the left receives nine light rays, and the surface on the right
receives only six, even though the “area” of both surfaces is the same.
Thus the number of photons per unit area 15 is higher on the left, and it
will appear brighter, all other factors being equal. This same phenomenon
is responsible for the fact that the climate near the equator is warmer than
near the poles. Since Earth is round, the light from the sun strikes Earth
at a more perpendicular angle near the equator.
Diffuse lighting obeys Lambert's law: the intensity of the reflected light
is proportional to the cosine of the angle between the surface normal and
the rays of light. We will compute this cosine with the dot product.
Calculating the Diffuse Component according to Lambert's Law
c diff = ( s diff
m diff ) ( n l ).
(10.12)
As before, n is the surface normal and l is a unit vector that points
towards the light source. The factor m diff is the material's diffuse color,
which is the value that most people think of when they think of the “color”
of an object. The diffuse material color often comes from a texture map.
The diffuse color of the light source is s diff ; this is usually equal to the
light's specular color, s spec .
15 The proper radiometric term is irradiance, which measures the radiant power arriv-
ing per unit area.
Search WWH ::




Custom Search