Half-Life 2 offers a couple ways to create particle-based fog effects: func_dustcloud and func_smokevolume. Over time, most level designers have gravitated toward smokevolume because in some update, dustcloud became ugly. Instead of nice puffs of dust, it now rendered giant translucent spheres.
Unfortunately, smokevolume is a fairly expensive entity in comparison and it can’t cover wide distances without causing framerate hiccups.
Inspired by The_Blazer’s post on PlanetPhillip’s CombinationVille, I decided to look into why func_dustcloud sucked. It turns out there’s a very easy solution to make it look like the below image again.
I looked into Valve’s Github repository and found func_dust.cpp, the code which controls not only dustcloud, but also dustmotes. This code precaches a material called particle/sparkles.vmt. It’s an extremely low-res, 32×32 ball-shaped gradient which looks fine for tiny dustmotes, but terrible for dustcloud.
The solution is simple. You need to overwrite this material by creating your own sparkles.vmt file.
For the above image, I basically cut-and-paste the settings from particle_smokegrenade, which Valve uses for a lot of its dust entities, into a text file.
(Note: if you copy-paste the above into a text file, make sure the quotation marks are ” [i.e. Shift-‘], not the slanted open-close kind).
For Individual Mods
Save the above as sparkles.vmt and place it in <yourmod>/materials/particle (note: particle, not particles).
For Individual BSPs
I haven’t tried this, but I suspect you could use Pakrat to embed sparkles.vmt in the proper folder within your BSP.
If you want to make this change for all Half-Life 2 content, put sparkles.vmt in steamapps/common/Half-Life 2/<game>/custom/sparkles/materials/particle, where <game> is hl2, episodic or ep2. Please note, I haven’t thoroughly tested this and there could be some weird visual side effects. If you want to undo it, all you should need to do is remove sparkles.vmt.
The func_dustcloud I have shown in the picture above has the following settings:
- Particles Per Second: 60
- Maximum Visible Distance: 1792
- Alpha: 160
- Minimum Particle Size: 64
- Maximum Particle Size: 128
One thing to keep in mind is that because this material is shared with func_dustmotes, your dustmotes will look a bit different – more like puffballs than round orbs. They still look fine, however.