(Unity) HowTo : Enable Fog in your Unity Scene

White Fog Dark Fog

Fog can be an impactful, easy-to-implement way to create a unique, often mysterious (or even spooky) atmosphere. This short guide will show you how.

(1/4) Decide on the color of your fog / backdrop

Common colors include…

  • pitch-black (great for spooky games, games set at night, etc).
  • White (spooky mist, snowstorm, etc).
  • Red (ominous, warm / hot, etc).
  • Blue (cold environment, etc).

(2/4) Set background color on camera.

Cameras may be configured to render a color at the far reaches of its vision, rather than a skybox, or nothing. To do so, find your camera gameobject in the hierarchy view, then manipulate the “Clear Flags” property in the inspector, like so–

Changing the Camera Clear Flags

(3/4) Enable / Configure Fog in Render Settings

Visit the lighting menu and enable fog via Window -> Rendering -> Lighting -> Environment, like so–

Enabling Fog

You may customize the fog’s density, in addition to its color and calculating algorithm via nearby properties in this menu.

(4/4) Controlling Fog via uScript

You may control fog at runtime by using the various fog-associated uScript nodes. Perform a toolbox search for “fog”.

Fog uScript nodes

Updated: