env_global_light

From Valve Developer Community
Jump to: navigation, search
English (en)Translate (Translate)
Env global light stockasw.jpg
Class hierarchy
CGlobalLight
CBaseEntity
env_global_light.cpp

env_global_light is a point entity available in Alien Swarm Alien Swarm and Mapbase Mapbase. 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).

Keyvalues

Name (targetname) <string>
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

Light Color (color) <color255>
RGBA color of the sunlight.
Color Transition Time (colortransitiontime) <float>
This is the number of seconds it takes to get from 0 to 255.[Clarify]
Distance (distance) <float>
Height above the player where the projection originates from.
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.
NearZ Distance (nearz) <float>
Distance from the player where the near Z plane is. Anything closer to the projection origin
North Offset (northoffset) <float>
"This offsets the from the player position where the sun is attached."[Clarify]
Texture Name (texturename) <material>
The light texture which this entity projects.
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.
Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).

Inputs

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

EnableDisable:

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

Dedicated Console Variables

Cvar/CommandParameters or default valueDescriptorEffect
cl_globallight_freeze00 disables, 1 enablesFreezes the env_global_light in place so that it won't follow the player.[confirm]
cl_globallight_xoffset-800Hammer unitsOffset from the player that the light originates from, along the X axis.
cl_globallight_yoffset1600Hammer unitsOffset from the player that the light originates from, along the Y axis.