Template:KV BmNewLightShadowMain: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page with "{{KV|Light Type|intn=LightType|choices|Type of the light. This affects the behavior of the light source with parent, enable/disable dynamic models in shadowmaps, enable/disable static shadowmaps. *0: Static - used only static shadowmaps, this means that shadows are cast only by static objects (prop_static, geometry, etc). Cannot move with parent. :{{important|Brush entities and bmodels are also included in static shadowmaps and they never update (including...")
 
No edit summary
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<!--Purpose:
We are using this template for one or multiple pages related to Black Mesa new light entities. These templates allows you to use the same text for entities that have many identical properties, without having to make the same changes for several pages separately. This template is also may used in some other templates.-->
{{KV|Light Type|intn=LightType|choices|Type of the light. This affects the behavior of the light source with parent, enable/disable dynamic models in shadowmaps, enable/disable static shadowmaps.
{{KV|Light Type|intn=LightType|choices|Type of the light. This affects the behavior of the light source with parent, enable/disable dynamic models in shadowmaps, enable/disable static shadowmaps.
*0: Static - used only static shadowmaps, this means that shadows are cast only by static objects ([[prop_static]], geometry, etc). Cannot move with parent.
:*0: Static - used only static shadowmaps, this means that shadows are cast only by static objects ([[prop_static]], geometry, etc). Cannot move with parent.
:{{important|Brush entities and [[Bmodel|bmodels]] are also included in static shadowmaps and they never update (including {{ent|func_physbox}}).}}
::{{important|Brush entities and [[Bmodel|bmodels]] are also included in static shadowmaps and they never update (including {{ent|func_physbox}}).}}
:{{note|Static shadowmaps will update after save reload (only once).}}
::{{note|Static shadowmaps will update after save reload (only once).}}
*1: Stationary - the same as Static, but with dynamic shadows for dynamic models.
:*1: Stationary - the same as Static, but with dynamic shadows for dynamic models.
*2: Dynamic - lighting don't use static shadowmaps at all. It uses dynamic shadows for static objects and dynamic models. This type also can move with parent. This type is expensive, usually used for moving lights, but also can be used if you're getting issues due to static shadowmaps.
:*2: Dynamic - lighting don't use static shadowmaps at all. It uses dynamic shadows for static objects and dynamic models. This type also can move with parent. This type is expensive, usually used for moving lights, but also can be used if you're getting issues due to static shadowmaps.
{{expand|margin_left=2em|title=Examples|
:{{expand|title=Examples|
<br>
{{note|Note that shadow from metal box and grate box are flying on first and second pictures, that's because both was placed in air on map spawn. Doesn't happen on third picture, because the light updated shadow for both.}}
<gallery mode=packed heights=420px>
<gallery mode=packed heights=290px>
File:B-1.gif|| thumb | left | 510px | Light Type - Static
File:LightType0.jpg| thumb | left | 510px | Static  
File:B0.gif| thumb | left | 510px | Light Type - Stationary
File:LightType1.jpg| thumb | left | 510px | Stationary  
File:B1.gif| thumb | left | 510px | Light Type - Dynamic
File:LightType2.jpg| thumb | left | 510px | Dynamic  
</gallery>
</gallery>
}}
}}
}}
}}
{{KV|HasShadow|intn=HasShadow|choices|Sets shadows state for the light, enabled or disabled. Remember that default choices is No.
{{KV|HasShadow|intn=HasShadow|choices|Sets shadows state for the light, enabled or disabled. Remember that the default choices is No.
*0: No
:*0: No
*1: Yes}}
:*1: Yes
{{expand|margin_left=2em|title=Examples|
}}
<br>
:{{expand|title=Examples|
<gallery mode=packed heights=290px>
<gallery mode=packed heights=290px>
File:cBM NO.jpg| thumb | left | 510px | Has Shadow - NO
File:HasShadow0.jpg| thumb | left | 510px | Has Shadow - NO
File:cBM YES.jpg| thumb | left | 510px | Has Shadow - YES
File:HasShadow1.jpg| thumb | left | 510px | Has Shadow - YES
</gallery>
</gallery>
}}
}}
{{KV|ShadowMapLOD|intn=ShadowLod|choices|Resolution of shadowmap used by this light. This affects the quality of the shadows.
{{KV|ShadowMapLOD|intn=ShadowLod|choices|Resolution of shadowmap used by this light. This affects the quality of the shadows.
*0: 256
:*0: 256
*1: 512
:*1: 512
*2: 1024
:*2: 1024
{{important|You cannot use any value from here an unlimited number of times. More information [[NewLight_Point#Shadow_map_slots|below]].}}
:{{expand|title=Examples|
 
{{expand|margin_left=2em|title=Examples|
<gallery mode=packed heights=290px>
<gallery mode=packed heights=290px>
File:cLOD256.jpg| thumb | left | 510px | 256
File:ShadowMapLOD256.jpg| thumb | left | 510px | 256
File:cLOD512.jpg| thumb | left | 510px | 512
File:ShadowMapLOD512.jpg| thumb | left | 510px | 512
File:cLOD1024.jpg| thumb | left | 510px | 1024
File:ShadowMapLOD1024.jpg| thumb | left | 510px | 1024
</gallery>
</gallery>
}}
}}
{{todo|Update the images (the screenshots was taken when the game was using old shadow filtering).}}
:{{important|You cannot use any value from here an unlimited number of times. More information [[NewLight_Point#Shadow_map_slots|below]].}}
}}
}}
{{KV|ShadowRadius|intn=ShadowRadius|float|Radius of shadow edges for soft shadows. If its value is negative, code will auto assign a value depending on ShadowLod. These code based values can be adjusted via convars {{command|nr_shadow_rad_High}}, {{command|nr_shadow_rad_Med}} and {{command|nr_shadow_rad_Low}}.
{{KV|ShadowRadius|intn=ShadowRadius|float|Radius of shadow edges for soft shadows. If its value is negative, code will auto assign a value depending on ShadowLod. These code based values can be adjusted via convars {{command|nr_shadow_rad_High}}, {{command|nr_shadow_rad_Med}} and {{command|nr_shadow_rad_Low}}.
{{expand|margin_left=2em|title=Examples|
:{{expand|title=Examples|
<br>
<gallery mode=packed heights=290px>
<gallery mode=packed heights=290px>
File:cBLUR1.jpg| thumb | left | 510px | ShadowRadius - 0.0001
File:ShadowRaduis1.jpg| thumb | left | 510px | ShadowRadius - 0.0001
File:cBLUR2.jpg| thumb | left | 510px | ShadowRadius - 1
File:ShadowRaduis2.jpg| thumb | left | 510px | ShadowRadius - 1
File:cBLUR3.jpg| thumb | left | 510px | ShadowRadius - 5
File:ShadowRaduis3.jpg| thumb | left | 510px | ShadowRadius - 5
</gallery>
</gallery>
{{todo|Update the images (the screenshots was taken when the game was using old shadow filtering).}}
}}
}}
:{{tip|Don't use very low values, because the shadows will look like stairs. Also don't use very high values, because the noise will spoil them a lot, or you'll see only noise.}}
}}
}}
{{KV|NearZ|intn=NearZ|float|NearZ used by shadowmap camera for this light. This is the distance at which the light source will start cast shadows.}}
{{KV|NearZ|intn=NearZ|float|NearZ used by shadowmap camera for this light. This is the distance at which the light source will start cast shadows.}}

Latest revision as of 07:40, 24 June 2025


Light Type (LightType) <choices>
Type of the light. This affects the behavior of the light source with parent, enable/disable dynamic models in shadowmaps, enable/disable static shadowmaps.
  • 0: Static - used only static shadowmaps, this means that shadows are cast only by static objects (prop_static, geometry, etc). Cannot move with parent.
Icon-Important.pngImportant:Brush entities and bmodels are also included in static shadowmaps and they never update (including func_physbox).
Note.pngNote:Static shadowmaps will update after save reload (only once).
  • 1: Stationary - the same as Static, but with dynamic shadows for dynamic models.
  • 2: Dynamic - lighting don't use static shadowmaps at all. It uses dynamic shadows for static objects and dynamic models. This type also can move with parent. This type is expensive, usually used for moving lights, but also can be used if you're getting issues due to static shadowmaps.
Examples
Note.pngNote:Note that shadow from metal box and grate box are flying on first and second pictures, that's because both was placed in air on map spawn. Doesn't happen on third picture, because the light updated shadow for both.
HasShadow (HasShadow) <choices>
Sets shadows state for the light, enabled or disabled. Remember that the default choices is No.
  • 0: No
  • 1: Yes
Examples
ShadowMapLOD (ShadowLod) <choices>
Resolution of shadowmap used by this light. This affects the quality of the shadows.
  • 0: 256
  • 1: 512
  • 2: 1024
Examples
Icon-Important.pngImportant:You cannot use any value from here an unlimited number of times. More information below.
ShadowRadius (ShadowRadius) <float>
Radius of shadow edges for soft shadows. If its value is negative, code will auto assign a value depending on ShadowLod. These code based values can be adjusted via convars nr_shadow_rad_High, nr_shadow_rad_Med and nr_shadow_rad_Low.
Examples
Tip.pngTip:Don't use very low values, because the shadows will look like stairs. Also don't use very high values, because the noise will spoil them a lot, or you'll see only noise.
NearZ (NearZ) <float>
NearZ used by shadowmap camera for this light. This is the distance at which the light source will start cast shadows.