NewLight Point: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(cleanup, moved bugs and limitations to subpage)
 
(131 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{LanguageBar}}
{{TabsBar|main=Black Mesa Deferred Lights}}
{{Toc-right}}{{this is a|point entity|name=newLight_Point|game=Black Mesa|sprite=NewLight Point.png{{!}}45px}}{{Multiple issues}}
{{this is a|point entity|name=newLight_Point|game=Black Mesa|sprite=NewLight Point.png}} It creates an invisible [[Deferred lighting|deferred light]] source that shines in all directions, includes godrays and lightcookies.
{{CDA|CNewLightPoint|CBaseEntity|}}
[[File:NewLight_PointMain.jpg|720px||thumb|right|NewLight_Point in {{code|End Game}} chapter (used for the portal).]]
{{Note|You can have only 512 point light entities placed in the map editor.}}


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.}}
{{note|You can have only 512 point light entities placed in the map editor.}}
{{bms}} Represented by class <code>CNewLightPoint</code>.
{{back | Black Mesa Level Creation}}
<br>
<gallery mode=packed heights=450px>
File:NewLight_PointGIFNEW.gif| frame | center | 510px |NewLight_Point in <code>Endgame</code> chapter.
</gallery>
==Keyvalues==
==Keyvalues==
{{KV|Name|intn=targetname|target_source|The name that other entities refer to this entity by.}}
{{KV Targetname}}
{{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.}}
:{{note|There is almost no differences if you're using point light with no texture. Things changes if you're using textures.}}
{{Important|Have huge differences if you use texture for your {{ent|newLight_Point}}.}}
{{KV|Enabled|intn=Enabled|Choices|Enable/Disable this Entity.
Determines if the light is off at level start.
*0: Enabled
*1: Disabled}}
{{KV|Appearance|intn=FlareStyle|Choices|Appearance presets.
{{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.
}}
}}
{{KV BmNewLightOldFalloff}}
{{KV BmNewLightBaseMain}}
{{KV BmNewLightShadowMain}}
{{KV BmNewLightShadowFace}}
{{KV BmNewLightShadowBias}}
{{KV BmNewLightCookieMain}}
{{KV|LightnGodRayMode|intn=LightnGodRayMode|choices|This determines what effects will be available to use for the light source. Keep in mind that the default choice is Light.
:*0: Light - light only.
:*1: Godrays - godrays only.
:*2: Both Light and GodRays - both light and godrays.
:{{bug|hidetested=1|Even if godrays is turned off, the game will still think that the godrays is used if choice is <code>Godrays</code> or <code>Both Light and GodRays</code>.}}
}}
}}
{{KV|Light Color|intn=LightColor|color255|This is the color of the sunlight.
{{KV BmGodraysNormal}}
Determines color of light.}}
{{KV BmGodraysFancy}}
{{KV|Light Ambient Color|intn=LightColorAmbient|color255|This is the ambient color of the sunlight.
{{KV BmNewLightShadowPasses‎}}
Determines color of shadows that light source creates.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=500px>
File:cShadowC1.jpg| thumb | left | 510px | 0 0 0
File:cShadowC2.jpg| thumb | left | 510px | 255 0 0
File:cShadowC3.jpg| thumb | left | 510px | 255 128 128
</gallery>
}}
{{KV|Light Intensity|intn=Intensity|float|RGB * Intensity.
Brightness of the light.}}
{{Note|With 0 will not draw, process and specular shader be disabled.}}
{{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.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=500px>
File:cBS IN1.jpg| thumb | left | 510px | SpecularMultiplier - 1
File:cBS IN10.jpg| thumb | left | 510px | SpecularMultiplier - 10
File:cBS IN20.jpg| thumb | left | 510px | SpecularMultiplier - 20
</gallery>
}}
{{KV|Range|intn=Range|float|Range.
How far the light source illuminates. Measured in Hammer Units.}}
{{Important|It greatly affects optimization, less is better.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=500px>
File:cL1.jpg| thumb | left | 510px | Range - 150
File:cL2.jpg| thumb | left | 510px | Range - 300
File:cL3.jpg| thumb | left | 510px | Range - 500
</gallery>
}}
{{KV|Light Type|intn=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. {{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.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=420px>
File:B-1.gif|| thumb | left | 510px | Light Type - Static
File:B0.gif| thumb | left | 510px | Light Type - Stationary
File:B1.gif| thumb | left | 510px | Light Type - Dynamic
</gallery>
}}
{{KV|HasShadow|intn=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}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=410px>
File:cBM NO.jpg| thumb | left | 510px | Has Shadow - NO
File:cBM YES.jpg| thumb | left | 510px | Has Shadow - YES
</gallery>
}}
{{KV|ShadowMapLOD|intn=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}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=500px>
File:cLOD256.jpg| thumb | left | 510px | 256
File:cLOD512.jpg| thumb | left | 510px | 512
File:cLOD1024.jpg| thumb | left | 510px | 1024
</gallery>
}}
{{KV|ShadowFaceX|intn=ShadowFaceX|choices|Shadow Enabled for this Face ?
Determines whether the given side lighting will display shadows.
*0: Enabled
*1: Disabled}}
{{KV|ShadowFaceX_Minus|intn=ShadowFaceX_Minus|choices|Shadow Enabled for this Face ?
Determines whether the given side lighting will display shadows.
*0: Enabled
*1: Disabled}}
{{KV|ShadowFaceY|intn=ShadowFaceY|choices|Shadow Enabled for this Face ?
Determines whether the given side lighting will display shadows.
*0: Enabled
*1: Disabled}}
{{KV|ShadowFaceY_Minus|intn=ShadowFaceY_Minus|choices|Shadow Enabled for this Face ?
Determines whether the given side lighting will display shadows.
*0: Enabled
*1: Disabled}}
{{KV|ShadowFaceZ|intn=ShadowFaceZ|choices|Shadow Enabled for this Face ?
Determines whether the given side lighting will display shadows.
*0: Enabled
*1: Disabled}}
{{KV|ShadowFaceZ_Minus|intn=ShadowFaceZ_Minus|choices|Shadow Enabled for this Face ?
Determines whether the given side lighting will display shadows.
*0: Enabled
*1: Disabled}}
{{KV|NearZ|intn=NearZ|float|NearZ used by shadowmap camera for this light.
Determines distance at which light source will cast shadows.}}
{{KV|DepthBias|intn=DepthBias|float|DepthBias - Offset added to depth values in shadowmaps.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=500px>
File:DepthBias1.jpg| thumb | left | 510px | DepthBias - 0.0002
File:DepthBias2.jpg| thumb | left | 510px | DepthBias - 0.002
File:DepthBias3.jpg| thumb | left | 510px | DepthBias - 0.0000000002
</gallery>
}}
{{KV|SlopeDepthBias|intn=SlopeDepthBias|float|Slope Depth Bias - For surfaces having aliasing due to steep angles with light}}.
{{expand|title=Examples|
<br>
<gallery mode=packed heights=500px>
File:SlopeDepthBias1.jpg| thumb | left | 510px | SlopeDepthBias - 0.2
File:SlopeDepthBias2.jpg| thumb | left | 510px | SlopeDepthBias - 8
File:SlopeDepthBias3.jpg| thumb | left | 510px | SlopeDepthBias - 20
</gallery>
}}
{{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|
<br>
<gallery mode=packed heights=500px>
File:cNB1.jpg| thumb | left | 510px | NormalBias - 1
File:cNB2.jpg| thumb | left | 510px | NormalBias - 5
File:cNB3.jpg| thumb | left | 510px | NormalBias - 10
</gallery>
}}
{{bug*|Numbers lower than 0.8 can cause huge graphics problems.}}
{{expand|title=The bug example|
<br>
<gallery mode=packed heights=720px>
File:cNormalBiasBug.gif| frame | NormalBias - 0
</gallery>
}}
{{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.
{{expand|title=Examples|
<br>
<gallery mode=packed heights=500px>
File:cBLUR1.jpg| thumb | left | 510px | ShadowRadius - 0.0001
File:cBLUR2.jpg| thumb | left | 510px | ShadowRadius - 1
File:cBLUR3.jpg| thumb | left | 510px | ShadowRadius - 5
</gallery>
}}
{{KV|Enable Texture Light|intn=bTexLight|choices|Enable Texture Ligh.
Determines whether the given light source uses .vtf texture from game files (just like {{ent|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}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=410px>
File:cTEDisabled.jpg |Disabled
File:cTEEnabled.jpg |Enabled
File:CLightcookie_battery.jpg |Texture that use batteries.
</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.}}
{{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|.Enable Prop Only Mode|intn=bNegLight|choices|Enable Prop Only Mode.
{{todo|Document what it does.}}
*0: Disabled
*1: Enabled}}
{{KV|LightnGodRayMode|intn=LightnGodRayMode|choices|0:Light 1:Godrays 2:Both Light and GodRays.
*0: Light
*1: Godrays
*2: Both Light and GodRays}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=500px>
File:cGAL1.jpg| thumb | left | 510px | LightnGodRayMode - Light
File:cGAL2.jpg| thumb | left | 510px | LightnGodRayMode - Godrays
File:cGAL3.jpg| thumb | left | 510px | LightnGodRayMode - Both Light and GodRays
</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.}}
{{KV|EnableGodRays|intn=EnableGodRays|choices|Enable GodRays.
Determines whether godrays are enabled or not at map start.
*0: Disabled
*1: Enabled}}
{{warning|You can have only 40 point lights with godrays enabled simultaneously, otherwise game will crash with this error message.}}
<br>
<gallery mode=packed heights=180px>
File:cRaysLimit.jpg| thumb | left | 510px | If you'll try to enable forty-first light point with enabled Godrays.
</gallery>
{{note|Godrays are draw and process even with closed [[areaportals]].}}
{{expand|title=Example|
<br>
<gallery mode=packed heights=710px>
File:cRaysDraw.jpg| thumb | left | 510px | 
</gallery>
}}
{{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|
<br>
<gallery mode=packed heights=710px>
File:cDEN1.gif| thumb |Density - 1.0
File:cDEN2.gif| thumb |Density - 2.0
File:cDEN3.gif| thumb |Density - 0.5
</gallery>
}}
{{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|
<br>
<gallery mode=packed heights=710px>
File:cWEI10.gif| thumb |Weight - 1.0
File:cWEI2.gif| thumb |Weight - 2.0
File:cWEI3.gif| thumb |Weight - 5.0
</gallery>
}}
{{KV|Decay|intn=Decay|float|Decay NOT being used.}}
{{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.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=710px>
File:cEXP1.jpg| thumb |Exposure - 1.00
File:cEXP2.jpg| thumb |Exposure - 10.0
File:cEXP3.jpg| thumb |Exposure - 0.10
</gallery>
}}
{{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|
<br>
<gallery mode=packed heights=710px>
File:cDIST1.gif| thumb |DistFactor - 1.00
File:cDIST2.gif| thumb |DistFactor - 10.0
File:cDIST3.gif| thumb |DistFactor - 50.0
</gallery>
}}
{{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|
<br>
<gallery mode=packed heights=710px>
File:cDISKR1.jpg| thumb |DiskRadius - 0.02
File:cDISKR2.jpg| thumb |DiskRadius - 0.10
File:cDISKR3.jpg| thumb |DiskRadius - 1.00
</gallery>
}}
{{Note|With 0 - will not render.}}
{{KV|ColorInner|intn=ColorInner|color255| This is the color of the inner circle.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=710px>
File:cCRAYS1.jpg| thumb |255 0 0 255
File:cCINN2.jpg| thumb |0 255 0 255
File:cCINN3.jpg| thumb |0 0 255 255
</gallery>
}}
{{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.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=710px>
File:cCRAYS1.jpg| thumb |0 0 255 120
File:cCRAYS2.jpg| thumb |0 255 0 120
File:cCRAYS3.jpg| thumb | 255 0 0 120
</gallery>
}}
{{Note|Unlike lighting - brightness of rays depends on fourth number which can be written here.}}
{{KV|GodRaysType|intn=GodRaysType|choices|GodRaysType.
*0: Normal
*1: Fancy}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=710px>
File:cGodRaysTypeNormalAlt.jpg| thumb | Normal
File:cGodRaysTypeFancyAlt.jpg| thumb | Fancy
</gallery>
}}
{{KV|DiskInnerSizePercent|intn=DiskInnerSizePercent|float|Used only in Fancy Gaphics Mode. Disk inner circle radius [[=]] DiskRadius * DiskInnerSizePercent.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=710px>
File:cDISKIR1.jpg| thumb |DiskInnerSizePercent - 0.75
File:cDISKIR2.jpg| thumb |DiskInnerSizePercent - 0.50
File:cDISKIR3.jpg| thumb |DiskInnerSizePercent - 0.99
</gallery>
}}
{{Note|With 0 - will not render.}}
{{KV|ColorOuter|intn=ColorOuter|color255|Used only in Fancy Mode. This is the color of the outer circle.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=710px>
File:cCRAYS1.jpg| thumb |0 255 0 255
File:cCOUT2.jpg| thumb |255 0 0 255
File:cCOUT3.jpg| thumb |0 0 255 255
</gallery>
}}
{{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.}}
{{Note|For fancy Godrays only.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=500px>
File:C Ell_FR_ConstA1.jpg| thumb | left | 510px | 0.9
File:C Ell_FR_ConstA2.jpg| thumb | left | 510px | 5
File:C Ell_FR_ConstA3.jpg| thumb | left | 510px | 10
</gallery>
}}
{{KV|Ell_FR_ConstB|intn=Ell_FR_ConstB|float|This is fancy Godrays disk distortion.}}
{{Note|For fancy Godrays only.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=500px>
File:C Ell_FR_ConstB1.jpg| thumb | left | 510px | 0.1
File:C Ell_FR_ConstB2.jpg| thumb | left | 510px | 1
File:C Ell_FR_ConstB3.jpg| thumb | left | 510px | 10
</gallery>
}}
{{KV|EEll_SR_ConstA|intn=EEll_SR_ConstA|float|This is fancy Godrays disk hole size.}}
{{Note|For fancy Godrays only.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=500px>
File:Ell_SR_ConstA1.jpg| thumb | left | 510px | 0.9
File:Ell_SR_ConstA2.jpg| thumb | left | 510px | 5
File:Ell_SR_ConstA3.jpg| thumb | left | 510px | 20
</gallery>
}}
{{KV|EEll_SR_ConstB|intn=EEll_SR_ConstB|float|This is fancy Godrays disk hole distortion.}}
{{Note|For fancy Godrays only.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=500px>
File:EEll_SR_ConstB1.jpg| thumb | left | 510px | 0.1
File:EEll_SR_ConstB2.jpg| thumb | left | 510px | 5
File:EEll_SR_ConstB3.jpg| thumb | left | 510px | 20
</gallery>
}}
{{KV|Ell_RRF_ConstA|intn=Ell_RRF_ConstA|float|This is fancy Godrays inner size.}}
{{Note|For fancy Godrays only.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=500px>
File:C Ell_RRF_ConstA1.jpg| thumb | left | 510px | 0.9
File:C Ell_RRF_ConstA2.jpg| thumb | left | 510px | 1.5
File:C Ell RRF ConstA3.jpg| thumb | left | 510px | 42
</gallery>
}}
{{KV|Ell_RRF_ConstB|intn=Ell_RRF_ConstB|float|This is fancy Godrays inner distortion.}}
{{Note|For fancy Godrays only.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=500px>
File:C Ell RRF ConstB1.jpg| thumb | left | 510px | 0.1
File:C Ell RRF ConstB2.jpg| thumb | left | 510px | 0.7
File:C Ell RRF ConstB3.jpg| thumb | left | 510px | 5.0
</gallery>
}}
{{KV|RotSpeed|intn=RotSpeed|float|}}
Determines rotating speed of fancy rays, 0 - don't rotate, negative number - will rotate to left.
{{Note|For fancy Godrays only.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=710px>
File:cRS1.gif| thumb | left | 510px | RotSpeed - 3.14
File:cRS2.gif| thumb | left | 510px | RotSpeed - 0
File:cRS3.gif| thumb | left | 510px | RotSpeed - 40
</gallery>
}}
{{KV|RotPatternFreq|intn=RotPatternFreq|float|}}
Determines count of fancy rays in frame, with negative number will deny RotSpeed +/- effect.
{{Note|For fancy Godrays only.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=710px>
File:cRPF1.gif| thumb | left | 510px | RotPatternFreq - -40
File:cRPF2.gif| thumb | left | 510px | RotPatternFreq - -4
</gallery>
}}
{{KV|RenderInWorldSpace|intn=m_bEnableWorldSpace|choices|Disables disks if this enabled.|
*0: Disabled
*1: Enabled}}
{{KV|m_fAlphaDiskInner|intn=m_fAlphaDiskInner|float|}}
{{KV|m_fAlphaDiskOuter|intn=m_fAlphaDiskOuter|float| }}
{{KV|UseToneMapRays|intn=m_bUseToneMapRays|choices|
*0: Enabled
*1: Disabled}}
{{KV|UseToneMapDisk|intn=m_bUseToneMapDisk |choices|
*0: Enabled
*1: Disabled}}
{{KV|ShadowPass_Brush|intn=m_bSRO_Brush|choices|Do we want to Render Brushes in shadow passes for this light?
*0: YES
*1: NO}}
{{KV|ShadowPass_StaticProp|intn=m_bSRO_StaticProp|choices|Do we want to Render StaticProps in shadow passes for this light?
*0: YES
*1: NO}}
{{KV|ShadowPass_DynProp|intn=m_bSRO_DynProp|choices|Do we want to Render Dynamic Props in shadow passes for this light?
*0: YES
*1: NO}}
{{KV|ShadowPass_AlphaTest|intn=m_bSRO__Trans|choices|Do we want to Render AlphaTested Objects in shadow passes for this light?
*0: YES
*1: NO}}
{{KV|bUseOldFallOff|intn=bUseOldFallOff|choices|Enable old falloff similar to [[light]]/[[light_spot]].
*0: No
*1: Yes
|nofgd=1|deprecated=1}}
{{KV|falloffConstant|intn=falloffConstant|integer|Constant (work only if bUseOldFallOff enabled).|nofgd=1|deprecated=1}}
{{KV|falloffLinear|intn=falloffLinear|integer|Linear (work only if bUseOldFallOff enabled).|nofgd=1|deprecated=1}}
{{KV|falloffQuadratic|intn=falloffQuadratic|integer|Quadratic (work only if bUseOldFallOff enabled).|nofgd=1|deprecated=1}}


==Inputs==
==Inputs==
{{IO|SetColorLight|param=color255|Change Light's Color value. Doesn't affect the godrays.}}
{{I|SetColorLight|param=color255|Change light's color value. Doesn't affect the godrays.}}
{{IO|SetIntensityForLight|param=float|Change Light's intensity value. Doesn't affect the godrays.}}
{{I|SetIntensityForLight|param=float|Change light's intensity value. Doesn't affect the godrays.}}
{{IO|TurnOnGodRays|param=void|Turn the Godrays on.}}
{{I|TurnOnGodRays|param=void|Turn the godrays on.}}
{{IO|TurnOffGodRays|param=void|Turn the Godrays off.}}
{{I|TurnOffGodRays|param=void|Turn the godrays off.}}
{{IO|TurnOn|param=void|Turn the light on.}}
{{I|TurnOn|param=void|Turn the light on.}}
{{IO|TurnOff|param=void|Turn the light off.}}
{{I|TurnOff|param=void|Turn the light off.}}
{{IO|Toggle|param=void|Toggle the light's current state.}}
{{I|Toggle|param=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, <code>High</code> (for lights with <code>1024</code> value for <code>ShadowMap LOD</code> property), <code>Medium</code> (for lights with <code>512</code> value for <code>ShadowMap LOD</code> property) and <code>Low</code> (for lights with <code>256</code> value for <code>ShadowMap LOD</code> property).
 
In <code>High</code> and <code>Medium</code> you can have 48 separate shadow maps, for <code>Low</code> 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 <code>ShadowMap LOD</code> 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 <code>ShadowMap LOD</code> 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 <code>ShadowMap LOD</code> 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 <code>Kill</code> input. So, you can place triggers which will <code>Kill</code> lights that player can't see and spawn new lights via {{ent|point_template}} (uncheck the second flag for {{ent|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.
<gallery mode=packed heights=410px>
File:manyshadowslotsbugg.jpg| frame |The bug example.
</gallery>
 
It looks like you can workaround it if you will switch <code>ShadowMap LOD</code> 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]].
<gallery mode=packed heights=410px>
File:staticlight_0.jpg| frame |Areaportal is open.
File:staticlight_1.jpg| frame |Areaportal is closed.
</gallery>
===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.
<gallery mode=packed heights=410px>
File:stationlight_0.jpg| frame |Areaportal is open.
File:stationlight_1.jpg| frame |Areaportal is closed.
</gallery>
 
In some cases, this can be noticeable if dynamic model creates a large shadow.
<gallery mode=packed heights=410px>
File:Theboxshadow_0.jpg| frame |Areaportal hides the box, note that there is no shadow.
</gallery>
<gallery mode=packed heights=410px>
File:Theboxshadow_1.jpg| frame |Areaportal shows the box, now there is a shadow of the box.
</gallery>
<gallery mode=packed heights=410px>
File:thewireboxshadow_0.jpg| frame |Areaportal hides the box.
</gallery>
<gallery mode=packed heights=410px>
File:thewireboxshadow_1.jpg| frame |Areaportal shows the box.
</gallery>
 
===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.
<gallery mode=packed heights=410px>
File:dynlight_0.jpg| frame |Areaportal is open.
File:dynlight_1.jpg| frame |Areaportal is closed.
</gallery>
==Bugs/Limitations==
See [[/Bugs and limitations]]
 
== See also ==
* [[New Lights Editor]]
* {{ent|newLight_Spot}}
* {{ent|newLight_Dir}}
* {{ent|NewLights_settings}}
* {{ent|godrays_settings}}
* {{ent|env_cascade_light}}
* [[New_Specular|New Specular]]
* [[newxog_volume]]
* [[Lighting]]
* [[Adding Light]]
* [[Intermediate Lighting]]
* [[Advanced Lighting]]
* [[Effect flags]] (dynamic light effects)
* [[Tool textures]] (for Block light)
* [https://chetanjags.wordpress.com/2023/07/18/blackmesa-xenengine-part-4-lighting-shadows/ BlackMesa XenEngine: Part 4 – Lighting & Shadows] (page from Black Mesa developer about new lights)
* [https://chetanjags.wordpress.com/2023/07/11/blackmesa-xenengine-part2-how-a-frame-is-rendered/ BlackMesa XenEngine: Part2 – How a Frame is Rendered] (page from Black Mesa developer about how a frame rendered, include Godrays.)
* [https://chetanjags.wordpress.com/2022/06/01/blackmesa-xenengine-part1-a-heavily-modified-source-engine/ BlackMesa XenEngine: Part1 – Heavily Modified Source Engine] (page from Black Mesa developer about Black Mesa engine, better known as [[Xengine]])
{{todo|Investigate and document some keyvalues and functions. Clean up english. Add more issues if you'll find.}}

Latest revision as of 07:57, 5 November 2025

Edit Tabs
NewLight Point.png

newLight_Point is a point entity available in Black Mesa Black Mesa. It creates an invisible deferred light source that shines in all directions, includes godrays and lightcookies.

C++ Class hierarchy
CNewLightPoint
CBaseEntity
NewLight_Point in End Game chapter (used for the portal).
Note.pngNote:You can have only 512 point light entities placed in the map editor.

Keyvalues

Name (targetname) <string>
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also: Generic Keyvalues, Inputs and Outputs available to all entities
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.
Note.pngNote:There is almost no differences if you're using point light with no texture. Things changes if you're using textures.


Use old Falloff ? (bUseOldFallOff) <choices> !FGD Obsolete
Deprecated.
Sets old falloff state, disabled or enabled. This feature is disabled in the code, so you can't use old falloff (although it is still used for the flashlight).
  • 0: Disabled
  • 1: Enabled


Light Color (LightColor) <color255>
The RGB color of the light. Colors must be between 0 and 255.
Light Intensity (Intensity) <float>
Intensity/brightness of the light. It's RGB * intensity.
Note.pngNote:With 0 it will make the light disabled, including the effects. Doesn't affect shadows.
Note.pngNote:The default 8000 value is equivalent to default 200 brightness value for static VRAD lights. If needed to repeat static light brightness, multiple the brightness value by 40; if vice versa, divide by 40.
Range (Range) <float>
Range of the light, or how far the light source can illuminate. Measured in Hammer Units.
Warning.pngWarning:This is one of the parameters that affects performance in the game. Smaller values ​​allow you to process less geometry and save performance.
Icon-Important.pngImportant:Range is limited, the limit depends on intensity value. Do not use values ​​bigger than the intensity value allows.
Examples
Enabled (Enabled) <choices>
Sets light state on spawn, enabled or disabled.
  • 0: Enabled
  • 1: Disabled
Appearance (style) <integer choices>
Appearance presets.
Lightstyle presets (epilepsy warning)
Literal Value Description Sequence Preview
0 Normal m Lightstyle 0.png
10 Fluorescent flicker mmamammmmammamamaaamammma Lightstyle 10.gif
2 Slow, strong pulse abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba Lightstyle 2.gif
11 Slow pulse, noblack abcdefghijklmnopqrrqponmlkjihgfedcba Lightstyle 11.gif
5 Gentle pulse jklmnopqrstuvwxyzyxwvutsrqponmlkj Lightstyle 5.gif
1 Flicker A mmnmmommommnonmmonqnmmo Lightstyle 1.gif
6 Flicker B nmonqnmomnmomomno Lightstyle 6.gif
3 Candle A mmmmmaaaaammmmmaaaaaabcdefgabcdefg Lightstyle 3.gif
7 Candle B mmmaaaabcdefgmmmmaaaammmaamm Lightstyle 7.gif
8 Candle C mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa Lightstyle 8.gif
4 Fast strobe mamamamamama Lightstyle 4.gif
9 Slow strobe aaaaaaaazzzzzzzz Lightstyle 9.gif
12 Underwater light mutation mmnnmmnnnmmnn Lightstyle 12.gif
Tip.pngTip:Use new lights instead for lights with custom appearance, because static lightmapped lights reduces performance with this feature (especially near displacements).
Note.pngNote:Custom light styles are not possible.
Light Ambient Color (LightColorAmbient) <color255>
The RGB color of the shadows. Colors must be between 0 and 255.
Examples
SpecularMultiplier (SpecMultiplier) <float>
Specular multiplier. Sets intensity of new specular shader from this light source. It's RGB * Intensity * SpecularMultiplier. 0 means disabled.
Examples


falloffConstant (falloffConstant) <integer> !FGD Obsolete
Deprecated.
Constant value (can work only if old falloff is enabled).
falloffLinear (falloffLinear) <integer> !FGD Obsolete
Deprecated.
Linear value (can work only if old falloff is enabled).
falloffQuadratic (falloffQuadratic) <integer> !FGD Obsolete
Deprecated.
Quadratic value (can work only if old falloff is enabled).


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.


ShadowFaceX (ShadowFaceX) <choices>
Sets shadow state (enabled or disabled) for X face.
  • 0: Enabled
  • 1: Disabled
ShadowFaceX_Minus (ShadowFaceX_Minus) <choices>
Sets shadow state (enabled or disabled) for -X face.
  • 0: Enabled
  • 1: Disabled
ShadowFaceY (ShadowFaceY) <choices>
Sets shadow state (enabled or disabled) for Y face.
  • 0: Enabled
  • 1: Disabled
ShadowFaceY_Minus (ShadowFaceY_Minus) <choices>
Sets shadow state (enabled or disabled) for -Y face.
  • 0: Enabled
  • 1: Disabled
ShadowFaceZ (ShadowFaceZ) <choices>
Sets shadow state (enabled or disabled) for Z face.
  • 0: Enabled
  • 1: Disabled
ShadowFaceZ_Minus (ShadowFaceZ_Minus) <choices>
Sets shadow state (enabled or disabled) for -Z face.
  • 0: Enabled
  • 1: Disabled


DepthBias (DepthBias) <float>
DepthBias is offset added to depth values in shadowmaps.
Examples


SlopeDepthBias (SlopeDepthBias) <float>
Slope Depth Bias used for surfaces having aliasing due to steep angles with light.
Examples
NormalBias (NormalBias) <float>
While rendering objects into shadowmaps, each vertex will be moved along -ve Normal direction, giving it an appearance of shrinking while rendering to shadowmaps. This property determines the amount of Units to be moved. Helps with shadow aliasing.
Examples
Note.pngNote:You will not see any changes if your material doesn't not provide bumpmap.
Icon-Important.pngImportant:Increasing this value will make shadows between different surfaces less accurate, greate example is third picture in examples, there you can see "two" shadows from railing.
Icon-Bug.pngBug:Numbers lower than 0.8 can cause huge graphics issues. Example.
Tip.pngTip:Increase this value if you are getting aliasing issues like this.


Enable Texture Light (bTexLight) <choices>
Sets lightcookie (texture lights) state, enabled or disabled.
  • 0: Disabled
  • 1: Enabled
Examples
Warning.pngWarning:This is one of the most expensive features, use wisely.
Texture name for TexLight (texName) <string>
Determines which texture will use the light source. Lightcookies are using .vtf (not .vmt) texture from files (just like env_projectedtexture).
.Enable Prop Only Mode (bNegLight) <choices> Obsolete
Deprecated.
Sets prop only mode, which supposed to disable shadows for world geometry. Doesn't work. The same effect can be achieved with shadow pass settings.
  • 0: Disabled
  • 1: Enabled
LightnGodRayMode (LightnGodRayMode) <choices>
This determines what effects will be available to use for the light source. Keep in mind that the default choice is Light.
  • 0: Light - light only.
  • 1: Godrays - godrays only.
  • 2: Both Light and GodRays - both light and godrays.
Icon-Bug.pngBug:Even if godrays is turned off, the game will still think that the godrays is used if choice is Godrays or Both Light and GodRays.


EnableGodRays (EnableGodRays) <choices>
Sets godrays state on spawn, enabled or disabled.
  • 0: Disabled
  • 1: Enabled
Warning.pngWarning:You can have only 40 point lights with godrays enabled simultaneously, otherwise the game will crash with this error message.
The error
Density (Density) <float>
Density controls the length of rays/volumetric shadows. 1.0 should work in 99% cases. Good values are 0.5-1.5.
Examples
Weight (Weight) <float>
Weight controls the intensity of volumetric shadow. Blocking of rays by geometry. Good values are 0.1-10.
Examples
Decay (Decay) <float> Obsolete
Deprecated.
Decay controls luminance fall off per sample. Value here doesn't work.
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.0 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
Note.pngNote:Godrays doesn't look smooth if used big value here. The same for Exposure.
Example
ColorInner (ColorInner) <color255 + int>
The RGB color and brightness of the inner circle. Colors and brightness must be between 0 and 255.
Icon-Bug.pngBug:This color value doesn't work properly with newLight_Point if you are using Normal godrays type. This entity takes only red value. Works fine with Fancy type.
Examples
Note.pngNote:Rays is disabled on this picture (the colors are partially blending).
ColorRays (ColorRays) <color255 + int>
The RGB color and brightness of the rays. Colors and brightness must be between 0 and 255.
Examples
ColorOuter (ColorOuter) <color255 + int>
The RGB color and brightness of the outer circle. Colors and brightness must be between 0 and 255.
Icon-Bug.pngBug:This color value doesn't work properly with newLight_Point if you are using Normal godrays type. This entity takes only red value. Works fine with Fancy type.
Examples
Note.pngNote:Rays is disabled on this picture (the colors are partially blending).
Note.pngNote:You can't use black colors for ColorOuter, ColorInner and ColorRays.
DiskRadius (DiskRadius) <float>
Radius of disk/circle of sun/point light in texturespace. 1.0 will be full screen, 0.5 is half screen, etc. 0 means don't render.
Examples
DiskInnerSizePercent (DiskInnerSizePercent) <float>
Disk inner circle radius is DiskRadius * DiskInnerSizePercent. 0 means don't render.
Examples
Note.pngNote:Rays is disabled on this picture (for clarity).


GodRaysType (GodRaysType) <choices>
Sets godrays type, normal or fancy.
  • 0: Normal
  • 1: Fancy
Examples
RenderInWorldSpace (m_bEnableWorldSpace) <choices>
Disables disks if this enabled.
  • 0: Disabled
  • 1: Enabled
Confirm:Does it affect anything else ?
Ell_FR_ConstA (Ell_FR_ConstA) <float>
This is fancy godrays disk size.
Examples
Ell_FR_ConstB (Ell_FR_ConstB) <float>
This is fancy godrays disk distortion.
Examples
EEll_SR_ConstA (EEll_SR_ConstA) <float>
This is fancy godrays disk hole size.
Examples
EEll_SR_ConstB (EEll_SR_ConstB) <float>
This is fancy godrays disk hole distortion.
Examples
Ell_RRF_ConstA (Ell_RRF_ConstA) <float>
This is fancy godrays inner size.
Examples


Ell_RRF_ConstB (Ell_RRF_ConstB) <float>
This is fancy godrays inner distortion.
Examples
RotSpeed (RotSpeed) <float>
Rotating speed of fancy godrays, 0 means don't rotate, with negative number it will rotate to left. Examples (link to a video that showcase different values).
RotPatternFreq (RotPatternFreq) <integer>
Count of fancy godrays, with negative number will deny RotSpeed +/- effect. Examples (link to a video that showcase different values).
m_fAlphaDiskInner (m_fAlphaDiskInner) <float> Obsolete
Deprecated.
Alpha inner value for disk. Doesn't work.
m_fAlphaDiskOuter (m_fAlphaDiskOuter) <float> Obsolete
Deprecated.
Alpha outer value for disk. Doesn't work.
UseToneMapRays (m_bUseToneMapRays) <choices> Obsolete
Deprecated.
Sets tonemap state for rays, enabled or disabled. Doesn't work.
  • 0: Enabled
  • 1: Disabled
UseToneMapDisk (m_bUseToneMapDisk) <choices> Obsolete
Deprecated.
Sets tonemap state for disk, enabled or disabled. Doesn't work.
  • 0: Enabled
  • 1: Disabled


ShadowPass_Brush (m_bSRO_Brush) <choices>
Do we want to render world geometry in shadow passes for this light ? Doesn't affect bmodels.
  • 0: YES
  • 1: NO
ShadowPass_StaticProp (m_bSRO_StaticProp) <choices>
Do we want to render prop_static in shadow passes for this light ? This also affect bmodels.
  • 0: YES
  • 1: NO
ShadowPass_DynProp (m_bSRO_DynProp) <choices>
Do we want to render dynamic models in shadow passes for this light ?
  • 0: YES
  • 1: NO
ShadowPass_AlphaTest (m_bSRO__Trans) <choices>
Do we want to render models with transparency materials in shadow passes for this light ? Objects with transparency can cast shadows if your model includes a material without transparency.
  • 0: YES
  • 1: NO

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.