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

env_cascade_light

From Valve Developer Community
(Redirected from CSM)
Jump to navigation Jump to search
English (en)Translate (Translate)
Edit Tabs

env_cascade_light is a logical entity available in all Source Source games since Counter-Strike: Global Offensive Counter-Strike: Global Offensive.

C++ Class hierarchy
CCascadeLight
CBaseEntity

It casts an extremely accurate shadow map via the tools/toolsskybox texture, augmenting the lighting cast by light_environment with real-time shadows. This form of shadow mapping is known as Cascaded Shadow Maps, or CSM for short, which works by rendering very detailed shadow maps which becomes a lower and lower resolution depending on the distance the viewer is from the surface, similar to mipmaps. Some games automatically add this entity to the map, but it can be placed manually as well.

Icon-Important.pngImportant:
  • You still need to have a light_environment in your map as well to create lightmap based lighting, which is not done by this entity. CSM relies upon a fifth channel in the lightmap to mask dark and light areas.
  • If this entity is missing from your map, the CSM will still be created automatically!
Note.pngNote:In Jabroni Brawl: Episode 3, this will only occur if both env_cascade_light and shadow_control are missing, and the BSP contains lightmap alpha.
Confirm:Strata Source probably works similarly.
Note.pngNote:Although you can toggle this entity, you can have only one env_cascade_light present in your level. Any others will not work.
Cpp.pngCode:
Icon-Bug.pngBug:
  • In Insurgency, shadows will be very faint if the map hasn't been compiled with HDR.
  • In Insurgency, lightstyles will break when this entity exists.

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>
This is the color of the sunlight. For Counter-Strike: Global Offensive Counter-Strike: Global Offensive, the color is automatically copied from the light_environment.
Max shadow distance (maxshadowdistance) <float>
Maximum dynamic shadow distance. Higher values are slower, default on PC is 400 units.
Use light_environment's angles (uselightenvangles) <boolean>
If true, the CSM shadow angles are automatically taken from a light_environment's angles. If false, this entity's angles is used.
Pitch Yaw Roll (Y Z X) (angles) <QAngle>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).
Icon-Bug.pngBug:Non-functional in Counter-Strike: Global Offensive. Fixed in Jabroni Brawl: Episode 3.

Inputs

SetAngles <stringRedirectInput/string>
Sets the direction shadows cast in.
Icon-Bug.pngBug:Affects nothing.  [todo tested in ?]
LightColor <color255RedirectInput/color32>
Changes color of the sunlight.
Icon-Bug.pngBug:Doesn't work as expected. The color only changes on static props, not on world geometry or dynamic objects. It only changes the shadow color (only in world geometry, not in models), with no change upon reloading the game.
Examples
Portal 2: Community Edition Portal 2: Community Edition uses Counter-Strike: Global Offensive Counter-Strike: Global Offensive's implementation of CSM


  (tested in: Portal 2: Community Edition)
LightColorScale  !FGD Obsolete
Deprecated.
Boosts the color of the sunlight. Non-functional, only resets the Light Color.
Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).
Icon-Bug.pngBug:Doesnt work correctly in Counter-Strike: Global Offensive; cascade light must be killed instead. Fixed in Jabroni Brawl: Episode 3.  [todo tested in ?]

See also