Env fog controller: Difference between revisions
(Added little hint that the env_fog_controller needs to be activated via commands in single player sessions) |
(Added ActivateAllPlayers input for p2ce) |
||
Line 60: | Line 60: | ||
{{bug|Does not work correctly. The fog will transition to nothing and then abruptly change to the new values at the end of the interpolation time. Seen in {{l4d2}}{{csgo}}.}}}} | {{bug|Does not work correctly. The fog will transition to nothing and then abruptly change to the new values at the end of the interpolation time. Seen in {{l4d2}}{{csgo}}.}}}} | ||
{{IO|ActivateAllPlayers|only={{P2CE}}|Turns this fog on for all connected players}} | |||
{{I BaseEntity|prel4d=1}} | {{I BaseEntity|prel4d=1}} | ||
Revision as of 18:03, 11 August 2020

Template:Base point It determines the properties of aerial fog for the whole map.

SetFogController
input. (Also applies to single player sessions, like in 
In , multiple
env_fog_controller
s may be used in conjunction with fog_volumes to create different fog effects where needed. In addition, an env_fog_controller
can be set as the Master fog controller under flags, in cases where a fog_volume
is not tied to any specific env_fog_controller
, or if no fog_volume
is used in a region.









If the game has round restart mechanics this entity may not behave as expected:
|
Adding fog to a map can cause/require changes to the lighting for realism. Light is scattered and absorbed as it passes through fog. The denser the fog, the greater the effect:
- Falloff - (or attenuation) is the rate at which light intensity decreases over distance. Falloff distance decreases as fog gets thicker.
- Tyndall effects - can be seen when the fog particles reflect light toward the viewer. Halos and light beams become more visible as fog gets thicker.
- Diffused Lighting - the boundary-line between light and shadow becomes more blurred (diffuse) as fog gets thicker. See Lightmap Scale and shadow_control's "distance" parameter.
Older Source games render fog as a plane a certain distance away from the camera. This method is bad, as rotating the camera will strengthen or weaken the apparent amount of fog in a particular spot, even though the viewer hasn't moved at all. In Left 4 Dead[confirm] onward, this is fixed by implementing a new radial method which is independent from the viewing angle.

env_fog_controller
settings.Flags
- 1: Master - If multiple
env_fog_controller
s are active, this one will always take priority.
Keyvalues
- Fog Start (fogstart) ([todo internal name (i)]) <float>
- How far away from the viewer the fog should start.
- Fog End (fogend) ([todo internal name (i)]) <float>
- How far away from the viewer the fog reaches Fog Max Density.
- Fog Max Density (fogmaxdensity) ([todo internal name (i)]) <float>
- Maximum density the fog may reach. Expressed as a decimal percent, so for 45% put 0.45.
- Far Z Clip Plane (farz) ([todo internal name (i)]) <integer>
- Anything beyond this distance in world units will not be rendered. This should be higher than Fog End. If this is used, Fog Max Density should be set to
1
otherwise the void may be visible.
- Secondary Fog Color (fogcolor2) ([todo internal name (i)]) <color255>
- Secondary Fog Color. If Fog Blend is disabled, this color will never appear.
- Fog Blend (fogblend) ([todo internal name (i)]) <boolean>
- Enables color blending between Primary Fog Color and Secondary Fog Color. When the viewer looks in the Primary Fog Direction, fog will appear as the Primary color. When looking away from the specified direction, fog appears as the Secondary color. If the camera is not pointed directly at or away from the direction, a blend of the two colors will result. Sunlight with a Yaw of 45 degrees and a Pitch of -45 degrees could be enhanced using a Primary Fog Direction of "-1 -1 1", a Primary Fog Color of "120 110 100" and a Secondary Fog Color of "80 70 60".
- Primary Fog Direction (fogdir) ([todo internal name (i)]) <vector>
- A vector (given by three space-separated numbers X Y Z) which the viewer camera is checked against to figure out the blend between the primary and secondary fog colors.
- Use Angles for Fog Dir (use_angles) ([todo internal name (i)]) <boolean>
- Use Pitch Yaw Roll for the Fog Blend direction instead of Primary Fog Direction. There isn't much use for this unless you want the direction to rotate.
- Interpolate time (foglerptime) ([todo internal name (i)]) <float>
- Fade time for the
StartFogTransition
input.
- HDR Color Scale (HDRColorScale) ([todo internal name (i)]) <float> (in all games since
)
- Multiplier for fog color when in HDR mode.
- Zoom Fog Scale (ZoomFogScale) ([todo internal name (i)]) <float> (in all games since
)
- Scalar for fog start and end distances when the player is looking through a gun's scope (e.g. AWP).
- Minimum / Maximum DX Level (mindxlevel / maxdxlevel) <integer choices> (removed since
)
- The entity will not exist if the engine is running outside the given range of DirectX Versions.
Choices Warning:If these are used, the object may break when the user switches their DirectX settings.[missing string]
- 0 - Default (no bounding)
- 60 - DirectX 6 (!FGD for mindxlevel)
- 70 - DirectX 7
- 80 - DirectX 8 (GeForce4 Ti & FX 5000 series)
- 81 - DirectX 8.1 (GeForce FX 5800, 5900 & Radeon 8500/9100 and 9000/9200)
- 90 - DirectX 9 Shader Model 2
- 92 - OpenGL аналогичен DirectX 9 Shader Model 2 (using ToGL;
only) !FGD
- 95 - DirectX 9 Shader Model 3 (in all games since
)
- 98 - DirectX 9 Shader Model 3 on Xbox 360 (
only) !FGD
- Minimum / Maximum Effect Details Level (mincpulevel / maxcpulevel) <integer choices> (in all games since
)
- Don't render for players with Effect Details levels that exceed the minimum or maximum.
Choices - 0: Default ("Low" for
mincpulevel
, "High" formaxcpulevel
) - 1: Low
- 2: Medium
- 3: High
- 0: Default ("Low" for
- Minimum / Maximum Shader Details Level (mingpulevel / maxgpulevel) <integer choices> (in all games since
)
- Don't render for players with Shader Details levels that exceed the minimum or maximum.
Choices - 0: Default ("Low" for
mingpulevel
, "Very High" formaxgpulevel
) - 1: Low
- 2: Medium
- 3: High
- 4: Very High
See also: cpu_level / gpu_level convars- 0: Default ("Low" for
Inputs
- TurnOn
- Turns the fog on.
- TurnOff
- Turns the fog off.
- SetStartDist <float >
- Sets the Fog Start distance.
- SetEndDist <float >
- Sets the Fog End distance.
- SetColor <color255 >
- Sets the Primary Fog Color.
- SetColorSecondary <color255 >
- Sets the Secondary Fog Color.
- SetFarZ <integer >
- Sets the Far Z Clip Plane distance.
- SetAngles <angles >
- Sets the angles to use for the Primary Fog Direction.
- Set2DSkyboxFogFactor <float > (in all games since
)
- Set the current amount of fog to blend into the 2D skybox. Expressed as a decimal percent, so for 45% put 0.45.
only.
- SetColorLerpTo <color255 > (in all games since
)
- Stores a value for Primary Fog Color that is set once the
StartFogTransition
input fires.
- SetColorSecondaryLerpTo <color255 > (in all games since
)
- Stores a value for Secondary Fog Color that is set once the
StartFogTransition
input fires.
- SetStartDistLerpTo <float > (in all games since
)
- Stores a value for Fog Start that is set once the
StartFogTransition
input fires.
- SetEndDistLerpTo <float > (in all games since
)
- Stores a value for Fog End that is set once the
StartFogTransition
input fires.
- SetMaxDensityLerpTo <float > (in all games since
)
- Stores a value for Fog Max Density that is set once the
StartFogTransition
input fires. This one does not have any non-"LerpTo" counterpart.
- Set2DSkyboxFogFactorLerpTo <float > (in all games since
)
- Set the current amount of fog to blend into the 2D skybox. Expressed as a decimal percent, so for 45% put 0.45. This will only change once the
StartFogTransition
input fires.only.
- StartFogTransition (in all games since
)
- When fired, the fog fades to any new values sent through the "
LerpTo
" inputs. Fade time is determined by the Interpolate time keyvalue.


