Fog Basics

From Valve Developer Community
Jump to: navigation, search
English (en)Русский (ru)Translate (Translate)
Merge-arrows.png
It has been suggested that this article or section be merged with Fog tutorial. (Discuss)

Add an env_fog_controller point entity to your level. For basic fog, you need to set the Fog Enable to "Yes", change the Primary Fog Color to the color of the fog you want. Set the Fog Start and Fog End values to a distance in world units for how far away the fog will render. The Fog Start distance is how far away the fog will appear from the player, and Fog End is the distance the fog will appear totally opaque.

Fog Blend, Primary Fog Color and Secondary Fog Color allow you to change the color of the fog depending on the direction that the player is facing. Create a env_fog_controller entity, set the primary fog color to red, the secondary color to blue, and keep the fog direction as 1 0 0 (i.e. East aka Right aka 0 degrees). In-game, the player will see red fog when they look east, blue fog when they look west, and purple fog if they look north or south.

Far Z clip plane – this setting is used for optimizing your map. Anything beyond this distance (in world units) will not be rendered. It is recommended to keep this number higher than your Fog End value.