From Valve Developer Community
Jump to: navigation, search
Env fade.png
env_fade is a point entity available in all 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.

In code, it is represented by class CEnvFade, defined in EnvFade.cpp.


ConVar/CommandParameters or default valueDescriptorEffect
fadeinfloat int int int 0Time (seconds), Red, Green, Blue, To doMakes the screen black (or the specified color), then fades to the normal view. To do: Why is the last number required?
fadeoutfloat int int int 0Time (seconds), Red, Green, Blue, To doFades the screen to black (or the specified color). To do: Why is the last number required?


  • 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.


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> (New with Portal 2)
The duration of the reverse fade.


Classname (classname) <string>
Name (targetname) <string>
The name that other entities refer to this entity by.
Global Entity Name (globalname) <string>
Parent (parentname) <targetname>
Origin (X Y Z) (origin) <coordinates>
Flags (spawnflags) <integer>
Response Contexts (ResponseContext) <string>
Effects (effects) <integer> !FGD
Combination of effect flags to use.
Local Time (ltime) <float> !FGD
Next Think (nextthink) <float> !FGD
Amount of time before the entity thinks again.
Hammer ID (hammerid) <integer> !FGD


Start the screen fade.
FadeReverse  (New with Portal 2)
Begin doing the reverse of the current fade.
Alpha  !FGD
Changes Fade Alpha.
Color  !FGD
Changes Fade Color.


SetParent  <string>
Move with this entity. See Entity Hierarchy (parenting).
SetParentAttachment  <string>
SetParentAttachmentMaintainOffset  <string>
AddOutput  <string>
Evaluates a keyvalue/output on this entity.
Format: <key> <value>
FireUser1 to FireUser4
Fire the OnUser outputs; see User Inputs and Outputs.
Use  !FGD
This input is not included in Valve's FGDs.
DispatchEffect  <string> !FGD
DispatchResponse  <string> !FGD
Dispatches a response to the entity. See Response and Concept.
AddContext  <string>
RemoveContext  <string>
ClearContext  <string>
Removes all contexts from this entity's list.
RunScriptFile  <script> (New with Left 4 Dead 2)
RunScriptCode  <string> (New with Left 4 Dead 2)
Execute a VScript function in the scope of the receiving entity.
SetLocalOrigin  <coordinates> (New with Alien Swarm) !FGD
SetLocalAngles  <angles> (New with Alien Swarm) !FGD
Set this entity's angles.


Fired when the fade has begun.


OnUser1 to OnUser4
OnKilled  (Only in the Left 4 Dead series)