Game Development Reference
Another very (very) handy trick in reducing the visual size of a game
environment is fog. In the previous examples when the FPC was at a
far enough distance from the buildings they would slide behind the far
plane of the camera or snap out of view because of the LOD. By adding
fog, these other rather too obvious techniques can be hidden. A layer of
fog can be added just before the far plane of the camera or the farthest
distance of the LOD.
Unity Hands On
Step 1. Open the project from the last hands-on session.
Step 2. Select Edit > Render Settings from the main menu.
Step 3. Tick the Fog box now available in the Inspector. Note that a
gray fog covers the ground but not the sky in the Game.
Step 4. Play. Walk around the city. Buildings in the distance will be
completely fogged out. As you move closer to a building the fog will
Step 5. The thickness of the fog is modified in the Fog Density
property of render settings. You will notice in the same place that
you can change the color of the fog. The issue now faced is that the
ground and buildings are fogged over, but the background color is
not. This is a fact of life with using fog, as fog is only applied to game
objects and not to the background. The best way to overcome this is
to set the background color to the same color as the fog. This makes
for a very convincing cloudy sky.
Step 6. Select the color picker for the fog and select a color. Note
down the RGB and A values.
Step 7. In the Hierarchy, select the Main Camera attached to the FPC.
Change the background color in the Inspector to the same color as
Step 8. Set the fog density to 0.005.
Step 9. Play. At this point it becomes a fine balance of testing if in the
distance you can still see buildings disappearing instead of blurring
into the fog. If so, try turning up the fog a little.
Fine-detailed, high-quality textures are the best defense against high
polycounts. There is far more detail in a photorealistic image of a real-world
item than could possibly fit into the polycount restrictions of any real-time
game engine. Chapter One examined briefly the use of normal and specular
maps to give extra texturing to game objects. Here we discuss two more