Go Back   www.tombraiderforums.com > Tomb Raider Modding > Tomb Raider Level Editor > Tutorials and Resources

Closed Thread
Thread Tools
Old 02-09-15, 10:33   #1
Join Date: Dec 2011
Location: Hungary
Posts: 3,528
Default TRNG - Fog Distance

by Paolone

Enable the Distance Fog

To enable the Fog Distance you need to type in your script.txt following commands:


ForceVolumetricFX= DISABLED ;Disable VolFx and enable distance fog
Fog= 255,255,255 ;Set the color of the fog
FogRange= -20, 10 ;set the start and end range for distance fog

You can set different values about fog= color and FogRange=, of course.

In this tutorial we'll see the most interesting settings for above commands.

The image for reference

Above image is the scene we'll use to apply different fog settings.

It is a room of Cleopatre's Palace, where I removed all lights and shadows to avoid confusion with the fog settings we'll apply.

All rooms have an ambient light of 128,128,128, and also this choice has been taken to avoid further confusion with fog color.

Tips & Tricks: the diagnostic for Fog

If you enabled the diagnostic in [Option] section of script.txt, you can see also new values about fog distance.

You can see FogStart, EndFog and all RGB color of fog.
This feature is interesting to monitor some dynamic fog effects, but also to help you to choose the best fog settings in real time.

You have some short-cuts to modify all setting for fog:

The 'S' key allows to modify the StartFog value. You can type in same moment the F1 key to reduce the StartFog, or the F2 key to increase it.

The 'E' key changes the EndFog value. You have to keep down E key and then hit F1 to reduce or F2 to increase the end fog value.

You can also change the current color of fog using the key 'R', 'G', and 'B', for Red, Green and Blue intensity, togheter with F1 or F2 key in similar way of fog limits.

Tip: if you are testing some dynamic effect it's probably you'll have to perform a lot of attemptes before finding the wished result. To reduce the time of these attempt it's better you place in level only a "Perform triggergroup" trigger, and then type in script.txt the trigger to enabled the dynamic effect.
In this way you'll be able to modify only the script.txt and click [Build] to perform another attempt with different value and this operation is faster than build the level with output wad and tom2pc conversion.

See how change the trigger settings directly in the script.txt file . (below)

Start Fog setting

Above images have the same value for color (Fog=0,255,255) and End-Fog (8 sectors), while the only difference is the beginning of fog, set with StartFog settings.

In left image the start fog is -2 (negative value), while at right is 0.

Above images allow to understand because it's important set a negative value for Start Fog.

If you type a 0 value (like in right image), Lara is fully out of the fog, and this is not realistic in a fogged ambient.

End Fog Setting

The EndFog setting (i.e. the second value you type in FogRange= command) set from where the fog is so dense to toggle any visibility.

In above pictures the EndFog is 12, and you can compare with previous couple of pictures, that in this case the view is more far, reaching the more far wall of this room.

The only difference of above images is the fog color (Fog=0,255,255) for left image, while a black color (fog=0,0,0) for right image.

When you use the black color is not easy understand that the effect is a fog distance, anyway the result could be ideal to simulate an outside nighty ambient where lara is able to see only to short distance like it should happen in the night, for example under a moon light.

Increase the Density of Fog

If you modify the Start-Fog, reducing its value, you get a most density of fog.

In above pictures, at left we have a start-fog = -2, while at right is -16.

The End-Fog is the same for both images (= 14)

You can see as in right image there is more fog color, altough the last visibility (in bottom of room) is almost the same because end-fog has not been changed.

Get a very short visibility

If you reduce drammatically the End-Fog value, you get a very short visibility for Lara (and the player).

It's a suggestive effect to explore misterious sites.

The fog ranges are : for left image FogRange= -2, 5 , while for right image is FogRange=-11, 5.

In right image you can see an effect of deep night, anyway in a static image it's not easy understand the suggestion you get in a dynamic action.

Lara will have a very short visibility but all reamining of the ambient is the dark. Lara moving her will be always with same short visibility, seeing further zones of room only when she is very closed to them.

This effect is better than a simply reducing of ambient light, or placing some shadow, because in these cases the dark zones are still, always in same position, while with a black deep fog, lara will be always encirlced by the dark, but she will have always a bit of visibility closed to her.

Dynamic Fog Effects: Desert Storm 1

From version, have been added other flipeffect trigger for distance fog:

"Weather. Fog. Change Start limit of Distance Fog in <&>way with (E)speed"
"Weather. Fog. Change End limit of Distance Fog in <&>way with (E)speed"

Both flipeffect change a parameter of fog (start or end fog) in random (or pulse) mode with a given speed.

The target of Random way is to simulate a variable density of the fog like it could happen in a desert storm, where the visibility changes, from moment to moment, in according with further clouds of sand (or dust) passing in front of Lara.

If you choose correct settings you can give really the idea of cloudes moving in the ambient and it's an amazing effect in particular way if you use a wind-sound as background music.

In above pictures you can see two moments of automatic (end-less, if you wish) changing of fog density.

For this example it has been used this trigger:

