Skip to content

Fog Area

Get on Fab

Fog Area is a handy, blueprint-based tool that adds procedural, noise-driven local fog to your scenes. It is easy to use and highly customizable. The package includes pre-baked noise textures for optimized runtime performance. The core fog shader supports two types of local volumes: sphere and box.

Quickstart

To see local fog in action right away, drag a Fog Area blueprint actor from the Content Browser or the Place Actors tab into your scene.

If the fog is invisible, ensure that Volumetric Fog is enabled in your Exponential Height Fog actor. Enable Volumetric Fog

Material Modes

Splitting materials into dynamic and static types helps boost performance. Static materials avoid creating a dynamic material instance for every fog actor in the scene, reducing overhead.
Almost all properties available in the fog shader are exposed in the Fog Area actor. You can configure a dynamic fog area with your preferred settings and then transfer those settings to a static version without needing to open the Material Editor.

VariableDefault ValueDescription
Box ShapefalseToggle between box and sphere shape
MaterialNoneReference to a static material. If Material Mode is set to static but this is null, it falls back to dynamic material

General Data

VariableDefault ValueDescription
Emissive ColorN/AColor emitted by the fog
Base ColorN/APrimary color of the fog volume
Density1.0Thickness/density of the fog
Mask Margin3.0Edge softness/falloff of fog mask, applies to box and sphere shapes

Wind

The wind direction can be set to either Local or World space using the Wind World Space variable.

  • Local Wind: Driven by the actor’s forward (X) axis.
  • World Wind: World Wind uses a global direction. While it is technically possible to pass per-instance data to static materials using Custom Primitive Data, I chose to keep the shader simpler and avoid that complexity. Instead, for world-space wind, connect your global wind vector (e.g., from a Material Parameter Collection) to the Global Wind input pin in the Fog shader and recompile. Global Wind
VariableDefault ValueDescription
Wind Speed1.0Speed of wind movement

Noise

VariableDefault ValueDescription
ChannelRTexture channel used for sampling the noise texture
Scale2.5Scale multiplier for noise texture
Sharpness0.35Controls the softness or contrast of the noise texture
Noise TextureNoneAllows overriding the default 3D noise texture
Distortion Intensity0.0Strength of distortion effect applied to base noise
Distortion Scale4.0Scale the sampling size of distortion texture
Distortion Speed0.5Control the speed of distortion pan
Distortion TextureNoneAllows overriding the default 3D distortion texture

Shape Data

Allows you to mask the fog with a 2D texture, creating any shapes.

VariableDefault ValueDescription
Use ShapefalseToggle shape-based fog masking
Shape TextureNone2D texture used for fog masking
ChannelRTexture channel used for shape sampling
Rotation0.0Rotation angle of shape texture (in radians)
Scale1.0Scale multiplier for shape texture

Advanced

VariableDefault ValueDescription
Trace SurfacefalseA one-time operation that traces the surface along the negative Z axis, aligns the actor with the hit normal, and then resets itself to false. Useful for placing fog on terrain.
Max Draw Distance25000.0Maximum distance at which fog mesh is rendered (in world units)

Modes

Fog Area includes three specialized operational modes: Shadows, Distance Field, and Light Shafts. Fog are modes

Under the hood this modes are just regular material instances with pre-configured shader switches. Materials are stored as Soft pointers to minimize memory usage and reduce dependencies from a Fog area actor. Static materials

Shader Complexity

Complexity/Shaders_1.png
Base noise only
Complexity/Shaders_2.png
Every feature is enabled

The primary reason for splitting the material into distinct instances is performance. By pre-configuring the shader switches, the number of shader instructions is greatly reduced, allowing you to use many instances without worrying about performance impact.

Bellow is an example map in Shader Complexity debug view with different modes active on various Fog Area actors.

Debug shader complexity view


Self Shadows Data

VariableDefault ValueDescription
ColorN/AColor of self-shadowed areas
Offset0.02Shadow offset distance
Intensity3.0Strength of self-shadow effect

Distance Field Data

VariableDefault ValueDescription
ColorN/ADistance fields base color
Color Distance150.0Distance threshold for color influence
Offset60.0Distance field sampling offset
Distance250.0Maximum distance for field influence
If the Distance Field mode doesn’t produce any effect, make sure that Generate Mesh Distance Fields is enabled in Project Settings. Enable mesh distance field

Shafts Data (Light Shafts)

VariableDefault ValueDescription
Scale450.0Size/scale of light shafts
Sharpness0.0Controls the softness or contrast of light shafts
Intensity1.0Scales the intensity of the light shafts
Speed0.5Animation speed of the light shaft movement
Last updated on