Fog for CGF
(OpenGL1.1 graphics drivers only)
If you have an up to date graphics boards that implements the full
OpenGL library (most new boards, and also the 3dfx Voodoo series via
a trick described here),
CGF brings you something special: fog (CGF versions 0.80 and later).
Fog reduces visibility, and adds atmosphere. It transforms a standard
sniper map into a map that requires a new way of combat. You'll
change your tactics, weapon preferences, and experience a map anew, as
can be seen from the screen shots below.
Note that on some maps (and for some drivers), fog doesn't seem to work
right: player models light up in the distance. It's out of my control
(and there must be a reason why Id Software didn't enable fog in the first
place).
There are four important aspects to fog in CGF:
- it's optional (and defaults to 'off'); only when you set the console var 'fog' to 1,
run the OpenGL video mode, and load a new map (or mission), you'll see fog
- it's fully configurable - pick the type of fog, fog density, fog color
and define your default and per map preferences
- the bot AI understands fog and operates with reduced visibility. The AI also
understands the ability to 'hide' in the fog.
Your preferences regarding
fog type and fog density are taken into account - not a trivial thing to do
but it didn't take rocket science either.
- you can toggle fog on a mission per mission basis - set fog to '0' and the next
mission is ran without fog (and AI understanding this). Set fog to '1' and during the
next mission, everything will be hazy (including the bots' vision).
Fog preferences are stored in the directory '.\action\cgf\fog' as '*.fog' files. The directory
will contain the following files:
- default.fog
contains the default fog settings that are applied when 'fog' is enabled and no
map specific settings have been found.
- <mapname>.fog
contains the map specific fog preferences for map <mapname>. By defining a fog density of '0',
fog is disabled for that map.
A '*.fog' fog preferences is really a text file that you can view and edit. It looks like:
// format: mapname density fog_type red green blue begin end
// - density: 0.00 -> no fog
// density normally in range 0.05 ... 0.20
// - fog_type: 0 = exp (fog linear with distance)
// 1 = exp2 (fog increasing more than linear)
// 2 = linear (fog linear within specific begin-end range)
// - red/green/blue in range [0.0 .. 1.0]
// - begin: start distance for linear fog (no fog within begin dist)
// - end : end distance for linear fog (no vision beyond end dist)
actcity2 0.10 2 0.50 0.50 0.45 200 1600
To craft a new preference file for map <mapname>, all you have to do is:
- copy the defaults.fog file to <mapname>.fog
- change, at the last line, 'default' to <mapname>
- pick a fog density (0 = no fog, good values are between 0.05 and 0.20)
- pick a fog type - linear fog (value: 2) tends to work best, followed by exp2
(value 1)
- define the fog color by specifying values for the red, green and blue components.
Values close to grey (red, green and blue values identical work best - change
one of these for a slight color effect - actcity2 above has a yellow shaded fog).
Note that the fog itself adds or removes ambient light from the map: picking
small values, such as 0.1 0.1 0.1, results in a very dark map, whereas large values,
such as 0.8 0.8 0.8 results in a bright map.
- pick a begin distance (for linear fog only). Fog effects won't start at distances
smaller than this. (Distance in Q2 units (about an inch)).
- pick an end distance (for linear fog only). You cannot see thru fog beyond this
distance (and neither can the bots). (Distance in Q2 units (about an inch)).
- save the file and launch the game
In most cases, the fog defaults suffice. In 'office style' indoor maps, you map want to
disable or reduce the fog considerably though.
The effects of fog color are shown below:
The table below lists information on 3D chipsets and their support for fog. The
table reflects the information I've received from gamers. I do not guarantee its accuracy. If you get
fog working on one the of 'probably' boards work, please let me know.
To determine the chipset in your 3D accellerator, don't email me but look it up in the manual or on
the box accompanying your 3D accellerator.
chipset support for fog (via OpenGL1.1 drivers)
|
supported
|
probably
|
probably not
|
no
|
Riva TNT
Riva TNT2
Matrox G400
using OpenGL ICD
3dfx Voodoo
with glquake opengl32.dll
|
Savage4
|
ATI Rage 128
ATI Rage Pro
|
3dfx Voodoo
with 3dfx Q2 drivers
Matrox G400
using Turbo DLL
|
Apparently, fog can be enabled on the 3dfx Voodoo board using the following trick:
- get the opengl32.dll intended for glquake (Quake1);
it's
here at FilePlanet.
- copy the opengl32.dll into your quake2 (root) dir
- launch Quake2, in the video menu, set the mode to 'default opengl'
- make sure you've set fog to 1 (see here)
- quit and launch CGF
I wouldn't have been able to add fog to CGF without the work and assistance of:
William