; <#> : Weather. Fog. Change Start limit of Distance Fog in <&>way with (E)speed
; <&> : RANDOM way - Huge Intensity (16 sectors)
; (E) : Middle (3 seconds)

Starting from a FogRange= -16, 8 setting.

This first example of variation of fog density has been get modifying the start-fog value.

You should remember that, to get visible result with start-fog, you should use wide range (in above example I used "Huge Intensity (16 sectors)) but when you change the end-fog value the speech is different...

Desert Storm 2

If we use the other trigger to simulate desert-storm, that to change End-fog value:

"Weather. Fog. Change End limit of Distance Fog in <&>way with (E)speed"

We get a variation a bit different than first example. See above pictures.

In this case, in fact, some zones in front of lara will disappear or reappear, like if a very deep cloude moved in front of lara, but at some distance from her.

To get above effect I used this trigger:

; <#> : Weather. Fog. Change End limit of Distance Fog in <&>way with (E)speed
; <&> : 2 RANDOM way - Middle Intensity (2 sectors)
; (E) : 2.0 Fast (2 seconds)

Starting from a setting of: FogRange= -2, 4

As you can see, when you change the End-Fog value in dynamic way it's better using a short Intensity (I used "2 sectors") otherwise the effect could be very weird in game.
It's probably that, the better results could be get using both desert storm effects in same time: modifying start-fog and end-fog in same time, you should get a more realisitch chaotic modifying in this storm.

How speed the ajusting of Dynamic parameters

Since you'll have to do many attempts before find the wished setting for your dynamic effect, you can reduce the times with a little trick.

Instead of opening NGLE, modify the trigger flipeffect, and convert newly your level, you can place in level only a trigger to perform a triggergroup typed in script.txt.

In this way you have no need to launch ngle and build the level every time, and it will just you change only the setting in script.txt file, saving a lot of time.

To modify the exported trigger just you work on last of three numbers:

; Exporting: TRIGGER(769:0) for FLIPEFFECT(228)
; <#> : Weather. Fog. Change End limit of Distance Fog in <&>way with (E)speed
; <&> : 2 RANDOM way - Middle Intensity (2 sectors)
; (E) : 2.0 Fast (2 seconds)
; Values to add in script command: $2000, 228, $301

TriggerGroup= 1, $2000, 228, $301

In the level you'll have a flipeffect trigger to perform the TriggerGroup=1.

Now to change the values of above exported trigger, just you change the $301 number remembering that the lower digit "1" is the timer value, i.e. the "<&>way" mode, while if you want change the "(E)speed" you have to modify the first digit from left (currently it is the "3")

You can use this list to discover the values to type:
"<&> Way", to type in $ooX digit:

0: 1 RANDOM way - Low Intensity (1 sector)
1: 2 RANDOM way - Middle Intensity (2 sectors)
2: 4 RANDOM way - High Intensity (4 sectors)
3: 8 RANDOM way - Very high Intensity (8 sectors)
4:16 RANDOM way - Huge Intensity (16 sectors)
5:32 RANDOM way - Max Intensity (32 sectors)
8: 1 PULSE way - Low Intensity (1 sector)
9: 2 PULSE way - Middle Intensity (2 sectors)
A: 4 PULSE way - High Intensity (4 sectors)
B: 8 PULSE way - Very high Intensity (8 sectors)
C:16 PULSE way - Huge Intensity (16 sectors)
D:32 PULSE way - Max Intensity (32 sector)

While for (E)speed to type in $Xoo digit:

0:6.0 Very Slow (6 seconds)
1:4.0 Slow (4 seconds)
2:3.0 Middle (3 seconds)
3:2.0 Fast (2 seconds)
4:1.0 Very Fast (1 second)
5:0.5 Ultra Fast (0.5 seconds)

In above list you have to read the first character, that is at left of ":" character.

For example if you want set the effect with these settings:

2: 4 RANDOM way - High Intensity (4 sectors)


4:1.0 Very Fast (1 second)

You'll change the last number of TriggerGroup in this way:


because the "4" is for "4:1.0 Very Fast (1 second)", while the "2" is for "2: 4 RANDOM way - High Intensity (4 sectors)"

So, in above case, the triggergroup will become:

TriggerGroup= 1, $2000, 228, $402

Now just you click on [Build] button and then start Tomb to try the new setting.

The Pulse Dynamic Effect

About the PULSE mode, it's not advisable to simulate natural events, because with pulse, the density or the end-fog change in regular way, from minimum value to max.

For this reason you could use the PULSE effect only to simulate weird light effects closed to misterious machines, alien-ships or other mechanical engines. In these situation it's better use colored fog and not a simply white fog color, like for the desert storm examples.

How Fix the Bug about Water Color

When you use the distance fog in all transparent textures born the problem of excessive saturation with fog color.

Since this saturation is really excessive I tried to create a fixing.

You can enable this fixing typing in [Level] section (or [Title] section to extend to all levels) the command:


When above command is present the fog will be removed by transparent textures, on objects or from water textures.

How you can see, the transparent texture of object came back to correct reflection, and also the water seems normal.

AkyV is offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT. The time now is 04:19.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.