Call of Duty 5: Fog: Difference between revisions

From COD Modding & Mapping Wiki
Jump to navigation Jump to search
Line 44: Line 44:
This function is new to COD games, it creates an volumetric fog on your level. Main difference with the above SetExpFog is that SetVolFog has 2 extra parameters for the height of the fog.
This function is new to COD games, it creates an volumetric fog on your level. Main difference with the above SetExpFog is that SetVolFog has 2 extra parameters for the height of the fog.


With:                                       Without:
With:<br><br>
[[Image:setvolfog_on.jpg|500px]] [[Image:setvolfog_off.jpg|500px]]
[[Image:setvolfog_on.jpg|350px]]  
 
 
Without:<br><br>
[[Image:setvolfog_off.jpg|350px]]


*The functions is of this form:
*The functions is of this form:

Revision as of 19:45, 30 November 2008

There are now 2 type of scripted fog in COD:WW, here is a quick tutorial on how to use them and what they do.

SetExpFog

Theory

This function has been present in previous COD games, it creates an exponential fog on your level:

With:


Without:


  • The functions is of this form:
SetExpFog( <startDist>, <halfwayDist>, <red>, <green>, <blue>, <transition time> )

Parameters:

  • <startDist> The distance, in world units, at which the fog begins.
  • <halfwayDist> The distance, beyond the startDist, at which the scene will be 50% fogged.
  • <red> The red component of the fog as a value between 0.0 and 1.0
  • <green> The red component of the fog as a value between 0.0 and 1.0
  • <blue> The red component of the fog as a value between 0.0 and 1.0
  • <transition time> transition time in seconds

Implementation in Levels

  • To add SetExpFog to your level open up your Map GSC and anywhere after maps\mp\_load::main() add this:
setExpFog(100, 1000, 0.4, 0.425, 0.44, 0.0);
  • Replace the values to your liking of course (Values above are the one used in the example pictures on top)
 SetExpFog is the function used to create Nightmode in many mods for COD4.

SetVolFog

Theory

This function is new to COD games, it creates an volumetric fog on your level. Main difference with the above SetExpFog is that SetVolFog has 2 extra parameters for the height of the fog.

With:


Without:

  • The functions is of this form:
setVolFog(<startDist>, <halfwayDist>, <halfwayHeight>, <baseHeight>, <red>, <green>, <blue>, <transition time>)

Parameters:

  • <startDist> The distance, in world units, at which the fog begins.
  • <halfwayDist> The distance, beyond the startDist, at which the scene will be 50% fogged.
  • <halfwayHeight> The height, in world units, at which the fog will be fogged
  • <baseHeight> The height, in world units, at which the fog will begins
  • <red> The red component of the fog as a value between 0.0 and 1.0
  • <green> The red component of the fog as a value between 0.0 and 1.0
  • <blue> The red component of the fog as a value between 0.0 and 1.0
  • <transition time> transition time in seconds

Implementation in Levels

  • To add SetExpFog to your level open up your Map GSC and anywhere after maps\mp\_load::main() add this:
setVolFog(300, 1800, 0, 0, 0.4, 0.425, 0.44, 0.0);
  • Replace the values to your liking of course (Values above are the one used in the example pictures on top)