Level Editor/Entities/Fog Volume
| Fog Volume | |
|---|---|
| Made with | Functional > Create Fog Volume |
| What it is | A box (or other shape) of volumetric fog: mist in one place, or dusty air that shows the light shafts in one room |
| In the game | Yes, it is exported with the map |
A Fog Volume fills a box of space with volumetric fog of its own: a misty hollow, smoke hanging in a hall, or dusty air in a warehouse whose windows throw shafts of sunlight while the open ground outside stays clear.
A fog volume is part of the map's volumetric fog, so it shows only when Volumetric Fog Enabled is ticked in Map Config > Environment. With the Environment's own Volumetric Fog Density at 0, the volumes are the only fog in the map. Players see volumetric fog only when Allow Volumetric Fog is ticked in their Settings, so a map must still look right without it.
For light shafts across the whole map without placing volumes, see Light shafts and fog.
Placing one
- Turn volumetric fog on: Map Config > Environment, Volumetric Fog Enabled.
- Choose Functional > Create Fog Volume and click a surface. The volume's box, 8 × 4 × 8 m, stands on the surface you clicked.
- Fit the box to the room with its Size or the 2D views' resize handles, and set how thick the fog is with Density.
The editor draws the volume's box as an outline and a marker labeled Fog Volume; the fog itself shows in the 3D view as it will in the game. The Viewport Rendering window's Volumetric fog box hides all of it for your view while you work.
Inspector
| Setting | Type | Default | What it does |
|---|---|---|---|
| Size | Meters (X, Y, Z) | 8, 4, 8 | How big the volume is. |
| Shape | List | Box | Ellipsoid, Cone, Cylinder, Box or World. World fills the whole map and ignores Size. |
| Density | Number | 0.05 | How thick the fog is. Below 0 it takes fog away where volumes overlap, to clear a pocket inside a bigger volume. |
| Albedo | Color | White | The color the fog scatters light in. |
| Emission | Color | Black | Light the fog gives off by itself, with no light shining on it: a glowing haze. |
| Height Falloff | Number | 0 | How fast the fog thins with height. 0 is even from top to bottom. |
| Edge Fade | Number | 0.1 | How softly the fog fades out toward the edges of its shape. |
A duplicated fog volume gets its own copy of these settings, so changing one never changes the other. A Mirror Node's copy follows its source.
Light shafts inside
Sunlight and lights shine through the fog, so shafts show where light falls through a window, a grate or a gap in a roof. To make them stronger:
- Raise the sun's Light Volumetric Fog Energy (in Map Config > Environment, under the sun) above 1. The official maps use 3.
- Lower the Light Volumetric Fog Energy of lamps inside the volume, so they do not glow in the air around them.
- Lower the Environment's Volumetric Fog Anisotropy to make shafts brighter seen from the side and the glare toward the sun weaker.
In the game
- Each fog volume adds a little to the cost of the map's volumetric fog, more the more of the view it covers. Fit volumes to the rooms that need them rather than covering the map with them; for fog everywhere, use the Environment's own density.
- Volumetric fog reaches only as far from the camera as the Environment's Volumetric Fog Length, so a volume far away shows nothing until players come closer.
- A fog volume in the 3D skybox is left out of the export, for the same reason; the export log lists it.