Exponential Height Fog User Guide

Guide to creating height-based, distant fog in levels.

Choose your operating system:

Windows

macOS

Linux

Exponential Height Fog creates more density in low places of a map and less density in high places. The transition is smooth, so you never get a hard cutoff as you increase altitude. Exponential Height Fog also provides two fog colors—one for the hemisphere facing the dominant directional light (or straight up if none exists), and another color for the opposite hemisphere.

Using Exponential Height Fog

In the Place Actors panel, select the Exponential Height Fog Actor, under Visual Effects . Left-click and drag to place it in the world.

ExponentialHeightFogModes.png

Positioning the Exponential Height Fog Actor will determind the height of the fog. Use the Fog Height Falloff to further adjust the height.

Exponential Height Fog: Disabled

Exponential Height Fog: Enabled

Exponential Height Fog Properties

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

Property

Description

Exponential Height Fog Component

Fog Density

This is the global density factor, which can be thought of as the fog layer's thickness.

Fog Height Falloff

Height density factor, controls how the density increases as height decreases. Smaller values make the transition larger.

Height Fog Offset

This controls the height offset of the fog layer relative to the Actor's placed Z (height).

Second Fog Data

These settings control the secondary fog level. Setting the Fog Density of this secondary fog layer to 0 will have no influence.

  • Fog Density: The secondary fog layer's global density factor, which can be used to add another fog layer thickness.

  • Fog Height Falloff: The height density factor for the secondary fog layer that controls how the density increases as height decreases. Smaller values make the transition larger.

  • Fog Height Offset: The height offset relative to the Actor's Z height position in the world.

Fog Inscattering Color

Sets the inscattering color for the fog. Essentially, this is the fog's primary color.

Fog Max Opacity

This controls the maximum opacity of the fog. A value of 1 means the fog will be completely opaque, while 0 means the fog will be essentially invisible.

Start Distance

Distance from the camera that the fog will start.

Fog Cutoff Distance

Scene elements past this distance will not have fog applied. This is useful for excluding skyboxes which already have fog baked into them.

Inscattering Texturing

Inscattering Color Cubemap

Cubemap that can be specified for fog color, which is useful to make distant, heavily fogged scene elements match the sky. When the cubemap is specified, Fog Inscattering Color is ignored and Directional inscattering is disabled.

Inscattering Color Cubemap Angle

Angle to rotate the Inscattering Color Cubemap around the Z (height) axis.

Inscattering Texture Tint

The tint color used when Inscattering Color Cubemap which is useful for making quick edits without having to reimport the cubemap specified with Inscattering Color Cubemap .

Fully Directional Inscattering Color Distance

Distance at which Inscattering Color Cubemap should be used directly for the Inscattering Color.

Non-Directional Inscattering Color Distance

Distance at which only the average color of Inscattering Color Cubemap should be used as Inscattering Color.

Directional Inscattering

Directional Inscattering Exponent

Controls the size of the directional inscattering cone, which is used to approximate inscattering from a directional light source.

Directional Inscattering Start Distance

Controls the start distance from the viewer of the directional inscattering, which is used to approximate inscattering from a directional light.

Directional Inscattering Color

Sets the color for directional inscattering, used to approximate inscattering from a directional light. This is similar to adjusting the simulated color of a directional light source.

Volumetric Fog

Volumetric Fog

Start Distance , Fog Max Oppacity , and Fog Cutoff Distance

Scattering Distribution

Controls the scattering phase function—how much incoming light scatters in various directions. A distribution value of 0 scatters equally in all directions while a value of 0.9 scatters predominantly in the light direction. In order to have visible volumetric fog light shafts from the side, the distribution will need to be closer to a value of 0.

Albedo

The height fog particle reflectiveness used by Volumetric Fog. Water particles in the air have an albedo near white, while dust have slightly darker value.

Emissive

Light emitted by Exponential Height Fog. This is a density, so more light is emitted the further you are looking through the fog. In most cases, Sky Light is a beter choice. However, Volumetric Fog does not support precomputed lighting right now, so Stationary Sky Light is unshadowed, and Static Sky Light doesn't affect Volumetric Fog at all.

Extinction Scale

Scales the height fog particle extinction amount used by Volumetric Fog. Values larger than 1 cause fog particles everywhere absorb more light.

View Distance

Distance over which Volumetric Fog should be computed. Larger values extend the effect into the distance but expose under-sampling artifacts in details.

Static Lighting Scattering

Controlls the intensity of scattered static lighting in the Volumetric Fog.

Override Light Color with Fog Inscattering Colors

Whether to use Fog Inscattering Color for the Sky Light's Volumetric Scattering Color and Directional Inscattering Color for the Directional Light's Scattering Color . Make sure your Direcitonal Light has Atmosphere Sun Light enabled. It allows Volumetric Fog to better match Exponential Height Fog in the Distance but produces non-physical volumetric lighting that may not match surface lighting.

Using Exponential Height Fog Features

The sections below cover the usage of some of the features found in the Exponential Height Fog volume:

Secondary Fog Layer

Add a second fog layer to your level using the properties found under the Second Fog Data category. It enables you better define and control fog at a second Z (height) level in your map with controls for density, height falloff, and height offset.

Exponential Height Fog: | Single Fog Layer

Exponential Height Fog: | Added Second Fog Layer

Volumetric Fog

Control Volumetric Fog by enabling it in the Exponential Height Fog's Details panel under the Volumetric Fog cagegory.

UE4's Volumetric Fog method computes participating media density and lighting at every point in the camera frustum so that varying densities and any number of lights affecting the fog can be supported.

VolumetricFog.png

See Volumetric Fog for additional details and usage.

Performance

The rendering cost of Exponential Height Fog is similar to two layers of constant density height fog with an additional optimization; fog Start Distance . The start distance is used to artificially keep some defined area in front of the viewer without fog. This also helps performance as pixels can be culled by the Z-buffer.

Below are examples of this in practice:

Fog_StartDistance_0.png

Fog_StartDistance_1000.png

Fog_StartDistance_1000_HighDensity.png

Fog Start Distance: 0

Fog Start Distance: 1000

Fog Start Distance: 1000 with high fog density

Depending on the scene content and when using a far fog Start Distance , the rendering cost can be 50% or less. This optimization is implement by rendering a full screen quad that has a Z-value and depth test enabled.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss