Env global light: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
m (Updated old entity format to {{this is a}}. This action was perfomed by a bot.)
Line 1: Line 1:
{{lang|Env global light}}
<!-- 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 global light}}[[File:Env_global_light_stockasw.jpg|thumb|350px]]
[[File:Env_global_light_stockasw.jpg|thumb|350px]]
{{this is a|e0|game=Alien Swarm|gameMapbase|name=env_global_light}} It casts a [[Wikipedia:Shadow mapping|shadow map]] that follows the player. Nearly identical to {{ent|sunlight_shadow_control}}.
{{Entity|env_global_light|game=Alien Swarm|game1 = Mapbase|type=e0}} It casts a [[Wikipedia:Shadow mapping|shadow map]] that follows the player. Nearly identical to {{ent|sunlight_shadow_control}}.


The main difference from an {{ent|env_projectedtexture}} is that this projects [[Wikipedia:Orthographic_projection|orthographically]] (like sunlight) instead of in a radial fashion (like a lightbulb).
The main difference from an {{ent|env_projectedtexture}} is that this projects [[Wikipedia:Orthographic_projection|orthographically]] (like sunlight) instead of in a radial fashion (like a lightbulb).
Line 9: Line 8:
==Dedicated Console Variables==
==Dedicated Console Variables==
{{varcom|start}}
{{varcom|start}}
{{varcom|cl_globallight_freeze|0|01|Freezes the <code>env_global_light</code> in place so that it won't follow the player.{{confirm}}}}
{{varcom|cl_globallight_freeze|0|01|Freezes the <code>env_global_light</code> in place so that it won't follow the player.{{confirm}}
{{varcom|cl_globallight_xoffset|-800|dist|Offset from the player that the light originates from, along the X axis.}}
{{varcom|cl_globallight_xoffset|-800|dist|Offset from the player that the light originates from, along the X axis.}}
{{varcom|cl_globallight_yoffset|1600|dist|Offset from the player that the light originates from, along the Y axis.}}
{{varcom|cl_globallight_yoffset|1600|dist|Offset from the player that the light originates from, along the Y axis.}}
Line 16: Line 15:
==Keyvalues==
==Keyvalues==
{{KV|Light Color (color)|color255|RGBA color of the sunlight.}}
{{KV|Light Color (color)|color255|RGBA color of the sunlight.}}
{{KV|Color Transition Time (colortransitiontime)|float|This is the number of seconds it takes to get from 0 to 255.{{clarify}}}}
{{KV|Color Transition Time (colortransitiontime)|float|This is the number of seconds it takes to get from 0 to 255.{{clarify}}
{{KV|Distance (distance)|float|Height above the player where the projection originates from.}}
{{KV|Distance (distance)|float|Height above the player where the projection originates from.}}
{{KV|FOV (fov)|float|This is the field of view that the sunlight casts in. Use lower values to simulate a more distant sun and sharper shadows.}}
{{KV|FOV (fov)|float|This is the field of view that the sunlight casts in. Use lower values to simulate a more distant sun and sharper shadows.}}
{{KV|NearZ Distance (nearz)|float|Distance from the player where the near Z plane is. Anything closer to the projection origin}}
{{KV|NearZ Distance (nearz)|float|Distance from the player where the near Z plane is. Anything closer to the projection origin}}
{{KV|North Offset (northoffset)|float|"This offsets the from the player position where the sun is attached."{{clarify}}}}
{{KV|North Offset (northoffset)|float|"This offsets the from the player position where the sun is attached."{{clarify}}
{{KV|Texture Name (texturename)|material|The light texture which this entity projects.}}
{{KV|Texture Name (texturename)|material|The light texture which this entity projects.}}
{{KV|Enable Shadows (enableshadows)|boolean|Enables shadows. If shadows are disabled, light may appear to go through objects. Disabling shadows may be ideal for lower-detail environments due to being less [[expensive]].}}
{{KV|Enable Shadows (enableshadows)|boolean|Enables shadows. If shadows are disabled, light may appear to go through objects. Disabling shadows may be ideal for lower-detail environments due to being less [[expensive]].}}

Revision as of 10:13, 4 January 2024

English (en)Translate (Translate)
Env global light stockasw.jpg

env_global_light is an e0 available in Alien Swarm Alien Swarm. It casts a shadow map that follows the player. Nearly identical to sunlight_shadow_control.

The main difference from an env_projectedtexture is that this projects orthographically (like sunlight) instead of in a radial fashion (like a lightbulb).

C++ In code, it is represented by theCGlobalLightclass, defined in theenv_global_light.cppfile.

Dedicated Console Variables

{{varcom|cl_globallight_freeze|0|01|Freezes the env_global_light in place so that it won't follow the player.[confirm]
Cvar/Command Parameters or default value Descriptor Effect
cl_globallight_xoffset -800 Hammer units Offset from the player that the light originates from, along the X axis.
cl_globallight_yoffset 1600 Hammer units Offset from the player that the light originates from, along the Y axis.

Keyvalues

Light Color (color) ([todo internal name (i)]) <color255>
RGBA color of the sunlight.

{{KV|Color Transition Time (colortransitiontime)|float|This is the number of seconds it takes to get from 0 to 255.[Clarify]

Distance (distance) ([todo internal name (i)]) <float>
Height above the player where the projection originates from.
FOV (fov) ([todo internal name (i)]) <float>
This is the field of view that the sunlight casts in. Use lower values to simulate a more distant sun and sharper shadows.
NearZ Distance (nearz) ([todo internal name (i)]) <float>
Distance from the player where the near Z plane is. Anything closer to the projection origin

{{KV|North Offset (northoffset)|float|"This offsets the from the player position where the sun is attached."[Clarify]

Texture Name (texturename) ([todo internal name (i)]) <material>
The light texture which this entity projects.
Enable Shadows (enableshadows) ([todo internal name (i)]) <boolean>
Enables shadows. If shadows are disabled, light may appear to go through objects. Disabling shadows may be ideal for lower-detail environments due to being less expensive.
Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).


Inputs

LightColor <color255RedirectInput/color32>
Set the light color.
SetAngles <stringRedirectInput/string>
Set the sun direction.
SetDistance <floatRedirectInput/float>
Set the distance of the sun.
SetFOV <floatRedirectInput/float>
Set the field of view the sun casts.
SetNearZDistance <floatRedirectInput/float>
Set the near z distance.
SetNorthOffset <floatRedirectInput/float>
Sets the north offset.
SetTexture <stringRedirectInput/string>
Set the texture cookie of the sunlight.
EnableShadows <booleanRedirectInput/boolean>
Set whether shadow maps are enabled

EnableDisable:

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


Outputs