Env cascade light: Difference between revisions
Jump to navigation
Jump to search

Important:
Note:Although you can toggle this entity, you can have only one env_cascade_light present in your level. Any others will not work.
Code:
Bug:
Bug: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.
(tested in:
)
SirYodaJedi (talk | contribs) (Move BMS bloat to a separate page) |
SirYodaJedi (talk | contribs) No edit summary |
||
| (6 intermediate revisions by the same user not shown) | |||
| Line 6: | Line 6: | ||
It casts an extremely accurate shadow map via the <code>tools/tools[[skybox]]</code> texture, augmenting the lighting cast by {{ent|light_environment}} with real-time shadows. This form of shadow mapping is known as '''[https://learn.microsoft.com/en-us/windows/win32/dxtecharts/cascaded-shadow-maps 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. | It casts an extremely accurate shadow map via the <code>tools/tools[[skybox]]</code> texture, augmenting the lighting cast by {{ent|light_environment}} with real-time shadows. This form of shadow mapping is known as '''[https://learn.microsoft.com/en-us/windows/win32/dxtecharts/cascaded-shadow-maps 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. | ||
{{ | {{important| | ||
{{ | * You still need to have a {{ent|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 <!--first 4 channels are RGB and exponent, even in non-HDR mode--> 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|In {{jb3}}, this will only occur if both {{ent|env_cascade_light}} and {{ent|shadow_control}} are missing, and the BSP contains lightmap alpha. {{confirm|{{strata}} probably works similarly.}} }} | |||
}} | |||
{{note| | {{note|Although you can toggle this entity, you can have only one {{ent|env_cascade_light}} present in your level. Any others will not work.}} | ||
{{codenote| | |||
* {{src13|4}} doesn't have this entity, but there is an [https://github.com/celisej567/Fake-CSM-Mapbase attempt] of | * {{src13|4}} doesn't have this entity, but there is an [https://github.com/celisej567/Fake-CSM-Mapbase attempt] of simulating it. | ||
* {{asd|4}}'s counterpart to this entity is {{ent|Light_deferred_global}}{{also|{{lw}}}} | * {{asd|4}}'s counterpart to this entity is {{ent|Light_deferred_global}}{{also|{{lw}}}} | ||
* You alternatively can [[Implementing_Deferred_lighting_into_Source_2013|implement]] {{lw|4}}'s Deferred lighting as it is the most robust implementation currently being available to the public. | * You alternatively can [[Implementing_Deferred_lighting_into_Source_2013|implement]] {{lw|4}}'s Deferred lighting as it is the most robust implementation currently being available to the public. | ||
}} | }} | ||
{{bug| | |||
* In {{insurgency}}, shadows will be very faint if the map hasn't been compiled with [[HDR]]. | |||
* In {{insurgency}}, [[lightstyle]]s will break when this entity exists.|hidetested=1}} | |||
==Keyvalues== | ==Keyvalues== | ||
| Line 25: | Line 28: | ||
{{KV Angles}} | {{KV Angles}} | ||
{{KV EnableDisable}} | {{KV EnableDisable}} | ||
:{{bug|hidetested=1|Non-functional in {{csgo}}. Fixed in {{jb3}}.}} | |||
==Inputs== | ==Inputs== | ||
| Line 41: | Line 45: | ||
{{I|LightColorScale|Boosts the color of the sunlight. Non-functional, only resets the Light Color.|nofgd=1|deprecated=1}} | {{I|LightColorScale|Boosts the color of the sunlight. Non-functional, only resets the Light Color.|nofgd=1|deprecated=1}} | ||
{{KV EnableDisable}} | {{KV EnableDisable}} | ||
:{{bug|Doesnt work correctly in {{CSGO}}. Fixed in {{jb3}}.}} | :{{bug|Doesnt work correctly in {{CSGO}}; cascade light must be [[kill]]ed instead. Fixed in {{jb3}}.}} | ||
== See also == | == See also == | ||
Latest revision as of 16:31, 2 December 2025
env_cascade_light is a logical entity available in all
Source games since
Counter-Strike: Global Offensive.
| CCascadeLight |
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.
- 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:In
, this will only occur if both env_cascade_light and shadow_control are missing, and the BSP contains lightmap alpha.
Source 2013 doesn't have this entity, but there is an attempt of simulating it.
Alien Swarm Deferred's counterpart to this entity is Light_deferred_global(also in
)- You alternatively can implement
Lambda Wars's Deferred lighting as it is the most robust implementation currently being available to the public.
- In
, shadows will be very faint if the map hasn't been compiled with HDR. - In
, 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.
parentnameortarget).
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, 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 the
Enableinput).
Inputs
- LightColor <color255>
- Changes color of the sunlight.
|
LightColorScale!FGD
- Deprecated.
Boosts the color of the sunlight. Non-functional, only resets the Light Color.
- Start Disabled (StartDisabled) <boolean>
- Stay dormant until activated (with the
Enableinput).
See also
- light_environment - baked static sunlight
- Shadow_control - dynamic shadows
- env_sun - glowing sun effect
- Skybox Basics
- Skybox lighting
- Advanced Lighting
- Effect flags (dynamic light effects)