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

Env ambient light: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Updated old entity format to {{this is a}}. This action was perfomed by a bot.)
m (→‎top: Unicodifying, replaced: {{language subpage → {{langsp)
Line 1: Line 1:
<!-- When this page is updated to {{langsp}} or {{language subpage}} instead of {{lang}}, please move {{this is a}} to the base page, as it is automatically translated. -->{{lang|Env ambient light}}{{this is a|e0|name=env_ambient_light|since=Alien Swarm}} This entity adds a constant color value to dark areas of the world without affecting brighter areas. It can be faded in and/or take effect only within a certain radius (meaning brightness will increase as the viewer draws closer to the entity, not that there will be a spatial effect).
<!-- When this page is updated to {{langsp}} or {{langsp}} instead of {{lang}}, please move {{this is a}} to the base page, as it is automatically translated. -->{{lang|Env ambient light}}{{this is a|e0|name=env_ambient_light|since=Alien Swarm}} This entity adds a constant color value to dark areas of the world without affecting brighter areas. It can be faded in and/or take effect only within a certain radius (meaning brightness will increase as the viewer draws closer to the entity, not that there will be a spatial effect).


{{note|The ambient term is completely flat, making this entity a poor replacement for [[static light]].}}
{{note|The ambient term is completely flat, making this entity a poor replacement for [[static light]].}}

Revision as of 09:20, 8 January 2024

English (en)Translate (Translate)

env_ambient_light is an e0 available in all Source Source games since Alien Swarm Alien Swarm. This entity adds a constant color value to dark areas of the world without affecting brighter areas. It can be faded in and/or take effect only within a certain radius (meaning brightness will increase as the viewer draws closer to the entity, not that there will be a spatial effect).

Note.pngNote:The ambient term is completely flat, making this entity a poor replacement for static light.
Icon-Bug.pngBug:This entity works by setting the mat_ambient_light_ cvars to the values specified in the entity. This doesn't cause any problems in Alien Swarm, but in Portal 2 Portal 2 and later, the cvars will not be reset when changing maps! This makes the entity only suitable for standalone mods, as using it in a singular map will cause the effects to carry over into every following map that the user plays until another map turns it back off or the game is restarted.  [todo tested in ?]
PlacementTip.pngWorkaround:To prevent your map from being affected by ambient light from a previous map, you can place a env_ambient_light entity in your map set to 0 0 0 to clear any previous ambient light values.
C++ In code, it is represented by theCEnvAmbientLightclass, defined in theenv_ambient_light.cppfile.

Keyvalues

Color (R G B) (Color) ([todo internal name (i)]) <color255>
Ambient light color.

SpatialEntity:

Lookup Falloff Start Distance (minfalloff) <float>
Within this range to the entity, the effect will be at full strength. If this is larger than the End Distance, the effect will apply to the entire map.
Lookup Falloff End Distance (maxfalloff) <float>
Maximum distance from the entity that the effect is applied. At this distance, the effect is barely apparent but will strengthen as the viewer approaches the Start Distance.
Maximum Weight (maxweight) <float>
This is the maximum weight for this lookup.[Clarify]
Lookup Fade In Duration (fadeInDuration) <float>
When the entity becomes Enabled, how long the effect takes to fade in.
Lookup Fade out Duration (fadeOutDuration) <float>
When the entity becomes Disabled, how long the effect takes to fade out.
Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).


Inputs

SetColor <color255RedirectInput/color32>
Sets the color.

SpatialEntity:

SetFadeInDuration <floatRedirectInput/float>
Sets the Lookup Fade In Duration.
SetFadeOutDuration <floatRedirectInput/float>
Sets the Lookup Fade out Duration.

EnableDisable:

Enable / Disable
Enable/disable this entity from performing its task. It might also disappear from view.


Outputs