Dust, Fog, & Smoke

From Valve Developer Community
Jump to navigation Jump to search
English (en)Deutsch (de)Русский (ru)中文 (zh)Translate (Translate)
Abstract Mapping series Discuss your thoughts - Help us develop the articles or ideas you want

Ammunition | List of HL2 Animals and Creatures | Mapping with Antlions | Beams and Lasers | Cables and Ropes | Moving Clouds | Color Theory in Level Design | Combat | Combine | Compression (Source 1) | Doors | Dust, Fog, & Smoke | Elevators | Level Transitions | Environmental Lighting, Sun, Weather, & Outdoors | Explosions | Fire | Half-Life 2 Foliage | Glass & Windows | Headcrab | Health | Ladders | Lighting | Optimization (level design) | Physics | Retinal scanners | Sound and Music | Special effects | Terrain | Trains | Turrets | Water | Weapons | Zombie


This article is about adding smoke, dust, fog, etc, to a map. Due to their similarities, most of these effects can be achieved by variations of each other.


Entities

Materials

  • effects/fog_d1_trainstation_02 — Used only in the distance. Fit to brush face. Half-Life 2-content derived source games only.
  • effects/fog_d2_coast_01 — Used only in the distance. Fit to brush face. Half-Life 2 20th Anniversary Update only.
    • Example usage of this material can be seen on all Water Hazard (before d1_canals_13), Highway 17 and Sandtraps maps, which was applied to round shaped brush and displacement fog placed in far distance, combined with env_fog_controller with radial fog enabled.
  • effects/fog_d1_canals_13 — (uses effects/fog_gradient texture, just with color changed through $color VMT parameters). Half-Life 2 20th Anniversary Update only.
    • Example usage of this material can be seen on d1_canals_13 map, which was applied to round shaped brush and displacement fog placed in far distance, combined with env_fog_controller with radial fog enabled.
  • shadertest/volumetricfog — Doesn't work.
  • tools/toolsfog — Works only with func_smokevolume.
  • tools/toolsskyfog — Non-functional, use non-existent shader SkyFog.

Notes

  • env_smokestack and func_dustcloud use numerous sprites to achieve their effect, and can therefore be very expensive to render (some settings will slow your map, especially on low-end systems).
  • CS:S has some cloud props.
  • Shafts of light must be added by hand. There is a model for this (Effects/vol_light.mdl) or you can create a non-solid brush with material models/effects/vol_light001 or vol_light002.
  • To get fog in a 3D skybox, adjust the fog settings in the sky_camera. For best results give it the same settings as the env_fog_controller.
  • In Source games, prior to Left 4 Dead, renders fog as a plane a certain distance away from the camera. This method is bad, as rotating the camera will strengthen or weaken the apparent amount of fog in a particular spot, even though the viewer hasn't moved at all. After Left 4 Dead Left 4 Dead, aswell as Half-Life 2 Half-Life 2 (since 20th anniversary, enabled in some maps only), and Team Fortress 2 branch Team Fortress 2 branch games (Counter-Strike: Source, Half-Life Deathmatch: Source, Half-Life 2: Deathmatch and Day of Defeat: Source), Valve implemented a new radial method which is independent from the viewing angle. Mapbase also has it's own implementation of radial fog.
  • Left 4 Dead 2 There is a Fog Panel in Left 4 Dead 2 that allows in-game manipulation of fog parameters. It is loaded via console command fogui.
Icon-Bug.pngBug:On systems with newer GPUs (since Nvidia GeForce 8000 series or newer AMD/ATI GPUs) and newer drivers, fog effect on all Source 2004 Source 2004 and Source 2006 Source 2006 games will appear more foggy than usual. This has been fixed on NVIDIA systems since driver version "516.5x" (confirmed on RTX 3060),[1][2] but is likely still present on AMD/Intel. This issue is not affected when using dxlevel 81 (DirectX 8.1 level) or lower, only dxlevel 90 (DirectX 9.0 level) or higher.

Additionally, using any Direct3D 9 wrapper (D3D9 to D3D11 via Pcgw icon.png dgVoodoo 2 for example) on this branch, even on systems with newer NVIDIA drivers that fixes this issue, will also cause this fog issues to appear.

Comparison

Source - Old Engine fog bug.jpg

See also

External links

References

References
1. Source DirectX9 grey fog bug
a0divided: This bug basically only happens while using DX9 with games that run on pre-Orangebox versions of Source, like Sin as mentioned above or HL2 & EP1 before the 2010 engine update.

But what's interesting is that this bug was fixed at some point by Nvidia, at least on their newer cards with the latest drivers. I currently have an RTX 3060 Laptop GPU with driver 516.5 and the fog actually works properly on DX9. Unfortunately, I think it's still bugged with AMD or Intel GPUs...  Retrieved April 21, 2025.

2. Verified by leonidakarlach (talk) 01:36, 14 September 2024 (PDT):
Appeared to be fixed. Using RTX 3060 (desktop) and driver version 560.81. Using something like DgVoodoo2 would break this again.