Fog Blending

This tutorial assumes you have an existing basic knowledge of how to set up fog in source.

This was pointed out to me by one of the artists here at work as a painless way to get effective in-game fogging set up, both in the map itself and in the 3D skybox, with a seamless transition between the two.

Add a fog_controller to your map
Add a skycamera to your 3D skybox (you should have one already)

Run your compiled map in the engine, and in console turn on;

developer 1
sv_cheats 1
fog_overide 1
fog_enable 1
fog_skyboxenable 1 (if you want to edit the skybox fog, you don’t have to)

Now you can use these commands to setup and change the fog.

fog_color (R G B) (the colour of the fog in-map)
fog_colorskybox (R G B) (the colour of the fog in the skybox)

fog_end (where the fog in level ends)
fog_start (where the fog starts)
fog_endskybox (where the skybox fog ends)
fog_startskybox (where the skybox fog starts)

Play with all these values and you can observe the effects in real time, 'on the fly' in the engine. Sort out the values that give you the most effective fogging and blend between the map and skybox, then note them all down on a pad.

Once you have these values noted down quit back to hammer and plug the values into you fog_controller and sky_camera respectively.

Tada - Kickass fog blending with little or no grief.


View comments ( 6 )

Back to top