Game Development Reference
The use of SSAO in Figure 7.30 brings more depth and natural effect to the
image, providing shadowing in and under the rocks and grass and between
the leaves of the tree.
This section examined a variety of camera effects. These are added to the
rendering postproduction after the camera has determined the scene. As
such they can require a great deal of computer processing and are not
recommended for use on platforms without sufficient graphics processing
capability (like many mobile devices).
As Unity only provides these effects with the Pro version, they
have not been fully elucidated here. However, the interested
reader is encouraged to read Unity's own documentation found at
There are a number of ways to create skies for a 3D game environment. The
easiest way is to set the background color of the camera to blue. Alternatively,
if you want to include fog, setting the fog color to the background color
gives the illusion of a heavy mist and provides for landscape optimization as
discussed in Chapter Two.
To get clues as to what a game environment sky should look like, we can just
look up. Our sky is more than a blue blanket covering the earth. Its colors
change throughout the day with the position of the sun, the quality of the air,
the weather, and the longitude and latitude.
The daytime sky appears blue due to a phenomenon known as Rayleigh
scattering (named after a physicist of the same name). As sunlight enters
the earth's atmosphere, it interacts with the air and dust particles, which
bend the light and scatter the different colors across the sky. The color that
is scattered the most is blue. At sunset, the sun's rays enter the atmosphere
at different angles relative to the viewer and cause more yellow and red light
to be scattered. Rayleigh scattering is caused by particles smaller than the
wavelength of light.
Particles that are comparable or larger than the wavelength of light also
scatter it. This effect is described by the Mie theory , developed by physicist
Gustav Mie. The theory explains how particles such as water droplets affect
the scattering of light. The Mie theory elucidates why clouds are different
shades of gray and white.
Another factor influencing the look of the sky is turbidity . Turbidity
describes the amount of suspended solid particles in a fluid. In the sky,
turbidity relates to the number of dust, ash, water, or smoke particles
in the air. The density of these particles affects both Rayleigh scattering