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
mNo edit summary
(Nothing to add I think.)
 
(59 intermediate revisions by 27 users not shown)
Line 1: Line 1:
[http://troniny.ovh.org/gallery/layout/ehiabs.html 4 blonde going non whats] [http://2001.c3.hu/mas/isncdc.html international childbirth education] [http://troniny.ovh.org/gallery/layout/pffocr.html pottery studio tennessee] [http://informer.siam.edu/themes/hm/tamsng.html buy pharmacy online] [http://aura.c3.hu/thumb/akxxka.html wyeth canada inc] [http://www.salona-yachts.eu/misc/roxhre.html engine ma marketing search] [http://www.plurpage.com/classifieds/cache/eqdctj.html show must go on queen] [http://activeimage.c3.hu/css/qowgjh.html 40s clothing] [http://ndr.hu/rhodes/ntglhb.html oil portrait professional] [http://kristinlyseggen.com/gallery/1documentaries/7travel/glmdrr.html the way up] [http://www.housing.und.edu/reshalls/blog/wp-content/uploads/2007/04/img/gaelgl.html buy paxil] [http://www.plurpage.com/classifieds/cache/maihoo.html engineering methodology] [http://kom-pas.de/3xcms/config/hkatuploads/images/srnwjf.html recycled glass bottle] [http://aura.c3.hu/thumb/jmnupt.html magic 3d coloring book] [http://maps.my2gig.com/cache/bqlswx.html net design thailand] [http://kristinlyseggen.com/gallery/1documentaries/7travel/tfgkko.html presidents fitness challenge] [http://activeimage.c3.hu/css/tvpdnk.html marty bell art] [http://www.plurpage.com/classifieds/cache/raxpdi.html meaning of amrican indian names] [http://mkatzenbach.de/Website_MK_alt/content/cache/dir/end001/chrwwu.html salt lake city telephone] [http://www.stillwaterhomes.com/listings/images/pic/qbssnh.html sql server 2000 eval] [http://www.plurpage.com/classifieds/cache/rljora.html reason war of 1812] [http://troniny.ovh.org/gallery/layout/dconfs.html alice bruce cooper group michael] [http://www.lowell.edu/styles/old_style/css/dflsij.html post impressionists art] [http://troniny.ovh.org/gallery/layout/hvmeje.html a team leader] [http://www.easypayinfo.com/subscribe/tmp/rfggte.html ordino] [http://ndr.hu/rhodes/kebamx.html print country usa] [http://www.stillwaterhomes.com/listings/images/pic/vrkkds.html the simplest answer] [http://maps.my2gig.com/cache/psjhla.html immigration from france to canada] [http://www.salona-yachts.eu/misc/everlb.html lyrics for just a small town girl] [http://www.stillwaterhomes.com/listings/images/pic/qfoukc.html pro tect security] [http://2001.c3.hu/mas/jbhsnu.html rock gem magazine] [http://activeimage.c3.hu/css/jcqjpk.html orange county court house orlando florida] [http://aura.c3.hu/thumb/bsgwai.html seductive song] [http://www.olemissfans.com/chatpro/image/rgkcmc.html nba live 2006 tournament] [http://maps.my2gig.com/cache/qaqukg.html rekrytering] [http://troniny.ovh.org/gallery/layout/foqcvs.html off switch] [http://kristinlyseggen.com/gallery/1documentaries/7travel/xnbutp.html someone told me lyrics] [http://kristinlyseggen.com/gallery/1documentaries/7travel/uvegcg.html universal import and export] [http://troniny.ovh.org/gallery/layout/trtbce.html ont car rental] [http://maps.my2gig.com/cache/tktxnj.html part time job houston texas] [http://www.plurpage.com/classifieds/cache/vrtxga.html nostra] [http://maps.my2gig.com/cache/nlneso.html sixth grade math] [http://mkatzenbach.de/Website_MK_alt/content/cache/dir/end001/qdhuox.html single spanish women] [http://2001.c3.hu/mas/abmxcw.html serial gamer] [http://www.easypayinfo.com/subscribe/tmp/jeodqm.html marriott hotel in atlantic city] [http://www.easypayinfo.com/subscribe/tmp/ppkfql.html affective needs of students] [http://aura.c3.hu/thumb/sstfit.html www fra com] [http://2001.c3.hu/mas/pktfkb.html international business guidelines] [http://www.salona-yachts.eu/misc/icwtnn.html kinetic assay] [http://maps.my2gig.com/cache/tpctjv.html 2 corel drawing] [http://troniny.ovh.org/gallery/layout/tvlxbl.html logical star topology] [http://aura.c3.hu/thumb/xlfrno.html stopping junk mail] [http://mkatzenbach.de/Website_MK_alt/content/cache/dir/end001/thnjko.html tara smith eagles] [http://aura.c3.hu/thumb/qwfema.html nursing home in washington dc] [http://www.easypayinfo.com/subscribe/tmp/ooxvhf.html i was born with a smile on my face] [http://troniny.ovh.org/gallery/layout/xkmkba.html sex and early pregnancy] [http://www.lowell.edu/styles/old_style/css/krcwiu.html nero burner 7] [http://www.lowell.edu/styles/old_style/css/umkidr.html ambien] [http://www.plurpage.com/classifieds/cache/uojjid.html mendocina county] [http://www.stillwaterhomes.com/listings/images/pic/vkadfn.html slim in six videos] [http://activeimage.c3.hu/css/vjtiqx.html pocket wizard review] [http://troniny.ovh.org/gallery/layout/agwhin.html the pump nyc] [http://kom-pas.de/3xcms/config/hkatuploads/images/nwjhfd.html 10 bill t year] [http://www.systemsupport.und.edu/cache/avatars/emo/boloep.html order ativan] [http://aura.c3.hu/thumb/dfdvnq.html ignore signals] [http://www.stillwaterhomes.com/listings/images/pic/rghpeu.html abbeys] [http://www.stillwaterhomes.com/listings/images/pic/ehendc.html six security services] [http://www.easypayinfo.com/subscribe/tmp/xipfrv.html energy policy act of 2003] [http://www.plurpage.com/classifieds/cache/cxfend.html youngs rv north carolina] [http://2001.c3.hu/mas/eabqva.html sweet dream are made of this lyrics] [http://www.stillwaterhomes.com/listings/images/pic/ljslph.html window treatment baltimore] [http://2001.c3.hu/mas/ebbqha.html lingerie women pictures] [http://www.housing.und.edu/reshalls/blog/wp-content/uploads/2007/04/img/bocrdw.html buy tramadol] [http://maps.my2gig.com/cache/olfcwm.html acting jobs for kids] [http://aura.c3.hu/thumb/itpial.html african tribal music history] [http://2001.c3.hu/mas/miafxq.html reference encyclopedias] [http://www.salona-yachts.eu/misc/aldrkh.html air control salary traffic] [http://ndr.hu/rhodes/pxarov.html special advisors] [http://www.plurpage.com/classifieds/cache/ompxtw.html louis and clark time line] [http://troniny.ovh.org/gallery/layout/txkjea.html a shooting star in the sky] [http://kom-pas.de/3xcms/config/hkatuploads/images/iqgxge.html mortgage broker opportunity] [http://www.easypayinfo.com/subscribe/tmp/ljvjun.html nelson bulletin board] [http://troniny.ovh.org/gallery/layout/wjffop.html 1979 ford truck pic] [http://www.stillwaterhomes.com/listings/images/pic/juxiov.html publicservice commission] [http://kom-pas.de/3xcms/config/hkatuploads/images/jwrgro.html kawasaki dvd players] [http://mkatzenbach.de/Website_MK_alt/content/cache/dir/end001/dwnvbn.html she sends] [http://informer.siam.edu/themes/hm/qujoov.html sagem ringtone] [http://www.farmelco.hu/test/css/epdpvx.html logo pen blue ink] [http://www.salona-yachts.eu/misc/giqfxb.html myth warez] [http://www.plurpage.com/classifieds/cache/wfmais.html actin size] [http://www.farmelco.hu/test/css/dvxfft.html accessory boost mobile phone] [http://2001.c3.hu/mas/klgccn.html office onenote key] [http://maps.my2gig.com/cache/mplgod.html agent bryan estate real texas] [http://activeimage.c3.hu/css/fqtomq.html japanese girl blow job] [http://troniny.ovh.org/gallery/layout/clfomr.html 5 hour driving course long island] [http://ndr.hu/rhodes/oevxph.html robert frosts writing style] [http://activeimage.c3.hu/css/fvombm.html plumbing gaskets] [http://troniny.ovh.org/gallery/layout/wxujjd.html velocity training] [http://ndr.hu/rhodes/acaivq.html special poem for my son] [http://www.salona-yachts.eu/misc/mjpdmr.html end of times by dr]
{{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.