This article's documentation is for anything that uses the Source engine. Click here for more information.

env_fade

From Valve Developer Community
Jump to: navigation, search
Underlinked - Logo.png
This article needs more links to other articles to help integrate it into the encyclopedia. Please help improve this article by adding links that are relevant to the context within the existing text.
January 2024


English (en)русский (ru)中文 (zh)
... Icon-Important.png
env_fade
Env fade.png
TypePoint entity
EngineSource Source
AvailabilityIn all games
 
class hierarchy
CEnvFade defined in EnvFade.cpp
CLogicalEntity
CServerOnlyEntity
CBaseEntity

env_fade is a point entity available in all Source Source games. It controls screen fades to or from a solid color. Add Duration and Hold Time together for the total time this entity will be in effect.

Keyvalues

Duration (seconds) (duration) <string>
The time that it will take to fade the screen in or out.
Hold Fade (seconds) (holdtime) <string>
The time to hold the faded in/out state.
Fade Alpha (renderamt) <integer>
Alpha of the fade, where 0 = fully transparent and 255 = fully opaque.
Fade Color (R G B) (rendercolor) <color255>
Fade color.
Reverse Fade Duration (seconds) (ReverseFadeDuration) <float> (in all games since Portal 2)
The duration of the reverse fade.

Flags

  •  [1] : Fade From
       Screen fades from the specified color instead of to it.
  •  [2] : Modulate
       Uses attenuation blending to achieve the fade. The normal fade does a straight weighted blend between the screen and the fading color. Modulate actually attenuates the RGB channels. For example, a color of 0 255 0 would mute the red and blue channels and create a green nightvision-type effect.
  •  [4] : Triggering player only !FGD
       Only affects the screen of the !activator. !activator is probably the easiest to reach through a trigger entity. If not checked, the fade will apply to all players.
  •  [8] : Stay Out
       Fade remains indefinitely until another fade deactivates it.
    Icon-Bug.pngBug:Team Fortress 2Fades applied to !activator only that are also set to Stay Out will not be deactivated by a new fade!
Blank image.pngTodo: Test in other games, test if the ScreenFade VScript function is also affected

Inputs

Fade
Start the screen fade.
FadeReverse  (in all games since Portal 2)
Begin doing the reverse of the current fade.
Alpha  !FGD
Changes Fade Alpha.
Color  !FGD
Changes Fade Color.

Outputs

OnBeginFade
Fired when the fade has begun.

ConCommands

Cvar/CommandParameters or default valueDescriptorEffect
fadeinfloat int int int intTime (seconds), Red, Green, Blue, AlphaMakes the screen black (or the specified color), then fades to the normal view.
fadeoutfloat int int int intTime (seconds), Red, Green, Blue, AlphaFades the screen to black (or the specified color).
Icon-Bug.pngBug:Due to mistake in code alpha value isn't read properly from these commands but if you specify rgb it also has to be specified for the fade to work.