NewLight Point: Difference between revisions
MyGamepedia (talk | contribs) No edit summary |
MyGamepedia (talk | contribs) (Added some issues, I'll add some more.) |
||
Line 65: | Line 65: | ||
[[File:LOD1024.png | thumb | left | 510px | 1024]] | [[File:LOD1024.png | thumb | left | 510px | 1024]] | ||
}} | }} | ||
{{Important|In one level you can have only 8 light spot/points with shadows which use one and same shadow lod, even if you don't use all them simultaneously. If this limit is not respected - 9-th and next lights will not cast shadows. However - you can rise up this limit with {{ent|point_template}}, just kill past lights with kill input and spawn new when you need it. Also use different shadow lods.}} | |||
{{KV|ShadowFaceX|intn=ShadowFaceX|choices|Shadow Enabled for this Face ? | {{KV|ShadowFaceX|intn=ShadowFaceX|choices|Shadow Enabled for this Face ? | ||
Determines whether the given side lighting will display shadows. | Determines whether the given side lighting will display shadows. | ||
Line 140: | Line 141: | ||
}} | }} | ||
{{KV|EnableGodRays|intn=EnableGodRays|choices|Enable GodRays. | {{KV|EnableGodRays|intn=EnableGodRays|choices|Enable GodRays. | ||
Determines whether godrays are enabled or not. | 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.}} | |||
{| border=0 cellspacing=0 cellpadding=0 | |||
| [[File:RaysLimit.png | thumb | left | 510px | If you'll try to enable forty-first light point with enabled Godrays.]] | |||
|} | |||
{{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|title=Examples| | ||
Line 283: | Line 288: | ||
{{IO|Toggle|Toggle the light's current state.}} | {{IO|Toggle|Toggle the light's current state.}} | ||
{{I BaseEntity}} | {{I BaseEntity}} | ||
==Issues== | |||
====Deferred lighting incorrect work with [[$translucent]]==== | |||
Deferred lighting all time rendering through walls with [[material]] [[shader]] parameter [[$translucent]]. This happen because of game can't tell the depth of scene because of the transparency, what you are see in the picture is just the lighting layer applied to the color of transparency texture. | |||
{| border=0 cellspacing=0 cellpadding=0 | |||
| [[File: BugHah.png | thumb | left | 710px | No [[$translucent]]. Behind the wall placed lighting and some models with small room.]] | |||
| [[File: BugDamn.png | thumb | right | 710px | With [[$translucent]]. Now player see everything, but only what lighted.]] | |||
|} | |||
{| border=0 cellspacing=0 cellpadding=0 | |||
| [[File: GargHah1.png | thumb | left | 710px | Scene behide window. Looks like the gargantua has lost its texture and turned white.]] | |||
| [[File: GargDamn1.png | thumb | right | 710px | Scene out window. This is what should see player.]] | |||
|} | |||
This problem also applies to brushes which not have [[$translucent]], but which parented to brushes that have this parameter. Similar will happen if brush with [[$translucent]] is part of your brush entity. | |||
{| border=0 cellspacing=0 cellpadding=0 | |||
| [[File: BSFL1.png | thumb | left | 710px | This sticker is brush parented to the glass. Flashlight off.]] | |||
| [[File: BSFL2.png | thumb | right | 710px | This sticker is brush parented to the glass. Flashlight on.]] | |||
|} | |||
Same will happen if you use [[overlays]]/[[decals]] on brushes with [[$translucent]]. | |||
{| border=0 cellspacing=0 cellpadding=0 | |||
| [[File: MS1.png | thumb | left | 710px | Metal speaker is overlay that use [[$alphatest]], but lighting of the health charger visible anyway, because overlay pasted on the transparency window.]] | |||
|} | |||
This issues not happen if replace [[LightmappedGeneric]] to [[ShatteredGlass]] shader. [[ShatteredGlass]] give similar to [[LightmappedGeneric]] results, so, you can use it for glass or transparency surfaces when it's needed. | |||
{| border=0 cellspacing=0 cellpadding=0 | |||
| [[File: HahF1.png | thumb | left | 710px | [[LightmappedGeneric]].]] | |||
| [[File: HahF2.png | thumb | right | 710px | [[ShatteredGlass]].]] | |||
|} | |||
In some cases use [[$alphatest]] if it'll give similar to [[$translucent]] resualts, with this your surface also will cast dynamic shadows. | |||
{| border=0 cellspacing=0 cellpadding=0 | |||
| [[File: AF1.png | thumb | left | 710px | [[$translucent]].]] | |||
| [[File: AF2.png | thumb | right | 710px | [[$alphatest]].]] | |||
|} | |||
====Godrays incorrect work with [[$translucent]]==== | |||
Godrays (also disk) all time fully rendering through textures with [[material]] [[shader]] parameter [[$translucent]], because of this you will see unexpected results like in the picture. Disable Godrays when you need or use [[$alphatest]] if it'll give resualts similar to [[$translucent]]. You also can try use some other tricks to escape this problem. | |||
{| border=0 cellspacing=0 cellpadding=0 | |||
| [[File: GodraysTransBug.png | thumb | left | 710px | Bug example in bm_c1a3c.]] | |||
| [[File: GodraysTransBugSide.png | thumb | right | 710px | Sign from other side.]] | |||
|} | |||
==Outputs== | ==Outputs== |
Revision as of 09:47, 13 October 2023

newLight_Point
is an e0 available in Black Mesa. It is one of the many new lighting entities available. Black Mesa incorporates a new lighting system which utilizes
Deferred lighting to create a hyper realistic interpretation of light.
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.

- Enabled (Enabled) <choices>
- Enable/Disable this Entity.
Determines if the light is off at level start.
- 0: Enabled
- 1: Disabled
- Appearance (FlareStyle) <choices>
- Template:Light appearances
- 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.
- Light Intensity (Intensity) <float>
- RGB * Intensity.
Brightness of the light.
- SpecularMultiplier (SpecMultiplier) <float>
- 0 to 1 RGB * Intensity * SpecularMultiplier.
Brightness of the specular shader from this light source.
- Range (Range) <float>
- Range.
How far the light source illuminates. Measured in Hammer Units.
- 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.
Important:Shadows for dynamic props update, but not dynamic geometry!
- 2: Dynamic - 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, and if your scene have moving geometry.
|
- 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
- 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

- 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.
- SlopeDepthBias (SlopeDepthBias) <float>
- Slope Depth Bias - For surfaces having aliasing due to steep angles with light.
- 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.

File:NormalBiasBug.gif NormalBias - 0 |
- 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.
- 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. A great example is the batteries that use lights/lightcookie_battery.vtf.
- 0: Disabled
- 1: Enabled
|

- Texture name for TexLight (texName) <string>
- Texture name for Texture shadows.
Determines which texture will use light source. It use .vtf files, not .vmt.
- .Enable Prop Only Mode (bNegLight) <choices>
- Enable Prop Only Mode.
Determines whether light source will only illuminate models.
- 0: Disabled
- 1: Enabled
- LightnGodRayMode (LightnGodRayMode) <choices>
- 0:Light 1:Godrays 2:Both Light and GodRays.
Determines whether light source will cast light, godrays, or both.
- 0: Light
- 1: Godrays
- 2: Both Light and GodRays
- EnableGodRays (EnableGodRays) <choices>
- Enable GodRays.
Determines whether godrays are enabled or not at map start.
- 0: Disabled
- 1: Enabled

- 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.
- Weight (Weight) <float>
- Weight Controls the intensity of volumetric shadow. Blocking of rays by geometry. Good values to start from: 0.1 - 10.0.
- Decay (Decay) <float>
- Decay NOT being used.
- 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.
- 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.
- DiskRadius (DiskRadius) <float>
- Radius of Disk/circle of sun in texturespace. 1.0 will be full screen 0.5 is half screen etc.

- ColorInner (ColorInner) <color255>
- This is the color of the inner circle.

- ColorRays (ColorRays) <color255>
- This is the color of the rays.

- GodRaysType (GodRaysType) <choices>
- GodRaysType.
- 0: Normal
- 1: Fancy
File:GodRaysTypeNormal.gif Normal |
- DiskInnerSizePercent (DiskInnerSizePercent) <float>
- Used only in Fancy Gaphics Mode. Disk inner circle radius = DiskRadius * DiskInnerSizePercent.

- ColorOuter (ColorOuter) <color255>
- Used only in Fancy Mode. This is the color of the outer circle.

- Ell_FR_ConstA (Ell_FR_ConstA) <float>
- Ell_FR_ConstB (Ell_FR_ConstB) <float>
- EEll_SR_ConstA (EEll_SR_ConstA) <float>
- EEll_SR_ConstB (EEll_SR_ConstB) <float>
- Ell_RRF_ConstA (Ell_RRF_ConstA) <float>
- Ell_RRF_ConstB (Ell_RRF_ConstB) <float>
- RotSpeed (RotSpeed) <float>
Determines rotating speed of fancy rays, 0 - don't rotate, negative number - will rotate to left.
File:RS1.gif RotSpeed - 3.14 File:RS3.gif RotSpeed - 40 |
- RotPatternFreq (RotPatternFreq) <float>
Determines count of fancy rays in frame, with negative number will deny RotSpeed +/- effect.
File:RPF1.gif RotPatternFreq - -40 File:RPF2.gif RotPatternFreq - -4 |
- RenderInWorldSpace (m_bEnableWorldSpace) <choices>
- Disables disks if this enabled.
- 0: Disabled
- 1: 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
Inputs
- SetColorLight
- <color255>. Change Light's Color value. Doesnt effect the godrays
- SetIntensityForLight
- <float>. Change Light's intensity value. Doesnt effect the godrays
- TurnOnGodRays
- Turn the Godrays on.
- TurnOffGodRays
- Turn the Godrays off.
- TurnOn
- Turn the light on.
- TurnOff
- Turn the light off.
- Toggle
- Toggle the light's current state.
Issues
Deferred lighting incorrect work with $translucent
Deferred lighting all time rendering through walls with material shader parameter $translucent. This happen because of game can't tell the depth of scene because of the transparency, what you are see in the picture is just the lighting layer applied to the color of transparency texture.
![]() No $translucent. Behind the wall placed lighting and some models with small room. |
![]() With $translucent. Now player see everything, but only what lighted. |
This problem also applies to brushes which not have $translucent, but which parented to brushes that have this parameter. Similar will happen if brush with $translucent is part of your brush entity.
Same will happen if you use overlays/decals on brushes with $translucent.
![]() Metal speaker is overlay that use $alphatest, but lighting of the health charger visible anyway, because overlay pasted on the transparency window. |
This issues not happen if replace LightmappedGeneric to ShatteredGlass shader. ShatteredGlass give similar to LightmappedGeneric results, so, you can use it for glass or transparency surfaces when it's needed.
In some cases use $alphatest if it'll give similar to $translucent resualts, with this your surface also will cast dynamic shadows.
Godrays incorrect work with $translucent
Godrays (also disk) all time fully rendering through textures with material shader parameter $translucent, because of this you will see unexpected results like in the picture. Disable Godrays when you need or use $alphatest if it'll give resualts similar to $translucent. You also can try use some other tricks to escape this problem.
Outputs
See Also
- light_spot
- env_lensflare
- newLight_Dir
- Lighting
- Adding Light
- Intermediate Lighting
- Advanced Lighting
- Effect flags (dynamic light effects)
- Tool textures (for Block light)
- BlackMesa XenEngine: Part 4 – Lighting & Shadows (page from Black Mesa developer about new lights)