category
General Half-Life 2/Effects
description
Basic looking and easy to get working.
keywords
fog, env_fog_controller, adding.
Fog is a useful effect to have in your map; it provides vast amounts of atmosphere mainly because it obscures your vision so you’re not quite sure what is in the distance or if something just moved in the shadows.
In this tutorial I will talk you through creating and tweaking fog for your maps.
Click on the entity tool
or simply press Shift+E.
On the right of your screen you will see two scroll menus with “categories” and “objects” written above them. Make sure in the pop down menu with “categories” written above it has the word “Entities” showing in there.
Next click on the “objects” pop down menu; scroll down until you find “env_fog_controller” then left click on it.
Now just create the entity anywhere around you map as long as it inside the skybox. The location of the entity will not effect how it looks in game.
You’re almost done; all you need to do now is “enable” the fog.
Do this by right clicking on the “env_fog_controller” entity, then scroll down to properties and left click it. The Object properties box will then pop up. Now in the key values box click on “Fog Enable” then to the right you should see a pop down menu with the word “no” there. Simply click this and change it to yes, hit apply and you’re done.
That’s it you’re fog is completed it will be really faint until its tweaked but its there, compile your map and check it out.
You probably just compiled and thought “where the hells the fog?” well valve’s default fog settings are really faint, but if the map was bigger you would be able to see it better. Creating fog is one of those things were its really easy to make, but to look good with your map requires a hell of a lot of tweaking and experimenting. Each map will look different in fog even if the settings are exactly the same, that’s why it’s important to experiment. But don’t worry your not on your own. I will pass on all I know. So here goes, ill start of with the entities object properties.
Name = You can give your fog entity a name, useful for vis grouping and tying entities together.
Min/Max DX level = this defines the direct x level of the shaders used in hl 2. If you just set these to default lowest and highest, cs:source will choose the direct x level for the person using the map.
Fog enabled = this defines whether or not fog shows up in your map. If set to yes fog is activated and will show up in game, if set to no fog will not be activated and will not be shown in game.
Fog Blend = to be honest I have no idea what this option does; I can only hazard a guess. I should imagine it toggles the blending of the primary an secondary fog colour, but don’t quote me on this.
Use angles for fog dir = this toggles whether to use the angles to determine the fogs direction. If set to yes it will use angles, if set to no it will just use default.
Primary fog colour = the primary fog colour is the colour that will be the most apparent so set this to the colour you want your fog to be.
Secondary fog colour = the secondary fog colour seems to be highlights set this to any colour you want. *TIP* it looks more natural if you keep it the same colour as your “primary fog colour” but just change the darkness or the brightness.
Primary fog direction = this defines the direction of the fog. It only works is “use angles for fog dir” is set to yes.
Fog start = this defines the distance from the player that fog will start to be rendered.
Fog end = this defines the distance from the player that the fog will stop being rendered.
Far Z plane Clip = I’m not sure what this does, but make sure you keep it at its default valve other wise you will get some real nasty clipping problems in your map.
Okay so know you have a basic idea of what everything does, its time to begin
experimenting. All I can offer now is some advice and a sample of my tweaked fog.
The “fog start” number must be bigger then the “fog end” number to look good in game. If the numbers are the same you will get either no visible fog or so much fog you cannot see anything but white. The bigger the difference between “fog start” and “fog end” the thinner the fog. The closer together the thicker the fog. Here’s a sample of the values I used for some nice subtle fog:
Name - fog
Fogstart – 10
Fogend – 1250
Primary fog colour - 195 195 195
Secondary fog colour - 255 255 255
Blend – Yes
That’s it; you will learn how to make effective looking fog well if you practice over and over again its one of those things that needs constant tweaking to obtain perfection. I hope this tutorial helped, good luck.
Example maps:
http://www.interlopers.net/downloads/maps/fog.zip
Contributed by Signy