Env cascade light: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Pinsplash moved page Env cascade lighting to Env cascade light: moving this page to the CORRECT NAME. AAAAAAAA.)
(updates. found a new input but i couldn't get it to work with ent_fire. maybe someone else knows,)
Line 1: Line 1:
{{lang|Env cascade light}}
[[File:CSM Example.jpg|thumb|CSM in Counter-Strike: Global Offensive]]
{{base point multi|env_cascade_light|game1=Insurgency|game2=Black Mesa: Source|game3=Counter-Strike: Global Offensive}}
{{base point multi|env_cascade_light|game1=Insurgency|game2=Black Mesa: Source|game3=Counter-Strike: Global Offensive}}


==Entity description==
It casts an extremely accurate shadow map via the <code>tools/[[skybox]]</code> texture, acting as a real-time variation of {{ent|light_environment}}. This form of lighting is known as [http://msdn.microsoft.com/en-us/library/windows/desktop/ee416307(v=vs.85).aspx cascade shadow maps], 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.
It casts an extremely accurate shadow map via the "tools/skybox" texture, acting as a real-time variation of [[light_environment]]. This form of lighting is known as [http://msdn.microsoft.com/en-us/library/windows/desktop/ee416307(v=vs.85).aspx cascade shadow maps] which works by rendering shadow maps at scaling resolutions based on the players initial camera vector from the center of a spatial grid. These shadow maps are then stitched together, with the the accuracy and quality of the shadow maps scaling lower the further they are away from the player, thus trading accuracy for performance. Some games automatically add this entity to the map. But it can be placed manually to allow for it to be manipulated or killed to allow such things as dynamic lighting.


{{bug|In {{insurgency}}, you must compile your map with HDR in order to see the shadows from this entity, they'll be very faint otherwise!}}
{{bug|In {{insurgency}}, you must compile your map with [[HDR]], otherwise shadows will be very faint.}}
{{bug|In {{insurgency}}, [[Naming_Lights|Lightstyles]] will break when this entity exists.}}
 
{{note|It is recommended to have a [[light_environment]] in your map to create radiosity based lighting, as this entity does not bake radiosity and only creates a real-time shadow map.}}
{{bug|In {{insurgency}}, [[Naming Lights|Lightstyles]] will break when this entity exists.}}
{{note|[[Black_Mesa:_Source|Black Mesa: Source]] has their own implementation of this entity which has keyvalues that have yet to have been documented here.}}
 
{{note|It is recommended to have a <code>light_environment</code> in your map as well to create [[lightmap]] based lighting, which is not done by this entity.}}
 
{{todo|Update for Black Mesa: Source. Keyvalues etc may be missing.}}
 
{{csgo}} Represented by class <code>CCascadeLight</code>.


==Keyvalues==
==Keyvalues==
{{KV|Light Color|color255|This is the color of the sunlight.}}
{{KV|Light Color (color)|color255|This is the color of the sunlight.}}
{{KV|Max shadow distance|bool|Maximum dynamic shadow distance. Higher values are slower, default on PC is 400 units.}}
{{KV|Max shadow distance (maxshadowdistance)|bool|Maximum dynamic shadow distance. Higher values are slower, default on PC is 400 units.}}
{{KV|Use light_environment's angles|float|If true, the CSM shadow angles are automatically harvested from the light_environment's angles. If false, this entity's angles are used.}}
{{KV|Use light_environment's angles (uselightenvangles)|float|If true, the CSM shadow angles are automatically taken from a {{ent|light_environment}}'s angles. If false, this entity's '''Pitch Yaw Roll''' is used.}}
{{KV Targetname}}
{{KV EnableDisable}}
{{KV EnableDisable}}
{{KV Angles}}
{{KV BaseEntity}}


==Inputs==
==Inputs==
{{I Targetname}}
{{IO|SetAngles|Sets the direction shadows cast in.|param=string}}
{{IO|LightColor|Changes color of the sunlight.|param=color255}}
{{IO|LightColorScale|nofgd=1|{{todo|Unknown.}}}}
{{I EnableDisable}}
{{I EnableDisable}}
{{IO|SetAngles|Set the shadow direction.|param=string}}
{{I BaseEntity}}
{{IO|LightColor|This is the color of the sunlight.|param=color255}}
 
==Outputs==
{{O BaseEntity}}


== Outputs ==
[[Category:Lighting]]
{{O Targetname}}

Revision as of 08:59, 23 September 2018

English (en)Translate (Translate)
CSM in Counter-Strike: Global Offensive

Template:Base point multi

It casts an extremely accurate shadow map via the tools/skybox texture, acting as a real-time variation of light_environment. This form of lighting is known as cascade shadow maps, 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-Bug.pngBug:In Insurgency, you must compile your map with HDR, otherwise shadows will be very faint.  [todo tested in ?]
Icon-Bug.pngBug:In Insurgency, Lightstyles will break when this entity exists.  [todo tested in ?]
Note.pngNote:It is recommended to have a light_environment in your map as well to create lightmap based lighting, which is not done by this entity.
Todo: Update for Black Mesa: Source. Keyvalues etc may be missing.

Counter-Strike: Global Offensive Represented by class CCascadeLight.

Keyvalues

Light Color (color) ([todo internal name (i)]) <color255>
This is the color of the sunlight.
Max shadow distance (maxshadowdistance) ([todo internal name (i)]) <boolean>
Maximum dynamic shadow distance. Higher values are slower, default on PC is 400 units.
Use light_environment's angles (uselightenvangles) ([todo internal name (i)]) <float>
If true, the CSM shadow angles are automatically taken from a light_environment's angles. If false, this entity's Pitch Yaw Roll is used.
Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).


Inputs

SetAngles <stringRedirectInput/string>
Sets the direction shadows cast in.
LightColor <color255RedirectInput/color32>
Changes color of the sunlight.
LightColorScale  !FGD
Todo: Unknown.

EnableDisable:

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


Outputs