Env cascade light

It casts an extremely accurate shadow map via the tools/toolsskybox texture, acting as a real-time variation of . This form of lighting 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.
==Keyvalues==
:*0: Auto: Static cache will update once every 10 frames (approx) covering max shadow distance or whole map around player.
:*1: Manual : Static cache area coverage and updates are managed via CSM Volumes' I/O.
==Inputs==
:
:
:
:
==Cascade Shadow Mapping Volumes==
 provides very powerful optimization feature, called Cascade Shadow Mapping Volumes (CSM volumes for short). Initially, there were 2 different modes for rendering shadow maps for static cascade, which type to use - determines the value from the property, the property is . CSM volumes allow you to automatically limit rendering of cascade shadows, swap areas there you want to have static cascade shadows (this is cascade shadows from static props with world geometry (brush entities as well) and also change value for
 property.
 property can have 2 different values:
*Auto - you will not be able to swap areas there you want to have static cascade shadows, value from property never changes, static cascade shadows will also disappear with dynamic cascade shadows. Good enough if map isn't very open space or if it's not too big.
*Manual - static cascade shadows rendering areas depends on values from the inputs, value from property also depends on values from the inputs. This allows you to save many FPS for maps with big open space areas (especially for Xen levels).
There are 3 different inputs for this feature, which create 3 different ways to use CSM volumes.
The first input is . This input changes CSM volume and sets min and max bounds via entity. The size of entity decides the size of the world or level to be rendered into CSM shadow maps. To use it, specify the area in which you want to set CSM volume via entity (also works with and other triggers for some reason). In make the following output:
File:csmvol1.jpg|An example (instead of cascade there should be your name).
In this way, static cascade shadows will not appear outside of min and max bounds.
File:csmvolg1.jpg|Example with console message about min and max bounds (this appear when you touch such CSM volume). Note that we have static cascade shadows in this area. 
File:csmvolg2.jpg|Example in room that is outside of the bounds. Note that we don't have have static cascade shadows in this area. 
The second input is . It resets CSM volume to scene bounds. To use it, use the steps from the previous way, but replace input with input.
In this way, static cascade shadows never disappear, but dynamic still disappear.
File:csmvolgScene.jpg|Example with console message about CSM volume reset (this appear when you touch such CSM volume). Note that we have static cascade shadows (from the tree and world geometry in this case), but we don't have dynamic cascade shadows (from the crate and the ropes in this case).
The third input and the last way is . It does the same thing that does , but instead of you are using entity. This way is deprecated, but still can be used in some very rare cases. is disabled in original FGD, you need to open base.cfg, find line 3169 and uncomment the code (or just use Enhanced Black Mesa FGD). The next step is to place the entity, give a name and set values for , and properties. What values to set to have required results ? Image that the entity position is brush center, and the values for the properties is the values what you see in 2D window while some brush entity is selected. The last step is to add output for entity that will set CSM volume in this way, this can be trigger or any other entity. requires parameter to work, the parameter is the name of which we set up early.
File:csmvolent.jpg|An example.
In this way, we get results that are identical to the result from input.
== See also ==
* - cascade volume brush entity
* - cascade volume point entity
* - baked static sunlight
* - dynamic shadows
* - glowing sun effect
* Skybox Basics
* Skybox lighting
* Advanced Lighting
* Effect flags (dynamic light effects)
* - directional sun light with godrays only 
* - point deferred light entity
* - spot deferred light entity
* - entity that changes deferred light settings
* New Specular - specular shader for new lights
* - deferred light 
* - deferred global light
== External links ==
* Example of CSM volumes (all 3 ways) in test map 
* BlackMesa XenEngine: Part3 – CSM 2.0 (page from Black Mesa developer about their own CSM implementation)
* BlackMesa XenEngine: Part2 – How a Frame is Rendered (page from Black Mesa developer about new graphics features)
* BlackMesa XenEngine: Part1 – Heavily Modified Source Engine (page from Black Mesa developer about Black Mesa engine, better known as Xengine)
Category:Lighting