UDN
Search public documentation

HeightFog
Licensees can log in.

Red links require licensee log in.

Interested in the Unreal engine?
Check out the licensing page.

Questions about UDN itself?
Contact the UDN Staff

Height Fog

Document Summary: Information regarding Height Fog and its uses.

Document Changelog: Created; updated by Daniel Wright.

Overview

This document covers Height Fog and its uses. It assumes that you have a level already set up in which you would like to add Height Fog.

For more information on setting up a level, see the Creating Levels page.

Versions

The one layer version of height fog was added in QA_APPROVED_BUILD_JUNE_2007. Before that, the four layer version was always used and there was no performance benefit to using less than four layers.

Using Height Fog

In the Actor tab of the Generic Browser, select the HeightFog Actor, which is under Info. Right-click in the world and select Add HeightFog Here. Open the HeightFog Properties by either double-clicking the Actor; right-clicking on the newly-placed Actor and select Properties; or pressing F4.

Positioning the HeightFog Actor will determine the height of the HeightFog.

Height Fog Properties

In the Height Fog section you can edit the following properties related to the component:

  • Density - affects the scale for the fog layer's thickness
  • Extinction Distance - the distance at which light passing through the fog is 100% extinguished
  • Light Brightness - affects the inscattering color
  • Light Color - fog color blended with the scene
  • Start Distance - the distance at which fog starts affecting the scene

Animating Height Fog

To animate Height Fog, use Matinee to animate the HeightFog Actor values. For more information, see the Unreal Matinee User Guide? page.

Color

Height Fog Color is now able to be changed at runtime using the Color Property Track in Matinee. Here’s how to set up Matinee to let you change Height Fog Color in-game:

  1. Create a HeightFog Actor.
  2. Create a group in Matinee with that Actor attached.
  3. Create a color property track in the above group.
  4. A dialog should appear letting you choose which color property to interpolate. There should be only one option since the HeightFog Actor has only one property that is a color.
  5. Once that track is set up, you can place keyframes and use the context menu (right-click) or the Curve Editor? to set the color for each key.

Interaction with transparency

Transparency can't be handled during the main fog pass so it is a special case. Fog on transparent objects is calculated per-vertex, which means that transparent meshes need to be reasonably tessellated to look right. Materials using modulative blending can't be fogged, unless they are decal materials.

Performance implications

Height Fog is rendered with a full screen pass blended onto the scene color. There is a one layer version and a four layer version. These are applied based on how many HeightFog Actors exist in the level, so if there is only one actor the one layer version will be used. The four layer version takes about twice as long to render as the one layer version, so use just one HeightFog Actor if possible. There is also a small performance gain to be had from setting the Start Distance so that nearby objects in the world are not fogged at all.

Volumetric Fog

Use FogVolumes to have localized fog effects. This feature can also be faked by using sheets of unlit translucency and special materials. See the Volumetric Lighting Guide for information on setting up a volumetric lightbeam.