Tutorial #7: Fog (click to download .UNR) | Author: freakscne | Last Updated: May 25th

Unreal Tutorial #7 Freakscne’s Fog Note: Before getting into fog you should have read through the first two basic tutorials. Fog is a lot simpler than it may seem. The first thing you need to do is define a zone that your fog will exist in (zones are used for determining visible polygons in an area and for assigning zone properties to an area, but for this tutorial you just need to know that they will define your fog area).

Make your zone

There are two ways to define a zone, but I'll show you the easier way, which is to make a special Zone Portal brush. First decide what room or rooms you want the fog to reside in. Then right-click on the selected area in your 2D view and choose Copy Selected Polys -> To Brush. This will copy the dimensions and location of that area to your brush. You should now see your brush shape over the existing room areas. Now click on the "add special brush" tool. This is represented by the solid green square icon on the toolbar (the 3rd column of buttons, on the fourth row), which enables you to add a special type of polygon. When you click on the "add special brush" tool, a little dialog box comes up with several pull-down options.

Choose the "Zone Portal" pulldown option.Click on "Add Special" and then click "Close." What you did is place a Zone Portal poly matching the area you want fog to be in.

Getting in the zone

The next thing we have to do is add a ToggleZoneInfo class actor to the zone area. If you've already worked through the Water tutorial, you know how to do this. On the right side of your UnrealEd window you should see the texture list and above that a popup menu that says Browse: [Textures]. Change this popup to Classes and the actor classes will appear. Click on the + signs to expand a class. ToggleZoneInfo class is located under Info -> Zone Info. Highlight ToggleZoneInfo and then right-click somewhere in your zone area and select "Add ToggleZoneInfo here." After you add ToggleZoneInfo to the zone, right-click on it and select ToggleZoneInfo Properties. Expand ZoneInfo and set bFogMode to True. Close that window.

Full window view [98KB]

Let there be light

Now, although you now have specified your zone to have fog, you won't see it until you have a light in the area. First Rebuild (F8) so that you can see the changes in your light source and fog. Now right-click to Add a Light Here somewhere in the zone and right-click on the light to set its properties. The two big properties to set are under Lighting: Volume Brightness and Volume Radius. Volume Brightness, as far as I can tell, approximates how much the fog reflects the light source. Volume Radius is the actual radius of the fog - the center starts from the light source. By playing with these props and the light brightness and radius, you should get a fog that suits you. Also, you can make the fog colored by changing the light's hue (turn down the saturation too to do this) - these props are under LightColor. You should see fog in your 3D view like this:

Full window view [91KB]

If you have any further questions, look me up in #unrealed. And if anyone knows how to get the ToggleZoneInfo -> ZoneLight props to work with fog, send me a line. Good luck!

FOG and Zone Boundries

If you want fog to be seen from a zone, that zone MUST have a togglezoneinfo with bFogMode=true, even if that zone will not have fog in it. To avoid your lights affecting the fog, set the light's fog properties to 0.

freakscne (brett@jamisongold.com)