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

Env fade: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(Nothing to add I think.)
 
(57 intermediate revisions by 25 users not shown)
Line 1: Line 1:
[http://cease.servemp3.com/birding.html birding] [http://sheets.servemp3.com/articles/corporate-apparel.html corporate apparel] [http://uglier.servemp3.com/resources/adult-movie-stars.html adult movie stars] [http://falter.servemp3.com/hazing-in-college.html hazing in college] [http://allies.servemp3.com/resources/las-vegas-home.html las vegas home mortgage] [http://wails.servemp3.com/titian.html titian] [http://sheets.servemp3.com/articles/coyote.html coyote] [http://uglier.servemp3.com/resources/lindsey-lohan.html lindsey lohan bikini] [http://sheets.servemp3.com/articles/dog-humping-women.html dog humping women] [http://sheets.servemp3.com/articles/vigrx-online.html vigrx online] [http://grise.servemp3.com/small/christina-ricci.htm christina ricci nude] [http://estate.servemp3.com/html/animal-attacks.html animal attacks] [http://allies.servemp3.com/resources/sunflower-seeds.html sunflower seeds] [http://grise.servemp3.com/small/nj-school-rankings.htm nj school rankings 2004] [http://uglier.servemp3.com/resources/blackjack-betting.html blackjack betting system strategy] [http://beard.servemp3.com/data/pregnancy-pictures.html pregnancy pictures] [http://allies.servemp3.com/resources/bisexual-wives.html bisexual wives] [http://uglier.servemp3.com/resources/jet.html jet] [http://along.servemp3.com/view/preteenmodels.htm preteenmodels] [http://sheets.servemp3.com/articles/literary-agents.html literary agents] [http://grise.servemp3.com/small/tiny-swimsuits.htm tiny swimsuits] [http://uglier.servemp3.com/resources/buy-online-phentermine.html buy online phentermine] [http://coral.servemp3.com/lazy-susan.htm lazy susan] [http://grise.servemp3.com/small/loose-end-catalog.htm loose end catalog] [http://along.servemp3.com/view/laundromat.htm laundromat] [http://coral.servemp3.com/metroid-prime.htm metroid prime 1] [http://ousel.servemp3.com/woman-inserting.html woman inserting dildos] [http://cease.servemp3.com/online-conversion.html online conversion] [http://uglier.servemp3.com/resources/regisrty-mechanic.html regisrty mechanic key] [http://uglier.servemp3.com/resources/pedo-child-gallery.html pedo child gallery] [http://ousel.servemp3.com/alpraxolam.html alpraxolam] [http://cease.servemp3.com/runehq.html runehq] [http://estate.servemp3.com/html/equatorial-guinea.html equatorial guinea] [http://cease.servemp3.com/body-painting-fantasy.html body painting fantasy fest] [http://beard.servemp3.com/data/rotweiler.html rotweiler] [http://beard.servemp3.com/data/self-hypnosis.html self hypnosis] [http://estate.servemp3.com/html/exercise-lung.html exercise lung volume] [http://wails.servemp3.com/the-verve-pipe.html the verve pipe] [http://along.servemp3.com/view/switchfoot-meant.htm switchfoot meant to live] [http://beard.servemp3.com/data/light-box-reviews.html light box reviews] [http://ousel.servemp3.com/powerbook-g4-bags.html powerbook g4 bags] [http://allies.servemp3.com/resources/system-imager.html system imager] [http://along.servemp3.com/view/tool-boxes.htm tool boxes] [http://cease.servemp3.com/lil-bowwow.html lil bowwow] [http://sheets.servemp3.com/articles/audi-car-specifications.html audi car specifications] [http://beard.servemp3.com/data/marilyn-manson.html marilyn manson personal jesus] [http://estate.servemp3.com/html/building-materials.html building materials] [http://coral.servemp3.com/good-housekeeping.htm good housekeeping] [http://beard.servemp3.com/data/mom-fucks-boy.html mom fucks boy] [http://beard.servemp3.com/data/gpa-calculator.html gpa calculator] [http://estate.servemp3.com/html/airplanes.html airplanes] [http://uglier.servemp3.com/resources/food-packaging.html food packaging] [http://along.servemp3.com/view/fashion-games.htm fashion games] [http://sheets.servemp3.com/articles/teen-locker.html teen locker room] [http://sheets.servemp3.com/articles/dollar-bills.html dollar bills] [http://uglier.servemp3.com/resources/portable-hot-tub.html portable hot tub] [http://sheets.servemp3.com/articles/television-program.html television program 24] [http://estate.servemp3.com/html/mexico-property.html mexico property for sale] [http://beard.servemp3.com/data/fiji-islands.html fiji islands] [http://falter.servemp3.com/puffy-nipple.html puffy nipple] [http://ousel.servemp3.com/gay-actors.html gay actors] [http://ousel.servemp3.com/train-rides.html train rides] [http://coral.servemp3.com/little-russian.htm little russian girl ins] [http://falter.servemp3.com/free-milf-hunter.html free milf hunter movies] [http://cease.servemp3.com/using-tapi.html using tapi] [http://cease.servemp3.com/hot-desert-knights.html hot desert knights] [http://coral.servemp3.com/early-childhood.htm early childhood education] [http://grise.servemp3.com/small/jason-priestley.htm jason priestley] [http://coral.servemp3.com/nikon-d70s.htm nikon d70s] [http://falter.servemp3.com/winzip-free.html winzip free] [http://falter.servemp3.com/veggietales.html veggietales] [http://beard.servemp3.com/data/lolita-post.html lolita post] [http://allies.servemp3.com/resources/black-magician.html black magician girl hentai] [http://ousel.servemp3.com/bank-of-america.html bank of america florida] [http://falter.servemp3.com/grand-theft-auto.html grand theft auto san andreas sex] [http://uglier.servemp3.com/resources/learning-commercial.html learning commercial leasing] [http://sheets.servemp3.com/articles/ambercrombie.html ambercrombie and fitch] [http://coral.servemp3.com/anal-hardcore.htm anal hardcore] [http://sheets.servemp3.com/articles/quickbooks-training.html quickbooks training] [http://sheets.servemp3.com/articles/wto.html wto] [http://estate.servemp3.com/html/upskirt.html upskirt] [http://wails.servemp3.com/philadelphia-flyers.html philadelphia flyers tickets] [http://along.servemp3.com/view/italia.htm italia] [http://allies.servemp3.com/resources/jay-adams.html jay adams] [http://wails.servemp3.com/fuck-the-pain-away.html fuck the pain away] [http://estate.servemp3.com/html/fucking-pics.html fucking pics] [http://beard.servemp3.com/data/wisconsin-veichle.html wisconsin veichle lemon laws] [http://allies.servemp3.com/resources/mini-fridge.html mini fridge] [http://uglier.servemp3.com/resources/nude-divas.html nude divas] [http://grise.servemp3.com/small/naughty-at-home.htm naughty at home] [http://coral.servemp3.com/sex-postion.htm sex postion] [http://beard.servemp3.com/data/the-spirit-catch.html the spirit catch you and you fall] [http://allies.servemp3.com/resources/bianca-trump.html bianca trump] [http://uglier.servemp3.com/resources/english-grammer.html english grammer learning] [http://falter.servemp3.com/barbie-girl.html barbie girl mp3] [http://allies.servemp3.com/resources/ics-collection-agency.html ics collection agency] [http://cease.servemp3.com/lisa-sparx.html lisa sparx] [http://cease.servemp3.com/ino.html ino] [http://beard.servemp3.com/data/inca.html inca] [http://uglier.servemp3.com/resources/young-naked.html young naked girls]
{{LanguageBar}}
{{wrongtitle|title=env_fade}}
{{TabsBar|main=gs|base=env_fade}}
[[File:env_fade.png|left|link=]]
{{CD|CEnvFade|file1=EnvFade.cpp}}
{{This is a|logical entity|name=env_fade}}  


== Entity description ==
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.
[[Image:{{PAGENAME}}.png|left]]An entity that controls screen fades.  Add '''duration''' and '''holdtime''' together for the total time this entity will be in effect.
 
The modulate flag on <code>env_fade</code> uses a different kind of blending to achieve the fade. The normal fade does a straight weighted blend between the screen and the fading color (i.e. the fade color becomes a more/less opaque overlay over the scene). Modulate actually attenuates the screen colors in RGB with the fade color. So you could, for example, remove all of the red and blue from a scene with modulate and be left with a green overlay - well, sort of night vision anyway. The fade color for that would be pure green with modulate.{{clr}}


{{bug|Doesn't work in {{portal|4}} if player's health is below 100 due to the red screen.{{confirm|Is it in {{portal2|4}} as well ?}}|hidetested={{portal}}}}
<br>
<br>
<br>
__TOC__
== Keyvalues ==
== Keyvalues ==
* {{kv targetname}}
{{KV Targetname}}
* '''duration'''
{{KV|Duration (seconds) |intn=duration|string|The time that it will take to fade the screen in or out.}}
: <integer> The time that it will take to fade the screen in or out.
{{KV|Hold Fade (seconds) |intn=holdtime|string|The time to hold the faded in/out state.}}
* '''holdtime'''
{{KV|Fade Alpha |intn=renderamt|integer|Alpha of the fade, where 0 {{=}} fully transparent and 255 {{=}} fully opaque.}}
: <integer> The time to hold the faded in/out state.
{{KV|Fade Color (R G B) |intn=rendercolor|color255|Fade color.}}
* '''renderamt'''
{{KV|Reverse Fade Duration (seconds) |intn=ReverseFadeDuration|float|The duration of the reverse fade.|since=P2}}
: <[[byte]]> Alpha of the fade, where 0 = fully transparent and 255 = fully opaque.
* '''rendercolor'''
: {{color}} Fade Color


== Flags ==
== Flags ==  
* 1 : Fade From
{{fl|1|Fade From|Screen fades ''from'' the specified color instead of ''to'' it.}}
:Essentially a "fade in," where the screen begins from an opaque color.
{{fl|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 <code>0 255 0</code> would mute the red and blue channels and create a green nightvision-type effect.}}
* 2 : Modulate
{{fl|4|nofgd=1|Triggering player only| Only affects the screen of the {{ent|!activator}}. <code>!activator</code> is probably the easiest to reach through a [[trigger]] entity. If not checked, the fade will apply to all players.}}
:Use attenuation blending, see [[#Entity Description|Entity Description]].
{{fl|8|Stay Out|Fade remains indefinitely until another fade deactivates it.{{Bug|tested={{tf2}}|Fades applied to {{ent|!activator}} only that are also set to <Code>Stay Out</code> will not be deactivated by a new fade!}}}}
* 4 : Personal
:{{todo|Test in other games, test if the <code>ScreenFade</code> VScript function is also affected}}
:Only affect activator
* 8 : Stay Out
:The fade remains indefinitely until another fade deactivates it.


== Inputs ==
== Inputs ==
* {{i targetname}}
{{I|Fade|Start the screen fade.}}
* {{i renderfields}}
{{I|FadeReverse|Begin doing the reverse of the current fade.|since=P2}}
* '''Fade'''
{{I|Alpha|nofgd=1|Changes '''Fade Alpha'''.}}
: Start the screen fade.
{{I|Color|nofgd=1|Changes '''Fade Color'''.}}


== Outputs ==
== Outputs ==
* {{o targetname}}
{{O|OnBeginFade|Fired when the fade has begun.}}
* '''OnBeginFade'''
 
: Fired when the fade has begun. {{activator|activator}}
== ConCommands ==
{{varcom|start}}
{{varcom|fadein|float int int int int|Time (seconds), Red, Green, Blue, Alpha|Makes the screen black (or the specified color), then fades to the normal view.}}
{{varcom|fadeout|float int int int int|Time (seconds), Red, Green, Blue, Alpha|Fades the screen to black (or the specified color).}}
{{varcom|end}}
{{bug|hidetested=1|Due to a mistake in the code, the alpha value isn't read properly from these commands; if you specify rgb it also has to be specified for the fade to work.}}


[[Category:Entities]]
[[Category:GUI Entities]]

Latest revision as of 05:47, 4 July 2025

English (en)Русский (ru)中文 (zh)Translate (Translate)
Env fade.png
C++ Class hierarchy
CEnvFade
CLogicalEntity
CServerOnlyEntity
CBaseEntity
C++ EnvFade.cpp

env_fade is a logical 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.

Icon-Bug.pngBug:Doesn't work in Portal Portal if player's health is below 100 due to the red screen.
Confirm:Is it in Portal 2 Portal 2 as well ?




Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

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

Fade From : [1]
Screen fades from the specified color instead of to it.
Modulate : [2]
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.
Triggering player only : [4] !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.
Stay Out : [8]
Fade remains indefinitely until another fade deactivates it.
Icon-Bug.pngBug:Fades applied to !activator only that are also set to Stay Out will not be deactivated by a new fade!  (tested in: Team Fortress 2)
Todo: 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/Command Parameters or default value Descriptor Effect
fadein float int int int int Time (seconds), Red, Green, Blue, Alpha Makes the screen black (or the specified color), then fades to the normal view.
fadeout float int int int int Time (seconds), Red, Green, Blue, Alpha Fades the screen to black (or the specified color).
Icon-Bug.pngBug:Due to a mistake in the code, the alpha value isn't read properly from these commands; if you specify rgb it also has to be specified for the fade to work.