NewLight Point: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(cleanup, moved bugs and limitations to subpage)
No edit summary
Line 4: Line 4:
  It is one of the many new lighting entities available. Black Mesa incorporates a new lighting system which utilizes [[Deferred lighting]] to create dynamic lighting system with dynamic shadows, which allows to complement and quite enliven some scenes, it is also nice effect for moving objects, such as trains. It is also include fine tuning Godrays and lightcookies.
  It is one of the many new lighting entities available. Black Mesa incorporates a new lighting system which utilizes [[Deferred lighting]] to create dynamic lighting system with dynamic shadows, which allows to complement and quite enliven some scenes, it is also nice effect for moving objects, such as trains. It is also include fine tuning Godrays and lightcookies.
{{warning|New lights use expensive [https://learnopengl.com/Advanced-Lighting/Deferred-Shading gbuffer], that means that with this entity your scene rendering at least 5 times, which makes your level very expensive, considering that [[XenEngine]] uses 32-bit architecture and [[DirectX_Versions|DirectX]] 9.5 rendering. In large quantities, new lights can greatly heat up your computer and also cause large FPS drops (depending on difficulty of your map and how your area open). Use wisely.}}
{{warning|New lights use expensive [https://learnopengl.com/Advanced-Lighting/Deferred-Shading gbuffer], that means that with this entity your scene rendering at least 5 times, which makes your level very expensive, considering that [[XenEngine]] uses 32-bit architecture and [[DirectX_Versions|DirectX]] 9.5 rendering. In large quantities, new lights can greatly heat up your computer and also cause large FPS drops (depending on difficulty of your map and how your area open). Use wisely.}}
{{note|You can have only 512 point light entities placed in the map editor.}}
{{Note|You can have only 512 point light entities placed in the map editor.}}
{{bms}} Represented by class <code>CNewLightPoint</code>.
{{bms}} Represented by class <code>CNewLightPoint</code>.
{{back | Black Mesa Level Creation}}
{{back | Black Mesa Level Creation}}
Line 15: Line 15:
{{KV|Parent|intn=parentname|target_destination|The name of this entity's parent in the movement hierarchy. Entities with parents move with their parent.}}
{{KV|Parent|intn=parentname|target_destination|The name of this entity's parent in the movement hierarchy. Entities with parents move with their parent.}}
{{KV|Pitch Yaw Roll (Y Z X)|intn=angles|angle|nofgd=1|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.}}
{{KV|Pitch Yaw Roll (Y Z X)|intn=angles|angle|nofgd=1|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.}}
{{Important|Have huge differences if you use texture for your {{ent|newLight_Point}}.}}
:{{important|Have huge differences if you use texture for your {{ent|newLight_Point}}.}}
{{KV|Enabled|intn=Enabled|Choices|Enable/Disable this Entity.
{{KV|Enabled|intn=Enabled|Choices|Enable/Disable this Entity.
Determines if the light is off at level start.
Determines if the light is off at level start.
Line 22: Line 22:
{{KV|Appearance|intn=FlareStyle|Choices|Appearance presets.
{{KV|Appearance|intn=FlareStyle|Choices|Appearance presets.
{{Light appearances}}
{{Light appearances}}
{{tip|Static lightmapped lights reduces performance with custom appearance (especially near displacements). If this cause problems, you can use replace your static lights with new lights, if used correctly - in most cases this will significantly preserve performance.
:{{tip|Static lightmapped lights reduces performance with custom appearance (especially near displacements). If this cause problems, you can use replace your static lights with new lights, if used correctly - in most cases this will significantly preserve performance.
}}
}}
}}
}}
Line 29: Line 29:
{{KV|Light Ambient Color|intn=LightColorAmbient|color255|This is the ambient color of the sunlight.
{{KV|Light Ambient Color|intn=LightColorAmbient|color255|This is the ambient color of the sunlight.
Determines color of shadows that light source creates.}}
Determines color of shadows that light source creates.}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=500px>
<gallery mode=packed heights=500px>
Line 39: Line 39:
{{KV|Light Intensity|intn=Intensity|float|RGB * Intensity.
{{KV|Light Intensity|intn=Intensity|float|RGB * Intensity.
Brightness of the light.}}
Brightness of the light.}}
{{Note|With 0 will not draw, process and specular shader be disabled.}}
:{{Note|With 0 will not draw, process and specular shader be disabled.}}
{{KV|SpecularMultiplier|intn=SpecMultiplier|float|0 to 1 RGB * Intensity * SpecularMultiplier.
{{KV|SpecularMultiplier|intn=SpecMultiplier|float|0 to 1 RGB * Intensity * SpecularMultiplier.
Brightness of [https://developer.valvesoftware.com/wiki/New_Specularof the specular] shader from this light source.}}
Brightness of [https://developer.valvesoftware.com/wiki/New_Specularof the specular] shader from this light source.}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=500px>
<gallery mode=packed heights=500px>
Line 50: Line 50:
</gallery>
</gallery>
}}
}}
{{KV|Range|intn=Range|float|Range.
{{KV|Range|intn=Range|float|How far the light source illuminates. Measured in Hammer Units.}}
How far the light source illuminates. Measured in Hammer Units.}}
:{{important|It greatly affects optimization, less is better.}}
{{Important|It greatly affects optimization, less is better.}}
{{expand|margin_left=2em|title=Examples|
{{expand|title=Examples|
<br>
<br>
<gallery mode=packed heights=500px>
<gallery mode=packed heights=500px>
Line 64: Line 63:
Determines the light type.  
Determines the light type.  
*0: Static - shadows are cast only by static objects ([[prop_static]], geometry, etc.). Lighting does not update if it has parent (use if part scene has no large moving parts, or shadow accuracy is not important).  
*0: Static - shadows are cast only by static objects ([[prop_static]], geometry, etc.). Lighting does not update if it has parent (use if part scene has no large moving parts, or shadow accuracy is not important).  
*1: Stationary - shadows are cast by static and dynamic objects, lighting does not update if it has a parent. {{Important|Shadows for dynamic props update, but baked for geometry. That means that shadows from [[func_physbox]] and other dynamic geometry will never update, and shadows from other geometry on them too.}}
*1: Stationary - shadows are cast by static and dynamic objects, lighting does not update if it has a parent.  
:{{important|Shadows for dynamic props update, but baked for geometry. That means that shadows from [[func_physbox]] and other dynamic geometry will never update, and shadows from other geometry on them too.}}
*2: Dynamic - lighting is not baked at all. Shadows are cast by static and dynamic objects, lighting updates if it does have a parent. This light is quite expensive, and should only be used for moving light sources, or if your scene have moving geometry.}}
*2: Dynamic - lighting is not baked at all. Shadows are cast by static and dynamic objects, lighting updates if it does have a parent. This light is quite expensive, and should only be used for moving light sources, or if your scene have moving geometry.}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=420px>
<gallery mode=packed heights=420px>
Line 78: Line 78:
*0: No
*0: No
*1: Yes}}
*1: Yes}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=410px>
<gallery mode=packed heights=410px>
Line 90: Line 90:
*1: 512
*1: 512
*2: 1024}}
*2: 1024}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=500px>
<gallery mode=packed heights=500px>
Line 125: Line 125:
Determines distance at which light source will cast shadows.}}
Determines distance at which light source will cast shadows.}}
{{KV|DepthBias|intn=DepthBias|float|DepthBias - Offset added to depth values in shadowmaps.}}
{{KV|DepthBias|intn=DepthBias|float|DepthBias - Offset added to depth values in shadowmaps.}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=500px>
<gallery mode=packed heights=500px>
Line 134: Line 134:
}}
}}
{{KV|SlopeDepthBias|intn=SlopeDepthBias|float|Slope Depth Bias - For surfaces having aliasing due to steep angles with light}}.
{{KV|SlopeDepthBias|intn=SlopeDepthBias|float|Slope Depth Bias - For surfaces having aliasing due to steep angles with light}}.
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=500px>
<gallery mode=packed heights=500px>
Line 143: Line 143:
}}
}}
{{KV|NormalBias|intn=NormalBias|float|While rendering objects into shadow maps, each vertex will be moved along -ve Normal direction, giving it an appearance of shrinking while rendering to shadow maps. This property determines the amount of Units to be moved. Helps with shadow aliasing.}}
{{KV|NormalBias|intn=NormalBias|float|While rendering objects into shadow maps, each vertex will be moved along -ve Normal direction, giving it an appearance of shrinking while rendering to shadow maps. This property determines the amount of Units to be moved. Helps with shadow aliasing.}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=500px>
<gallery mode=packed heights=500px>
Line 151: Line 151:
</gallery>
</gallery>
}}
}}
{{bug*|Numbers lower than 0.8 can cause huge graphics problems.}}
:{{bug*|Numbers lower than 0.8 can cause huge graphics problems.}}
{{expand|title=The bug example|
{{expand|margin_left=2em|title=The bug example|
<br>
<br>
<gallery mode=packed heights=720px>
<gallery mode=packed heights=720px>
Line 160: Line 160:
{{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 nr_shadow_rad_High,nr_shadow_rad_Med and 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 nr_shadow_rad_High,nr_shadow_rad_Med and nr_shadow_rad_Low.}}
Determines shadow blur. Low numbers are expensive to render.
Determines shadow blur. Low numbers are expensive to render.
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=500px>
<gallery mode=packed heights=500px>
Line 172: Line 172:
*0: Disabled
*0: Disabled
*1: Enabled}}
*1: Enabled}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=410px>
<gallery mode=packed heights=410px>
Line 180: Line 180:
</gallery>
</gallery>
}}
}}
{{tip|Lightcookie texture works just like static cubemap textures. Follow [[$envmap#Creating_a_custom_static_cubemap_texture|this]] steps to create your own lightcookie texture.}}
:{{tip|Lightcookie texture works just like static cubemap textures. Follow [[$envmap#Creating_a_custom_static_cubemap_texture|this]] steps to create your own lightcookie texture.}}
{{Note|One of the most expensive features, use wisely. If shadows enabled - it can work with lags even with powerful PC.}}
:{{Note|One of the most expensive features, use wisely. If shadows enabled - it can work with lags even with powerful PC.}}
{{KV|Texture name for TexLight|intn=texName|string|Determines which texture will use light source. It use .vtf files, not .vmt.}}
{{KV|Texture name for TexLight|intn=texName|string|Determines which texture will use light source. It use .vtf files, not .vmt.}}
{{KV|.Enable Prop Only Mode|intn=bNegLight|choices|Enable Prop Only Mode.
{{KV|.Enable Prop Only Mode|intn=bNegLight|choices|Enable Prop Only Mode.
Line 191: Line 191:
*1: Godrays
*1: Godrays
*2: Both Light and GodRays}}
*2: Both Light and GodRays}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=500px>
<gallery mode=packed heights=500px>
Line 199: Line 199:
</gallery>
</gallery>
}}
}}
{{note|The game will think that the godrays is used if choice is <code>Godrays</code> or <code>Both Light and GodRays</code>, even if godrays is turned off.}}
:{{Note|The game will think that the godrays is used if choice is <code>Godrays</code> or <code>Both Light and GodRays</code>, even if godrays is turned off.}}
{{KV|EnableGodRays|intn=EnableGodRays|choices|Enable GodRays.
{{KV|EnableGodRays|intn=EnableGodRays|choices|Enable GodRays.
Determines whether godrays are enabled or not at map start.
Determines whether godrays are enabled or not at map start.
*0: Disabled
*0: Disabled
*1: Enabled}}
*1: Enabled}}
{{warning|You can have only 40 point lights with godrays enabled simultaneously, otherwise game will crash with this error message.}}
:{{warning|You can have only 40 point lights with godrays enabled simultaneously, otherwise game will crash with this error message.}}
<br>
<br>
<gallery mode=packed heights=180px>
<gallery mode=packed heights=180px>
File:cRaysLimit.jpg| thumb | left | 510px | If you'll try to enable forty-first light point with enabled Godrays.
File:cRaysLimit.jpg| thumb | left | 510px | If you'll try to enable forty-first light point with enabled Godrays.
</gallery>
</gallery>
{{note|Godrays are draw and process even with closed [[areaportals]].}}
:{{Note|Godrays are draw and process even with closed [[areaportals]].}}
{{expand|title=Example|
{{expand|margin_left=2em|title=Example|
<br>
<br>
<gallery mode=packed heights=710px>
<gallery mode=packed heights=710px>
Line 217: Line 217:
}}
}}
{{KV|Density|intn=Density|float|Density Controls the length of rays/volumetric shadows. 1.0 should work in 99% cases. Good values to start from: 0.5 to 1.5.}}
{{KV|Density|intn=Density|float|Density Controls the length of rays/volumetric shadows. 1.0 should work in 99% cases. Good values to start from: 0.5 to 1.5.}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=710px>
<gallery mode=packed heights=710px>
Line 226: Line 226:
}}
}}
{{KV|Weight|intn=Weight|float|Weight Controls the intensity of volumetric shadow. Blocking of rays by geometry. Good values to start from: 0.1 - 10.0.}}
{{KV|Weight|intn=Weight|float|Weight Controls the intensity of volumetric shadow. Blocking of rays by geometry. Good values to start from: 0.1 - 10.0.}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=710px>
<gallery mode=packed heights=710px>
Line 237: Line 237:
{{todo|Document what does it change.}}
{{todo|Document what does it change.}}
{{KV|Exposure|intn=Exposure|float|Exposure Controls the intensity of Rays during blending pass with main scene. 2.0 is a good start. Good values are 1.0 - 10.0.}}
{{KV|Exposure|intn=Exposure|float|Exposure Controls the intensity of Rays during blending pass with main scene. 2.0 is a good start. Good values are 1.0 - 10.0.}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=710px>
<gallery mode=packed heights=710px>
Line 246: Line 246:
}}
}}
{{KV|DistFactor|intn=DistFactor|float|DistFactor Controls the falloff of rays / length. 1.0f is a good starting value increase or decrease in the increments of 0.1. 0.0 will make the rays dissappear only disk will be rendererd.}}
{{KV|DistFactor|intn=DistFactor|float|DistFactor Controls the falloff of rays / length. 1.0f is a good starting value increase or decrease in the increments of 0.1. 0.0 will make the rays dissappear only disk will be rendererd.}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=710px>
<gallery mode=packed heights=710px>
Line 255: Line 255:
}}
}}
{{KV|DiskRadius|intn=DiskRadius|float|Radius of Disk/circle of sun in texturespace. 1.0 will be full screen 0.5 is half screen etc.}}
{{KV|DiskRadius|intn=DiskRadius|float|Radius of Disk/circle of sun in texturespace. 1.0 will be full screen 0.5 is half screen etc.}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=710px>
<gallery mode=packed heights=710px>
Line 263: Line 263:
</gallery>
</gallery>
}}
}}
{{Note|With 0 - will not render.}}
:{{Note|With 0 - will not render.}}
{{KV|ColorInner|intn=ColorInner|color255| This is the color of the inner circle.}}
{{KV|ColorInner|intn=ColorInner|color255| This is the color of the inner circle.}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=710px>
<gallery mode=packed heights=710px>
Line 273: Line 273:
</gallery>
</gallery>
}}
}}
{{Note|Unlike lighting - brightness of inner depends on fourth number which can be written here.}}
:{{Note|Unlike lighting - brightness of inner depends on fourth number which can be written here.}}
{{KV|ColorRays|intn=ColorRays|color255| This is the color of the rays.}}
{{KV|ColorRays|intn=ColorRays|color255| This is the color of the rays.}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=710px>
<gallery mode=packed heights=710px>
Line 283: Line 283:
</gallery>
</gallery>
}}
}}
{{Note|Unlike lighting - brightness of rays depends on fourth number which can be written here.}}
:{{Note|Unlike lighting - brightness of rays depends on fourth number which can be written here.}}
{{KV|GodRaysType|intn=GodRaysType|choices|GodRaysType.
{{KV|GodRaysType|intn=GodRaysType|choices|GodRaysType.
*0: Normal
*0: Normal
*1: Fancy}}
*1: Fancy}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=710px>
<gallery mode=packed heights=710px>
Line 295: Line 295:
}}
}}
{{KV|DiskInnerSizePercent|intn=DiskInnerSizePercent|float|Used only in Fancy Gaphics Mode. Disk inner circle radius [[=]] DiskRadius * DiskInnerSizePercent.}}
{{KV|DiskInnerSizePercent|intn=DiskInnerSizePercent|float|Used only in Fancy Gaphics Mode. Disk inner circle radius [[=]] DiskRadius * DiskInnerSizePercent.}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=710px>
<gallery mode=packed heights=710px>
Line 303: Line 303:
</gallery>
</gallery>
}}
}}
{{Note|With 0 - will not render.}}
:{{Note|With 0 - will not render.}}
{{KV|ColorOuter|intn=ColorOuter|color255|Used only in Fancy Mode. This is the color of the outer circle.}}
{{KV|ColorOuter|intn=ColorOuter|color255|Used only in Fancy Mode. This is the color of the outer circle.}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=710px>
<gallery mode=packed heights=710px>
Line 313: Line 313:
</gallery>
</gallery>
}}
}}
{{Note|Unlike lighting - brightness of outer depends on fourth number which can be written here.}}
:{{Note|Unlike lighting - brightness of outer depends on fourth number which can be written here.}}
{{KV|Ell_FR_ConstA|intn=Ell_FR_ConstA|float|This is fancy Godrays disk size.}}
{{KV|Ell_FR_ConstA|intn=Ell_FR_ConstA|float|This is fancy Godrays disk size.}}
{{Note|For fancy Godrays only.}}
:{{Note|For fancy Godrays only.}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=500px>
<gallery mode=packed heights=500px>
Line 325: Line 325:
}}
}}
{{KV|Ell_FR_ConstB|intn=Ell_FR_ConstB|float|This is fancy Godrays disk distortion.}}
{{KV|Ell_FR_ConstB|intn=Ell_FR_ConstB|float|This is fancy Godrays disk distortion.}}
{{Note|For fancy Godrays only.}}
:{{Note|For fancy Godrays only.}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=500px>
<gallery mode=packed heights=500px>
Line 335: Line 335:
}}
}}
{{KV|EEll_SR_ConstA|intn=EEll_SR_ConstA|float|This is fancy Godrays disk hole size.}}
{{KV|EEll_SR_ConstA|intn=EEll_SR_ConstA|float|This is fancy Godrays disk hole size.}}
{{Note|For fancy Godrays only.}}
:{{Note|For fancy Godrays only.}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=500px>
<gallery mode=packed heights=500px>
Line 345: Line 345:
}}
}}
{{KV|EEll_SR_ConstB|intn=EEll_SR_ConstB|float|This is fancy Godrays disk hole distortion.}}
{{KV|EEll_SR_ConstB|intn=EEll_SR_ConstB|float|This is fancy Godrays disk hole distortion.}}
{{Note|For fancy Godrays only.}}
:{{Note|For fancy Godrays only.}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=500px>
<gallery mode=packed heights=500px>
Line 355: Line 355:
}}
}}
{{KV|Ell_RRF_ConstA|intn=Ell_RRF_ConstA|float|This is fancy Godrays inner size.}}
{{KV|Ell_RRF_ConstA|intn=Ell_RRF_ConstA|float|This is fancy Godrays inner size.}}
{{Note|For fancy Godrays only.}}
:{{Note|For fancy Godrays only.}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=500px>
<gallery mode=packed heights=500px>
Line 365: Line 365:
}}
}}
{{KV|Ell_RRF_ConstB|intn=Ell_RRF_ConstB|float|This is fancy Godrays inner distortion.}}
{{KV|Ell_RRF_ConstB|intn=Ell_RRF_ConstB|float|This is fancy Godrays inner distortion.}}
{{Note|For fancy Godrays only.}}
:{{Note|For fancy Godrays only.}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=500px>
<gallery mode=packed heights=500px>
Line 376: Line 376:
{{KV|RotSpeed|intn=RotSpeed|float|}}
{{KV|RotSpeed|intn=RotSpeed|float|}}
Determines rotating speed of fancy rays, 0 - don't rotate, negative number - will rotate to left.
Determines rotating speed of fancy rays, 0 - don't rotate, negative number - will rotate to left.
{{Note|For fancy Godrays only.}}
:{{Note|For fancy Godrays only.}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=710px>
<gallery mode=packed heights=710px>
Line 387: Line 387:
{{KV|RotPatternFreq|intn=RotPatternFreq|float|}}
{{KV|RotPatternFreq|intn=RotPatternFreq|float|}}
Determines count of fancy rays in frame, with negative number will deny RotSpeed +/- effect.
Determines count of fancy rays in frame, with negative number will deny RotSpeed +/- effect.
{{Note|For fancy Godrays only.}}
:{{Note|For fancy Godrays only.}}
{{expand|title=Examples|
{{expand|margin_left=2em|title=Examples|
<br>
<br>
<gallery mode=packed heights=710px>
<gallery mode=packed heights=710px>

Revision as of 05:22, 6 September 2024

English (en)Translate (Translate)
NewLight Point.png

newLight_Point is a point entity available in Black Mesa Black Mesa.

Wikipedia - Letter.png
This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)
It is one of the many new lighting entities available. Black Mesa incorporates a new lighting system which utilizes Deferred lighting to create dynamic lighting system with dynamic shadows, which allows to complement and quite enliven some scenes, it is also nice effect for moving objects, such as trains. It is also include fine tuning Godrays and lightcookies.
Warning.pngWarning:New lights use expensive gbuffer, that means that with this entity your scene rendering at least 5 times, which makes your level very expensive, considering that XenEngine uses 32-bit architecture and DirectX 9.5 rendering. In large quantities, new lights can greatly heat up your computer and also cause large FPS drops (depending on difficulty of your map and how your area open). Use wisely.
Note.pngNote:You can have only 512 point light entities placed in the map editor.

Black Mesa Represented by class CNewLightPoint.

Black Mesa Level Creation


Keyvalues

Name (targetname) <string>
The name that other entities refer to this entity by.
Parent (parentname) <targetname>
The name of this entity's parent in the movement hierarchy. Entities with parents move with their parent.
Pitch Yaw Roll (Y Z X) (angles) <angle> !FGD
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.
Icon-Important.pngImportant:Have huge differences if you use texture for your newLight_Point.
Enabled (Enabled) <choices>
Enable/Disable this Entity.

Determines if the light is off at level start.

  • 0: Enabled
  • 1: Disabled
Appearance (FlareStyle) <choices>
Appearance presets.

Template:Light appearances

Tip.pngTip:Static lightmapped lights reduces performance with custom appearance (especially near displacements). If this cause problems, you can use replace your static lights with new lights, if used correctly - in most cases this will significantly preserve performance.
Light Color (LightColor) <color255>
This is the color of the sunlight.

Determines color of light.

Light Ambient Color (LightColorAmbient) <color255>
This is the ambient color of the sunlight.

Determines color of shadows that light source creates.

Examples


Light Intensity (Intensity) <float>
RGB * Intensity.

Brightness of the light.

Note.pngNote:With 0 will not draw, process and specular shader be disabled.
SpecularMultiplier (SpecMultiplier) <float>
0 to 1 RGB * Intensity * SpecularMultiplier.

Brightness of the specular shader from this light source.

Examples


Range (Range) <float>
How far the light source illuminates. Measured in Hammer Units.
Icon-Important.pngImportant:It greatly affects optimization, less is better.
Examples


Light Type (LightType) <choices>
Determines the light type.
  • 0: Static - shadows are cast only by static objects (prop_static, geometry, etc.). Lighting does not update if it has parent (use if part scene has no large moving parts, or shadow accuracy is not important).
  • 1: Stationary - shadows are cast by static and dynamic objects, lighting does not update if it has a parent.
Icon-Important.pngImportant:Shadows for dynamic props update, but baked for geometry. That means that shadows from func_physbox and other dynamic geometry will never update, and shadows from other geometry on them too.
  • 2: Dynamic - lighting is not baked at all. Shadows are cast by static and dynamic objects, lighting updates if it does have a parent. This light is quite expensive, and should only be used for moving light sources, or if your scene have moving geometry.
Examples


HasShadow (HasShadow) <choices>
Do you want this light to have shadows?

Determines whether the light source will cast shadows. Remember that default choices is No.

  • 0: No
  • 1: Yes
Examples


ShadowMapLOD (ShadowLod) <choices>
Resolution of ShadowMap used by this light.

Determines quality of shadows. 1024 is very expensive, use it only in places where it's really needed, in most cases 512 is good alternative. 256 produces the blurriest shadows, but it is also the cheapest.

  • 0: 256
  • 1: 512
  • 2: 1024
Examples


ShadowFaceX (ShadowFaceX) <choices>
Shadow Enabled for this Face ?

Determines whether the given side lighting will display shadows.

  • 0: Enabled
  • 1: Disabled
ShadowFaceX_Minus (ShadowFaceX_Minus) <choices>
Shadow Enabled for this Face ?

Determines whether the given side lighting will display shadows.

  • 0: Enabled
  • 1: Disabled
ShadowFaceY (ShadowFaceY) <choices>
Shadow Enabled for this Face ?

Determines whether the given side lighting will display shadows.

  • 0: Enabled
  • 1: Disabled
ShadowFaceY_Minus (ShadowFaceY_Minus) <choices>
Shadow Enabled for this Face ?

Determines whether the given side lighting will display shadows.

  • 0: Enabled
  • 1: Disabled
ShadowFaceZ (ShadowFaceZ) <choices>
Shadow Enabled for this Face ?

Determines whether the given side lighting will display shadows.

  • 0: Enabled
  • 1: Disabled
ShadowFaceZ_Minus (ShadowFaceZ_Minus) <choices>
Shadow Enabled for this Face ?

Determines whether the given side lighting will display shadows.

  • 0: Enabled
  • 1: Disabled
NearZ (NearZ) <float>
NearZ used by shadowmap camera for this light.

Determines distance at which light source will cast shadows.

DepthBias (DepthBias) <float>
DepthBias - Offset added to depth values in shadowmaps.
Examples


SlopeDepthBias (SlopeDepthBias) <float>
Slope Depth Bias - For surfaces having aliasing due to steep angles with light.
Examples


NormalBias (NormalBias) <float>
While rendering objects into shadow maps, each vertex will be moved along -ve Normal direction, giving it an appearance of shrinking while rendering to shadow maps. This property determines the amount of Units to be moved. Helps with shadow aliasing.
Examples


Icon-Bug.pngBug*:Numbers lower than 0.8 can cause huge graphics problems.
The bug example


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.

Determines shadow blur. Low numbers are expensive to render.

Examples


Enable Texture Light (bTexLight) <choices>
Enable Texture Ligh.

Determines whether the given light source uses .vtf texture from game files (just like env_projectedtexture). With NewLight_Point, this technically works like a cube. The best example is the batteries that use lights/lightcookie_battery.vtf.

  • 0: Disabled
  • 1: Enabled
Examples


Tip.pngTip:Lightcookie texture works just like static cubemap textures. Follow this steps to create your own lightcookie texture.
Note.pngNote:One of the most expensive features, use wisely. If shadows enabled - it can work with lags even with powerful PC.
Texture name for TexLight (texName) <string>
Determines which texture will use light source. It use .vtf files, not .vmt.
.Enable Prop Only Mode (bNegLight) <choices>
Enable Prop Only Mode.
Todo: Document what it does.
  • 0: Disabled
  • 1: Enabled
LightnGodRayMode (LightnGodRayMode) <choices>
0:Light 1:Godrays 2:Both Light and GodRays.
  • 0: Light
  • 1: Godrays
  • 2: Both Light and GodRays
Examples


Note.pngNote:The game will think that the godrays is used if choice is Godrays or Both Light and GodRays, even if godrays is turned off.
EnableGodRays (EnableGodRays) <choices>
Enable GodRays.

Determines whether godrays are enabled or not at map start.

  • 0: Disabled
  • 1: Enabled
Warning.pngWarning:You can have only 40 point lights with godrays enabled simultaneously, otherwise game will crash with this error message.


Note.pngNote:Godrays are draw and process even with closed areaportals.
Example


Density (Density) <float>
Density Controls the length of rays/volumetric shadows. 1.0 should work in 99% cases. Good values to start from: 0.5 to 1.5.
Examples


Weight (Weight) <float>
Weight Controls the intensity of volumetric shadow. Blocking of rays by geometry. Good values to start from: 0.1 - 10.0.
Examples


Decay (Decay) <float>
Decay NOT being used.
Todo: Document what does it change.
Exposure (Exposure) <float>
Exposure Controls the intensity of Rays during blending pass with main scene. 2.0 is a good start. Good values are 1.0 - 10.0.
Examples


DistFactor (DistFactor) <float>
DistFactor Controls the falloff of rays / length. 1.0f is a good starting value increase or decrease in the increments of 0.1. 0.0 will make the rays dissappear only disk will be rendererd.
Examples


DiskRadius (DiskRadius) <float>
Radius of Disk/circle of sun in texturespace. 1.0 will be full screen 0.5 is half screen etc.
Examples


Note.pngNote:With 0 - will not render.
ColorInner (ColorInner) <color255>
This is the color of the inner circle.
Examples


Note.pngNote:Unlike lighting - brightness of inner depends on fourth number which can be written here.
ColorRays (ColorRays) <color255>
This is the color of the rays.
Examples


Note.pngNote:Unlike lighting - brightness of rays depends on fourth number which can be written here.
GodRaysType (GodRaysType) <choices>
GodRaysType.
  • 0: Normal
  • 1: Fancy
Examples


DiskInnerSizePercent (DiskInnerSizePercent) <float>
Used only in Fancy Gaphics Mode. Disk inner circle radius = DiskRadius * DiskInnerSizePercent.
Examples


Note.pngNote:With 0 - will not render.
ColorOuter (ColorOuter) <color255>
Used only in Fancy Mode. This is the color of the outer circle.
Examples


Note.pngNote:Unlike lighting - brightness of outer depends on fourth number which can be written here.
Ell_FR_ConstA (Ell_FR_ConstA) <float>
This is fancy Godrays disk size.
Note.pngNote:For fancy Godrays only.
Examples


Ell_FR_ConstB (Ell_FR_ConstB) <float>
This is fancy Godrays disk distortion.
Note.pngNote:For fancy Godrays only.
Examples


EEll_SR_ConstA (EEll_SR_ConstA) <float>
This is fancy Godrays disk hole size.
Note.pngNote:For fancy Godrays only.
Examples


EEll_SR_ConstB (EEll_SR_ConstB) <float>
This is fancy Godrays disk hole distortion.
Note.pngNote:For fancy Godrays only.
Examples


Ell_RRF_ConstA (Ell_RRF_ConstA) <float>
This is fancy Godrays inner size.
Note.pngNote:For fancy Godrays only.
Examples


Ell_RRF_ConstB (Ell_RRF_ConstB) <float>
This is fancy Godrays inner distortion.
Note.pngNote:For fancy Godrays only.
Examples


RotSpeed (RotSpeed) <float>

Determines rotating speed of fancy rays, 0 - don't rotate, negative number - will rotate to left.

Note.pngNote:For fancy Godrays only.
Examples


RotPatternFreq (RotPatternFreq) <float>

Determines count of fancy rays in frame, with negative number will deny RotSpeed +/- effect.

Note.pngNote:For fancy Godrays only.
Examples


RenderInWorldSpace (m_bEnableWorldSpace) <choices>
Disables disks if this enabled.
m_fAlphaDiskInner (m_fAlphaDiskInner) <float>
m_fAlphaDiskOuter (m_fAlphaDiskOuter) <float>
UseToneMapRays (m_bUseToneMapRays) <choices>
  • 0: Enabled
  • 1: Disabled
UseToneMapDisk (m_bUseToneMapDisk) <choices>
  • 0: Enabled
  • 1: Disabled
ShadowPass_Brush (m_bSRO_Brush) <choices>
Do we want to Render Brushes in shadow passes for this light?
  • 0: YES
  • 1: NO
ShadowPass_StaticProp (m_bSRO_StaticProp) <choices>
Do we want to Render StaticProps in shadow passes for this light?
  • 0: YES
  • 1: NO
ShadowPass_DynProp (m_bSRO_DynProp) <choices>
Do we want to Render Dynamic Props in shadow passes for this light?
  • 0: YES
  • 1: NO
ShadowPass_AlphaTest (m_bSRO__Trans) <choices>
Do we want to Render AlphaTested Objects in shadow passes for this light?
  • 0: YES
  • 1: NO
bUseOldFallOff (bUseOldFallOff) <choices> !FGD Obsolete
Deprecated.
Enable old falloff similar to light/light_spot.
  • 0: No
  • 1: Yes
falloffConstant (falloffConstant) <integer> !FGD Obsolete
Deprecated.
Constant (work only if bUseOldFallOff enabled).
falloffLinear (falloffLinear) <integer> !FGD Obsolete
Deprecated.
Linear (work only if bUseOldFallOff enabled).
falloffQuadratic (falloffQuadratic) <integer> !FGD Obsolete
Deprecated.
Quadratic (work only if bUseOldFallOff enabled).

Inputs

SetColorLight <color255RedirectInput/color32>
Change Light's Color value. Doesn't affect the godrays.
SetIntensityForLight <floatRedirectInput/float>
Change Light's intensity value. Doesn't affect the godrays.
TurnOnGodRays <void>
Turn the Godrays on.
TurnOffGodRays <void>
Turn the Godrays off.
TurnOn <void>
Turn the light on.
TurnOff <void>
Turn the light off.
Toggle <void>
Toggle the light's current state.

Shadow map slots

Shadow map slots is how many lights with shadows you can have per level. There are 3 separate shadow map slots, High (for lights with 1024 value for ShadowMap LOD property), Medium (for lights with 512 value for ShadowMap LOD property) and Low (for lights with 256 value for ShadowMap LOD property).

In High and Medium you can have 48 separate shadow maps, for Low you can have 47 separate shadow maps (143 shadow maps in total).

Each spot light with shadows takes 1 shadow map slot, so you can have 48/47 spot lights with shadows, if they are using the same value for ShadowMap LOD property.

Each point light with shadows takes 6 shadow map slots. This is due to point light isn't just omnidirectional light source, it's 6 spot lights in one entity. This means that you can have 8 point lights with shadows, if they are using the same value for ShadowMap LOD property. You can increase this value if you need, just disable shadows for one of the shadow face properties.

If one of the shadow map slots is full - you will not be able to have shadows for more lights with such shadow quality, you will need to use other value for ShadowMap LOD property.

Point lights and spot lights doesn't counts separately. You can't have 48 spot lights with 8 point lights, but you can have 6 spot lights with 7 point lights.

You can free up shadow map slots with Kill input. So, you can place triggers which will Kill lights that player can't see and spawn new lights via point_template (uncheck the second flag for point_template, this prevents some bugs). This helps a lot when you want to have many dynamic lights in different areas.

Important to note that due to some engine bugs you can't use many lights with shadows. Some tests show that 9th point light cause lights with shadows to be very glitchy. This can be done with spot lights as well. So don't be surprised if at some point you find something like this.

It looks like you can workaround it if you will switch ShadowMap LOD property values from higher to lower.

Lighting behavior With VIS and areaportals

Static type

Static type is the most stable, since its shadows are baked in and updates only with save loads or while lighting turning on. It shows all shadows even with closed areaportal.

Stationary type

Shadows for static props and brushes are baked, but not for physics props and other dynamic models. This means that shadows from dynamic models will disappear if they are hidden by a closed areaportal or if VIS is hiding such objects. Shadows for static props and brushes will not disappear.

In some cases, this can be noticeable if dynamic model creates a large shadow.

Dynamic type

Shadows for static props and world geometry are baked, but not for dynamic models and brushes. This means that shadows from dynamic models and brushes will disappear if they are hidden by a closed areaportal or if VIS is hiding such objects. Shadows for static props and world geometry will not disappear. Moving lighting will update shadows for static props and world geometry, even with closed areaportal.

Bugs/Limitations

See /Bugs and limitations

See also

Todo: Investigate and document some keyvalues and functions. Clean up english. Add more issues if you'll find.