Env global light: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(Added some info, replaced picture.)
Line 1: Line 1:
[[File:Env global light highres fps hl2content.jpg|thumb|250px|Use in an FPS mod for [[Alien Swarm]]. Note the fading of objects in the distance, this is why it should be restricted to small areas (in FPS) or to games with top-down cameras!]]
{{base point|env_global_light|since=Alien Swarm}}


{{base point|env_global_light|since=Alien Swarm}}
[[File:Env_global_light_stockasw.jpg|thumb|350px|Use in stock(unmodded) [[Alien Swarm]]. Note the fading toward the edges, this is due to the small projection coverage. It's basically a giant [[env_projectedtexture]] bound to the player, but with orthographic projection.]]


== Entity description ==
== Entity description ==
Line 19: Line 19:
;cl_globallight_yoffset  
;cl_globallight_yoffset  
: Default: 1600
: Default: 1600
{{Warning | The default Y and X offset are no where near the player in most cases. But depending on the light angles, the offsets also need changed! }}


== Keyvalues ==
== Keyvalues ==

Revision as of 20:58, 1 December 2012

Template:Base point

Use in stock(unmodded) Alien Swarm. Note the fading toward the edges, this is due to the small projection coverage. It's basically a giant env_projectedtexture bound to the player, but with orthographic projection.

Entity description

It casts an orthographic shadow map onto the world, centred on the camera. It is only designed to work from top-down cameras. Nearly identical to sunlight_shadow_control in both function and appearance

Dota 2 Dota 2 will be the first Valve game to use this entity.

Dedicated Console Variables

cl_sunlight_ortho_size
Default: 0
cl_sunlight_depthbias
Default: 0.02
cl_globallight_freeze
Default: 0
cl_globallight_xoffset
Default: -800
cl_globallight_yoffset
Default: 1600
Warning.pngWarning: The default Y and X offset are no where near the player in most cases. But depending on the light angles, the offsets also need changed!

Keyvalues

Pitch Yaw Roll (Y Z X) ([todo internal name (i)]) <string>
This is the light cast direction. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, and roll is the rotation around the X axis.
Light Color ([todo internal name (i)]) <color255>
This is the color of the sunlight.
Color Transition Time ([todo internal name (i)]) <float>
This is the number of seconds it takes to get from 0 to 255.
Distance ([todo internal name (i)]) <float>
This is the distance of the sun, greater distances produce more orthogonal shadows.
FOV ([todo internal name (i)]) <float>
This is the field of view that the sunlight casts in. Use lower values for more distant sun and sharper shadows.
NearZ Distance ([todo internal name (i)]) <float>
This controls the near clipping plane's distance from the player.
North Offset ([todo internal name (i)]) <float>
This offsets the from the player position where the sun is attached.
Texture Name ([todo internal name (i)]) <material>
Enable Shadows ([todo internal name (i)]) <boolean>
Enables/disables shadow maps.
Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).
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

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