General information about Black Mesa new lights/Bugs and limitations: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
 
(64 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{todo|Rework this page.}}
{{TabsBar|main=Black Mesa Deferred Lights}}
<!-- WIP TOC HERE:
All the bugs and limitations divided into the following categories:
<center>{{Expand|title=Table of Contents|1=<span style=color:white>'''Table of Contents'''</span><br>
* Lighting issues - mainly lighting shader issues.
;[[#Deferred_lighting_incorrect_work_with_.24translucent|Deferred lighting incorrect work with $translucecnt]]
* Shadow issues - issues related to shadowmaps.
}}</center>
* Godrays issues - issues related to godrays.
-->
* NewLight_Point issues - bugs and limitations only for {{ent|newLight_Point}} entity.
* NewLight_Spot issues - bugs and limitations only for {{ent|newLight_Spot}} entity.
* NewLights_settings issues - bugs and limitations only for {{ent|newLights_settings}} entity.
{{note|Some entity specific bugs are in entity page.}}


====Deferred lighting have issues with transparency====
===Lighting issues===
Deferred lighting is incompatible with transparency. In some cases, it shows one of the lighting layers applied to the color of the transparent texture.
====Transparency issues with deferred lighting====
 
None of the available shaders that support transparency can render shadows and lighting on on objects if transparency is enabled. Usually other games and engines use deferred shading for opaque objects, then switch to forward rendering for transparent objects, but {{bms|1}} rendering is not doing so.
This bug is currently available by default for [[VertexLitGeneric]] and [[Lightmapped_4WayBlend]], if they are using [[$translucent]] material parameter.
<br>
<gallery mode=packed heights=250px>
<gallery mode=packed heights=250px>
File:C BugHah.jpg| frame |No [[$translucent]]. Behind the wall placed lighting and some models with small room.
File:LDSOTM_.jpg| frame |Example from {{code|bm_c2a5g}}, expected that the shadows from the ropes and the plastic road cone on the window will be rendered, but this doesn't happen.
File:C BugDamn.jpg| frame |With [[$translucent]]. Now player see everything, but only what lighted.
File:LDSOTM_p2ce.jpg| frame |The same scene, but with {{csgo|4}} cascade lighting which is not using gbuffer.
</gallery>
</gallery>
<br>
 
Deferred lighting is also incompatible with transparency for [[VertexLitGeneric]] and [[Lightmapped_4WayBlend]], it shows one of the lighting layers applied to the color of the transparent texture.
<gallery mode=packed heights=250px>
<gallery mode=packed heights=250px>
File:firethinghaha.jpg| frame |An example with model.
File:C BugHah.jpg| frame |No [[$translucent]]. Behind the wall placed lighting and some models with in a small room.
File:C BugDamn.jpg| frame |With [[$translucent]]. Now the player can see everything, but only what the light covers.
</gallery>
</gallery>
The same happen if used [[$decal]] material parameter.
 
<br>
This issue also applies to brushes with no transparency, but which is a part of a [[func]] entity with a transparent brush (the only exception is {{ent|func_detail}}). This happen even if transparency used for shader that doesn't shows one of the lighting layers. Doesn't work only if brush has alpha texture.
<gallery mode=packed heights=250px>
File:GbufferDecalBrush.jpg| frame |An example.
</gallery>
This problem also applies to brushes which don't use [[$translucent]], but which is a part of a [[func]] entity with a transparency brush (the only exception is {{ent|func_detail}}). This happen even if transparency used for shader that doesn't shows one of the lighting layers.
<br>
<gallery mode=packed heights=250px>
<gallery mode=packed heights=250px>
File:C BSFL1.jpg| frame |This sticker is brush, that is part of [[func_brush]], which uses glass as part of itself. Flashlight off.
File:C BSFL1.jpg| frame |This sticker is brush, that is part of [[func_brush]], which uses glass as part of itself. Flashlight off.
File:C BSFL2.jpg| frame |This sticker is brush, that is part of [[func_brush]], which uses glass as part of itself. Flashlight on.
File:C BSFL2.jpg| frame |This sticker is brush, that is part of [[func_brush]], which uses glass as part of itself. Flashlight on.
</gallery>
</gallery>
If a func entity or model uses [[render mode]] {{code|Glow}} (3) or {{code|World Space Glow}} (9) - they will show one of the lighting layers. This means that you can't use this renders to make your brush transparent, you will have to create a separate texture.
 
<br>
The same will happen if used [[$decal]] material parameter.
<gallery mode=packed heights=350px>
File:GbufferDecalBrush.jpg| frame |Example from {{code|bm_c1a1c}}.
</gallery>
 
Similar issue will happen if [[overlay]]/[[decal]] is applied on a geometry with transparency.
<gallery mode=packed heights=350px>
File:C MS1.jpg| frame |The metal speaker is overlay that use [[$alphatest]], but lighting from the [[Item healthcharger (Black Mesa)|health charger]] is still visible, because the overlay is applied on the transparent window.
</gallery>
 
If a func entity or model uses [[render mode]] {{code|Glow}} (3) or {{code|World Space Glow}} (9) - they will show one of the lighting layers as well. This means that you can't use these renders to make your brush transparent, you will need a separate texture with alpha texture and material with [[$translucent]].  
<gallery mode=packed heights=250px>
<gallery mode=packed heights=250px>
File:WSGAGFI.jpg| frame |Clear example. The box with fire extinguisher and brush uses the render modes.
File:WSGAGFI.jpg| frame |Example with multiple props and brush entity, they are using {{code|Glow}} render mode.
</gallery>
</gallery>
Other render modes will have similar effect, but only for brushes.
 
<br>
Using other render modes (except {{code|Normal}} (0) and {{code|Don't Render}} (10)) on a brush entity will cause many rendering issues. Example in this short [https://youtu.be/p_I336XxbVE video].
 
The [[VertexLitGeneric#Cloak|cloak]] material shader parameter will also cause this issue, even if object is not transparent at the moment.
<gallery mode=packed heights=250px>
<gallery mode=packed heights=250px>
File:RenderModesBuggyMine.gif| frame |Clear example.
File:C_ASSASINDF.jpg| frame |Example in {{code|bm_c2a3c}}. The [[Npc human assassin|female assassin]] is not transparent, but the lighting layer is still showing through.
</gallery>
</gallery>
Similar issue happen with [[overlays]]/[[decals]] on brushes with [[$translucent]].
 
<br>
There is not much workarounds. In some cases, $alphatest can be used, because it can give similar to $translucent result, it will also allow object to create dynamic shadows.
<gallery mode=packed heights=350px>
File:C MS1.jpg| frame |Metal speaker is overlay that use [[$alphatest]], but lighting of the health charger visible anyway, because overlay pasted on the transparency window.
</gallery>
In some cases, use [[$alphatest]], if it'll give similar to [[$translucent]] resualts, with this your surface also will cast dynamic shadows.
<br>
<gallery mode=packed heights=250px>
<gallery mode=packed heights=250px>
File:C AF1.jpg| frame |[[$translucent]].
File:C AF1.jpg| frame |[[$translucent]].
File:C AF2.jpg| frame |[[$alphatest]].
File:C AF2.jpg| frame |[[$alphatest]].
</gallery>
</gallery>
{{Confirm|Is there more shaders with this issue ?}}
{{Confirm|Is there more ways to get transparency issues ?}}
{{Confirm|Is there more ways to get this bug ?}}
----
----


====Deferred lighting doesn't shows on transparency materials====
====No lighting for particles====
Very noticeable with shaders that doesn't shows one of the lighting layers applied to the color of the transparent texture. Properly works with [[$alphatest]].
Due to the issues with transparency, dynamic lights can't lit particles. For {{ent|env_smokestack}} it can be partially workaround by using {{ent|env_particlelight}} entity. Using ambient or bounced light from lightmapped lights can help in some cases.
<gallery mode=packed heights=250px>
<gallery mode=packed heights=550px>
File:LDSOTM_.jpg| frame |An example. Expected that you will see shadows from the ropes and the plastic road cone on the window.
File:bmsgb_NoLightingForParticles.jpg| frame |Example using dynamic light and regular light for {{ent|func_smokevolume}}.
File:LDSOTM_p2ce.jpg| frame |The same moment, but in {{p2ce|4}} (this game uses {{ent|env_cascade_light}} from {{csgo|4}}.)
</gallery>
</gallery>
----
----


====Flicker near light volume edges====
====Decals issues with deferred lighting====
Often meeting strange clipping/flickering, strange bug that was in early stages of the game (this can be seen even in videos before new lights release in public). Somehow related to <code>Range</code> value, since changing its value halfway fixes this bug, because it move away the bugged area. With [https://store.steampowered.com/news/app/362890/view/4174347361777844150?l Necro Patch], this is fixed for {{ent|newLight_Spot}}.
Decals and overlays don't use [[$bumpmap|bump maps]], this causes lighting to using bump map from object the decals applied to, this can cause issues like in the picture.
<br>
<gallery mode=packed heights=350px>
File:bmsgb_DecalsIssues2.jpg| frame |Papers on a concrete surface. Everything looks good.
File:bmsgb_DecalsIssues3.jpg| frame |Added alarm red light, now the papers are barely visible.
</gallery>
If a decal is applied to surface with alpha channel, using deferred light on such decal will make it transparent on pixel where alpha channel uses black color.
<gallery mode=packed heights=350px>
<gallery mode=packed heights=350px>
File:cWC1.gif| frame |One of many examples.
File:bmsgb_DecalsIssues0.jpg| frame |The metal ring on a grate around the yellow pipe. Everything looks good.
File:cWC3.gif| frame |One of many examples.
File:bmsgb_DecalsIssues1.jpg| frame |Enabled green light source from the player. Now the metal ring is transparent there the grate has holes.
</gallery>
----
 
====Brush polygons clipping deferred lighting====
Sometimes brush polygons clip deferred lighting. Can be fixed if divide invalid brush into two parts.
{{note|Usually happens if used fast compile settings for a map.}}
<gallery mode=packed heights=250px>
File:C BPl0.jpg| frame |First example with {{cmd|mat_wireframe|0}}.
File:C BPl1.jpg| frame |First example with {{cmd|mat_wireframe|1}}.
</gallery>
<gallery mode=packed heights=250px>
File:C BPb0.jpg| frame |Second example with {{cmd|mat_wireframe|0}}.
File:C BPb1.jpg| frame |Second example with {{cmd|mat_wireframe|1}}.
</gallery>
</gallery>
----
----


====Brush polygons may clip deferred lighting====
====Objects with [[refract]] shader can "self refract" if illuminated by deferred lighting====
Rare phenomenon, sometimes brush polygons clip deferred lighting, the reason that cause this is unknown. Can be easy fixed if divide invalid brush into two parts.
If a model uses texture with the refract shader and a regular texture with deferred lighting support, the lighting layer for regular texture will be visible in the model's refraction.  
{{note|Most often happen if map used fast compile settings.}}
<br>
<gallery mode=packed heights=250px>
<gallery mode=packed heights=250px>
File:C BPl0.jpg| frame |One of examples (mat_wireframe 0).
File:as_c3map01_1.jpg| frame |Black Mesa: Azure Sheep, as_c3map01 - flashlight disabled, everything looks good.
File:C BPl1.jpg| frame |One of examples (mat_wireframe 1).
File:as_c3map01_2.jpg| frame |Black Mesa: Azure Sheep, as_c3map01 - flashlight enabled, now this magnifying lamp "refracts self".
</gallery>
</gallery>
<br>
 
Similar issue happens if the model texture behind wall with refraction.
<gallery mode=packed heights=250px>
<gallery mode=packed heights=250px>
File:C BPb0.jpg| frame |One of examples (mat_wireframe 0).
File:RefractBugs_1.jpg| frame |Flashlight disabled, everything looks good.
File:C BPb1.jpg| frame |One of examples (mat_wireframe 1).
File:RefractBugs_2.jpg| frame |Flashlight enabled, now this wall shows the lighting layer for the regular texture.
</gallery>
</gallery>
{{workaround|Divide model into two separate parts, the first should use only regular textures, the second should use only textures with the refraction shader.}}
----
----


====Deferred lighting shines through [[nodraw]] texture====
====[[Viewmodel]] lighting in frame buffers where it should not exists====
Not a bug, but a pattern. Unfortunately, this cannot be controlled in any way, you should keep in mind this before paint [[nodraw]] to escape situations like in the gifs.
Despite the separate render pass for viewmodel lighting, it still appears in shaders where used the player's camera. This affects [[_rt_FullFrameDepth]], [[Depth buffer|_rt_PowerOfTwoFB]], [[_rt_WaterRefraction]] and shaders that use these.
{{workaround|If your dynamic light source illuminates face that player never see - use cheap textures with low resolution and which don't use material shader parameters, a good solution would be tools/toolsblack or any [[UnlitGeneric]] texture.}}
<gallery mode=packed heights=450px>
<br>
File:Bmsgb ViewmodelLightingInFrameBuffersWhereItShouldNotExists1.jpg| frame |Example for '''_rt_FullFrameDepth''' and '''_rt_PowerOfTwoFB'''.
<gallery mode=packed heights=350px>
</gallery>
File:cSLB1.gif| frame |Black Mesa - bm_c2a2a.
 
File:cSLB2.gif| frame |Black Mesa: Blue Shift - bs_c0m0c.
This also affects [[Refract]] and motion blur shaders.
<gallery mode=packed heights=300px>
File:C DFS1Alt.jpg| frame |Refract.
File:Bmsgb ViewmodelLightingInFrameBuffersWhereItShouldNotExists2.jpg| frame |Motion blur.
</gallery>
</gallery>
This bug doesn't appear with disabled viewmodel rendering ({{cmd|r_drawviewmodel|0}}).
{{todo|Find out if there is more shaders with this issue.}}
----
----


====Objects with [[refract]] shader self refract if illuminated by deferred render====
====Gbuffer is not displayed during [[Cubemaps|cubemaps]] building====
Objects with [[refract]] shader in their own refraction disable self, to escape some problems. However - objects with [[refract]] shader illuminated by deferred render refract self because of game can't tell the depth of objects because of the transparency, what you are see in the pictures is just the lighting layer applied to the color of transparency texture.
This causes lighting and other gbuffer related affects not shown in cubemap reflections, which in some cases significantly affects the difference between the scene in the cubemap and the real scene.
<br>
<br>
<gallery mode=packed heights=250px>
<gallery mode=packed heights=250px>
File:as_c3map01_1.jpg| frame |as_c3map01 - flashlight disabled, everything looks fine.
File:bmsgb_nogbufferincubemap_1.jpg| frame |The actual scene (used dynamic yellow lighting for the crystal).
File:as_c3map01_2.jpg| frame |as_c3map01 - flashlight enabled, now this magnifying lamp refract self.
File:bmsgb_nogbufferincubemap_2.jpg| frame |The scene during cubemaps building (the tunnel appears to be dark, although the crystal glows due to {{ent|$selfillum}}).
File:bmsgb_nogbufferincubemap_3.jpg| frame |The scene from the cubemap image in the game on RPG viewmodel (the crystal is visible, but no the cave).
</gallery>
----
 
====Gbuffer is not displayed [[3D Skybox]]====
Due to gbuffer is not included for {{ent|sky_camera}}, this causes gbuffer effects not displayed in 3D Skybox, including lighting, godrays, cascade shadows, lensflares, etc.
<gallery mode=packed heights=350px>
File:C NLDW3DS.jpg| frame |Example, the ''sky_camera'' is used in this small area with [[npc_alien_grunt_melee|alien grunt melee]] model and {{ent|newlight_point}}, but the lighting and godrays is not visible in 3D Skybox.
</gallery>
</gallery>
<br>
----
Similar issue happen if model with refraction behind wall with refraction.
 
<br>
====Gbuffer is broken with <code>-tools</code> window====
If <code>Full Screen</code> is not used, the gbuffer will not work properly. One of issues caused by this is full absence of deferred lighting. It doesn't affect anything, but it can interfere in rare cases when working with <code>-tools</code> window.
<gallery mode=packed heights=250px>
<gallery mode=packed heights=250px>
File:RefractBugs_1.jpg| frame |Flashlight disabled, everything looks fine.
File:DLDNDWT_1.jpg| frame |In <code>Full Screen</code>.
File:RefractBugs_2.jpg| frame |Flashlight enabled, now this wall show one of magnifying lamp deferred lighting layers.
File:DLDNDWT_2.jpg| frame |Out <code>Full Screen</code>.
</gallery>
</gallery>
{{workaround|Divide model into two separate parts, one should use only textures with refraction, the second without textures with refractions.}}
----
----


====[[Viewmodel]] illuminated by deferred render draw in [[refract]] shader====
====Broken water transition for viewmodel====
Refract shader and [[Water_(shader)|Water]] shader take and refract player screen space without taking into account viewmodel. However - viewmodel illuminated by deferred render draw in refract shader because of game can't tell the depth of viewmodel because of the transparency, what you are see in the pictures is just the lighting layer applied to the color of transparency texture.
After the Necro Path update, viewmodel lighting does not transit properly between water surface. Only for water with enabled refraction.
<br>
<gallery mode=packed heights=450px>
<gallery mode=packed heights=250px>
File:Bmsgb BrokenWaterTransitionForViewmodel1.jpg| frame |Example with [[weapon_crowbar|crowbar]], note that the top part is not lit.
File:C DFS1Alt.jpg| frame |Clear example in test map, the hivehand illuminated by deferred render draw in the refract texture, plus it's completely discolored there..
File:C DFS2.jpg| frame |Black Mesa - bm_c4a1a.
File:C DFS3.jpg| frame |Black Mesa: Blue Shift - bs_c2m0a.
</gallery>
</gallery>
----
----


====<code>Motion Blur</code> blurring viewmodel lighting layer====
 
For some reason <code>Motion Blur</code> blurring viewmodel lighting layer, you can notice this when you just rotate camera.
===Shadow issues===
<br>
====Deferred lighting shines through [[nodraw]] texture====
<gallery mode=packed heights=550px>
The [[toolsnodraw]] texture doesn't create dynamic shadows for dynamic light sources, there is no option for this feature to be enabled/disabled.
File: cVLLBASUalt.gif| frame |An example.
{{workaround|If a dynamic light source illuminates face that the player will never see, use cheap textures with low resolution, a good solution would be [[Tool textures (Source)|toolsblack]] or any [[UnlitGeneric]] texture.}}
<gallery mode=packed heights=350px>
File:Bmsgb_lightingshinesthroughnodrawtexture_1.jpg | frame |The scene from player's position in {{code|bm_c2a2a}} map.
File:Bmsgb_lightingshinesthroughnodrawtexture_2.jpg| frame |The scene from the opposite side.
</gallery>
</gallery>
----
----


====Strange "holes" when player's camera is at a great distance====
====Shadow acne when player's camera is at a great distance====
In some cases may will appear strange "holes" when player's camera is at a great distance. Strange bug that occurs quite rarely. It is affected by game resolution, for example in <code>bm_c4a1b1</code> this bug shows up well with a resolution wtih <code>1920x1080</code>, but with <code>3840x2160</code> the light source from the teleporter flickers, but does not form a hole.
Shadows ache can appear if the player is at a great distance from the light source. This happens because of aliasing issues. It is affected by the game resolution as well, for example, in <code>bm_c4a1b1</code> this bug shows up in <code>1920x1080</code> resolution, while with <code>3840x2160</code> doesn't (although the light still flickers). The crossbow scope camera doesn't affect the bug, unlike regular zoom.
{{Confirm|Does it happen with [[newLight_Spot]] ?}}
{{workaround|Can be fixed by increasing the <code>NormalBias</code> value.}}
{{workaround|Can be fixed with <code>NormalBias</code> value increasing.}}
<br>
<gallery mode=packed heights=350px>
<gallery mode=packed heights=350px>
File:C_BMSH42.jpg| frame |Example in bm_c4a1b1, the green teleporter light source starts to glitch when player move certain distance (crossbow zoom doesn't effect to this bug, unlike HEV zoom).
File:C_BMSH42.jpg| frame |Example in bm_c4a1b1.
</gallery>
</gallery>
<br>
<gallery mode=packed heights=350px>
<gallery mode=packed heights=250px>
File:C_BMSH_1.jpg| frame |bm_c4a1b1. NormalBias - 1.
File:C_BMSH_1.jpg| frame |Black Mesa, map bm_c4a1b1. NormalBias - 1.
File:C_BMSH_2.jpg| frame |bm_c4a1b1. NormalBias - 5.
File:C_BMSH_2.jpg| frame |Black Mesa, map bm_c4a1b1. NormalBias - 5.
</gallery>
</gallery>
<br>
<gallery mode=packed heights=350px>
<gallery mode=packed heights=250px>
File:C_BMOBSH_1.jpg| frame |Black Mesa: Black Ops - Restored, bmops_map_2. NormalBias - 0.5.
File:C_BMOBSH_1.jpg| frame |Black Mesa: Black Ops - Restored, bmops_map_2. NormalBias - 0.5.
File:C_BMOBSH_2.jpg| frame |Black Mesa: Black Ops - Restored, bmops_map_2. NormalBias - 1.5.
File:C_BMOBSH_2.jpg| frame |Black Mesa: Black Ops - Restored, bmops_map_2. NormalBias - 1.5.
Line 152: Line 182:
----
----


====Gbuffer doesn't draw while cubemaps is building====
====Lights with enabled shadowmaps disappear after materials reload====
Deferred lighting, godrays, xog and other gbuffer effects doesn't draw while cubemaps is building. This means that you will not see any lighting from new lights in cubemaps.
Only for lights which uses shadowmaps. This issue happen when {{hammer|4}} opens while running the game, when a client disable [[$envmap|cubemaps]] with {{cmd|mat_specular|0}}, when a client reload all materials with {{cmd|mat_reloadallmaterials}}, e. t. c. Can be fixed with save reload. This bug doesn't affect anything directly, but can confuse many mappers.
<br>
<gallery mode=packed heights=250px>
<gallery mode=packed heights=250px>
File:GDDWCiB_1.jpg| frame |This is what see player.
File:DLDAMR_1.jpg| frame |Before <code>mat_reloadallmaterials</code>.
File:GDDWCiB_2.jpg| frame |This is what shows cubemap reflection (note the reflection on the [[weapon_rpg|RPG]] doesn't shows any lighting from this crystal).
File:DLDAMR_2.jpg| frame |After <code>mat_reloadallmaterials</code>. Note that the dynamic lighting from the tripod spotlight disappeared.
File:GDDWCiB_3.jpg| frame |This is how it looks while cubemaps is building.
</gallery>
</gallery>
----
----


====New lights doesn't work with [[3D Skybox]]====
====Shadow acne with moving lights====
Don't use new lights in your 3D skyboxes, none of them will work at all.
[https://digitalrune.github.io/DigitalRune-Documentation/html/3f4d959e-9c98-4a97-8d85-7a73c26145d7.htm Shadow acne] (also can be called "projection clipping") appears for moving lights with shadows if parent is moving at high speed. This issue appears even if used a very high value for {{cmd|nr_shadow_max_passes_per_frame}} console variable. This issue causes black squares or dark floors due to incorrect shadow overlaying. Multiple examples can be seen in this 1 minute long [https://youtu.be/l5t8Mdks8FM video].
<br>
<gallery mode=packed heights=350px>
File:bmsgb shadowacnewithmovinglights 2.jpg| frame |Example in {{code|bm_c1a1c}}. Before the elevator falls.
File:bmsgb shadowacnewithmovinglights 3.jpg| frame |Example in {{code|bm_c1a1c}}. During the elevator falls.
</gallery>
 
Can be partially fixed with <code>NormalBias</code> value increasing. Also, if your moving light is just simple decoration (the puzzle crystals from [[Xen]] is great example), it is highly recommended to disable shadows to save limits and performance.
<gallery mode=packed heights=350px>
<gallery mode=packed heights=350px>
File:C NLDW3DS.jpg| frame |An example. We see that deferred lighting and Godrays works fine, but 3D Skybox doesn't draw both.
File:MLWSAR1.jpg| frame |<code>NormalBias</code> - 1
File:MLWSAR2.jpg| frame |<code>NormalBias</code> - 10
</gallery>
</gallery>
----
----


====Materials reload cause new lights disappear====
====Noise in shadowmaps====
Only for new lights which uses shadows. This issue happen when you open Hammer while game is opened, when you disable speculars with <code>mat_specular 0</code>, when you reload all matelias with <code>mat_reloadallmaterials</code>, e. t. c. Can be fixed with save reload.
The PCCS-based soft shadow filtering (implemented since [https://store.steampowered.com/news/app/362890/view/4174347361777844150?l Necro Patch]) includes a noticeable noise effect. A compromise choice for '''ShadowRadius''' and '''ShadowLod''' helps minimize noise while keeping shadows soft.
<br>
<gallery mode=packed heights=450px>
<gallery mode=packed heights=250px>
File:bmsgb_NoiseInShadows.jpg| frame |Example in ''bm_c2a2b''.
File:DLDAMR_1.jpg| frame |Before <code>mat_reloadallmaterials</code>.
File:DLDAMR_2.jpg| frame |After <code>mat_reloadallmaterials</code>.
</gallery>
</gallery>
----
----


====Gbuffer incorrect work with cloak====
====Shadows doesn't appear instantly after save load====
Cloak is a material shader parameter for <code>VertexLitGeneric</code> shader, female assassins uses it to make self transparent when they need it. Godrays all time fully render through them, same for deferred lighting and xog, even
The game doesn't load shadowmap for dynamic lights instantly, which is why light sources remain without shadows for a short time. This issue doesn't depends on how powerful device the game running at. The more dynamic lights with shadows level has, the more noticeable this issue, because for the game it takes longer to load shadowmaps. Example in a short [https://youtu.be/jZG12lzzS-s video].
<br>
<gallery mode=packed heights=400px>
<gallery mode=packed heights=250px>
File:bmsgb_ShadowsDoesn'tAppearInstantlyAfterSaveLoad_1.jpg| frame |Before save load.
File:C_ASSASINRAYS.jpg| frame |bm_c2a3c, the sun's rays are not cut off despite the fact that she is completely untransparent right now.
File:bmsgb_ShadowsDoesn'tAppearInstantlyAfterSaveLoad_2.jpg| frame |After save load (note that the large shadow from the bucket disappeared).
File:C_ASSASINDF.jpg| frame |bm_c2a3c, she is completely untransparent, but we still can see one of lighting layers.
</gallery>
</gallery>
{{workaround|Enable in {{ent|worldspawn}} settings <code>Level Fade In</code> to hide this issue, this setting also will hide some other issues with loads in {{bms|4}}. {{ent|env_fade}} entity can be used for this as well.}}
----
----


====Deferred lighting incorrect work with [[Customize Character]] window====
====No self-shadowing support for viewmodel====
For some reason [[Customize Character]] take player's screen, inserts it into character preview window and show one of deferred lighting layers.
Deferred lights doesn't support self-shadowing for {{ent|blackmesa_viewmodel}} entity, like {{ent|env_cascade_light}} or {{ent|env_projectedtexture}} from older {{valve|4}} engine branches. There is also no virtual lighting system.
<br>
<gallery mode=packed heights=350px>
<gallery mode=packed heights=350px>
File: BruhCharacter.jpg| thumb |An example with zombie scientist model.
File:C CSMSF.jpg| frame |Example with cascade shadows, note how one of [[weapon_gluon|gluon gun]] switches creates dynamic shadow on the model.
File:C DFSF.jpg| frame |Example with {{ent|newLight_Spot}}, note that there is no shadows on the gun.
</gallery>
</gallery>
----
----


====Deferred lighting does not draw with <code>-tools</code>====
====Shadows doesn't appear instantly if light wasn't enabled====
If you don't use <code>Full Screen</code> - deferred lighting will not draw.
If dynamic light source was disabled on spawn, shadows will not appear instantly, this also happens if player's camera didn't see this light source enabled initially. It is noticeable in dark areas. Example in this short [https://youtu.be/QU7GONx3xak video].
<br>
{{workaround|Use 0 value for light intensity on spawn. When should be turned on - set required value via <code>SetIntensityForLight</code> input with delay of ~0.1-0.5 seconds after turning on.}}
<gallery mode=packed heights=250px>
File:DLDNDWT_1.jpg| frame |In <code>Full Screen</code>.
File:DLDNDWT_2.jpg| frame |Out <code>Full Screen</code>.
</gallery>
----
----


====Broken water transition in [[viewmodel]]====
====Flickering shadows and low frame rate====
You can note the broken lighting transition when you go into water (only if water is world geometry and uses refractions).
Using lots of lights in single frame can cause low frame rate for shadowmaps, unnatural flickering and "pulsing" shadows. Using a hight value from {{command|nr_shadow_max_passes_per_frame}} (60-100 or highter) can help fix the issue, but in some cases it won't help. Example in this short [https://youtu.be/b4zQ-O8f9iE video].
<gallery mode=packed heights=450px>
File:watertransbug.gif| frame |An example.
</gallery>
----
----


====Godrays incorrect work with [[$translucent]]====
===Godrays issues===
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 (the same issue happen if used material shader parameter [[$decal]]). 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.
====Transparency issues with godrays====
Godrays and their also disk doesn't work with materials if enabled ''$translucent'', or ''$decal'', or  ''cloak'', or any render mode except {{code|Normal}} (0), or decal/overlay applied on a geometry with transparency. Disable godrays when you need or use [[$alphatest]] if it'll give required results.
<br>
<br>
<gallery mode=packed heights=250px>
<gallery mode=packed heights=250px>
File:cGodraysTransBug.jpg| frame |Bug example in bm_c1a3c.
File:cGodraysTransBug.jpg| frame |Bug example in ''bm_c1a3c''.
File:cGodraysTransBugSide.jpg| frame |Sign from other side.
File:cGodraysTransBugSide.jpg| frame |Sign from the other side.
</gallery>
</gallery>
----
----


====Godrays fully draws through water====
====Godrays doesn't process [[viewmodel]] if the player is underwater====
Deferred lighting doesn't fully draws through water, unlike godrays.
[https://store.steampowered.com/news/app/362890/view/4174347361777844150?l Necro Patch] fixed the old issue with godrays that wasn't processing models above water. This fix caused new issue. Godrays doesn't process {{ent|blackmesa_viewmodel}} entity if the owner is underwater. Doesn't happen with {{ent|func_water}} and {{ent|func_water_analog}}.
<br>
<gallery mode=packed heights=350px>
<gallery mode=packed heights=350px>
File:C C3m0c.jpg| frame |Black Mesa: Blue Shift - bs_c3m0c.
File:GDPVIPUU_0.jpg| frame |The player is not underwater.
File:GDPVIPUU_1.jpg| frame |The player is underwater.
</gallery>
</gallery>
----
----


====Godrays leaks====
====Godrays can't be displayed in monitors and reflections====
Due to way how godrays works, in some cases you can note the leaking. Can be drawn even through walls, appearing where they should not be visible at all. Disable rays with triggers or minimize the effect. Because of this, it is not recommanted to use rays in multiplayer, as there is no way to disable rays for each client individually.
Godrays for monitors and reflections was added with [https://store.steampowered.com/news/app/362890/view/4174347361777844150?l Necro Patch]. However, this is disabled in the code by default in the client code, because of incorrect godrays position. There is no way to enable this feature.
<br>
<gallery mode=packed heights=250px>
<gallery mode=packed heights=450px>
File:C GodraysInWater.jpg| frame |Example with water.
File:BmsCodeWeNEED(Someone_from_Valve_please_allow_to_BM_devs_to_publish_the_game_code_to_make_possible_for_us_fix_this_bugs_please).gif| frame |An example.
File:C GodraysInMonitor.jpg| frame |Example with monitor.
</gallery>
</gallery>
----
----


====Godrays doesn't process [[viewmodel]] if player is underwater====
====Godrays doesn't work with refraction====
[https://store.steampowered.com/news/app/362890/view/4174347361777844150?l Necro Patch] fixed the old issue with godrays that wasn't processing models above water. This fix caused new issue, now godrays doesn't process [[viewmodel]] if player is underwater. Doesn't happen with [[func_water]] and [[func_water_analog]].
Even if godrays is behind surface with refraction, they will not correspond to the refracted scene, an object can be refracted, but not its shadow from the rays. Godrays will also not blend with refraction color.
<br>
<gallery mode=packed heights=450px>
<gallery mode=packed heights=250px>
File:bmsgb_GodraysDoesntWorkWithRefraction_1.jpg| frame |Example, note that the magnifying glass is refracted, but not rays.
File:GDPVIPUU_0.jpg| frame |Player is not underwater.
File:GDPVIPUU_1.jpg| frame |Player is underwater.
</gallery>
</gallery>
----
----


====Godrays can't be displayed in monitors and reflections====
===NewLight_Point issues===
Godrays is post process effect that depends on player screen. That means that they can't water reflections or monitors can't show it.
====Shadowmaps split boundary artifacts====
{{note|Godrays for monitors and reflections was added with [https://store.steampowered.com/news/app/362890/view/4174347361777844150?l Necro Patch]. However, this is disabled in the code by default, because it didn't work correctly. There is no way to enable this feature.}}
{{ent|newLight_Point}} uses 1–4 separate shadowmaps to cover its projection volume. When an object is positioned close to the boundary between these shadowmaps, the shadow may appear broken, clipped, or misaligned. This artifact is most noticeable with point lights using low-resolution shadowmaps, where precision issues become more visible.
<br>
<gallery mode=packed heights=250px>
<gallery mode=packed heights=250px>
File:C GodraysInWater.jpg| frame |An example.
File:Nlpb shadowmapssplitboundaryartifacts 1.jpg| frame |
File:C GodraysInMonitor.jpg| frame |An example.
File:Nlpb shadowmapssplitboundaryartifacts 2.jpg| frame |
File:Nlpb shadowmapssplitboundaryartifacts 3.jpg| frame |
</gallery>
</gallery>
----
----


====Godrays doesn't refracting by refract shader and fully draws through====
====Clipping near new light BBOX volume corners====
Unlike deferred lighting, godrays doesn't refracting by refract shader, also fully draws through.
If a client is near {{ent|newlight_point}}'s BBOX volume corner, the lighting starts clipping on the client side in a form of triangle shape. The size of clip depends on how close the client to the BBOX corner volume, it can be minimal or hide lighting completely. This bug disappears (the triangle shape goes away) if the client is in BBOX or is not near one of the 4 corners. The distance and how far/close should be the client directly depends on BBOX volume size.
<br>
<gallery mode=packed heights=290px>
<gallery mode=packed heights=350px>
File:Nlpb volumeedge.jpg| thumb | left | 510px |Example with enabled BBOX rendering.
File:AnGodexample.gif| frame |An example.
</gallery>
</gallery>
----
----


====Moving lights with shadows are buggy====
===NewLight_Spot issues===
In some cases, your attached lights may have buggy shadows if parent is moving.
 
<br>
====Sharpness for spot light with shadowmap====
<gallery mode=packed heights=350px>
This is noticeable if the spotlight is not pointing straight ahead.
File:CSDAIWALOLWS1.gif| frame |An example.
{{workaround|Can be partially fixed by increasing the <code>NormalBias</code> value.}}
File:cDLWSMB2.gif| frame |bm_c1a1c.
</gallery>
Can be partially fixed with <code>NormalBias</code> value increasing. Also, if your moving light is just simple decoration (the puzzle crystals from [[Xen]] is great example) - highly recommended to leave shadows disabled to save limits and performance.
<gallery mode=packed heights=350px>
<gallery mode=packed heights=350px>
File:MLWSAR1.jpg| frame |<code>NormalBias</code> - 1
File:)BUGSUCK1.jpg| frame |Example.
File:MLWSAR2.jpg| frame |<code>NormalBias</code> - 10
File:)BUGSUCK2.jpg| frame |Example ''bm_c1a2b''.
</gallery>
</gallery>
----
----


====Shadows incorrect work with [[newLight_Point]] cube edges====
====Сlipping shadowmap for rotating spot light====
Because [[newLight_Point]] is cube technically - we get shadows incorrect behavior with edges of this cube, this cause their serious distortion a.k.a. clipping. You only can minimize this if set shadow quality to maximum.
This appears if {{ent|newLight_Spot}} rotates at medium or high speed. Using high value for ''NormaBias'' can partially solve this issue. Disabling shadows will solve the problem. Example in this [https://youtu.be/hcHEs6j1E1o video].
<br>
<gallery mode=packed heights=512px>
<gallery mode=packed heights=350px>
File:nlsb_СlippingShadowmapForRotatingSpotLight1.jpg| thumb | left | 510px |Example in a dark room.
File:cC SIWENCE0.jpg| frame |One of many examples.
File:Ccc_SIWENCE1.jpg| frame |One of many examples.
File:cC SIWENCE_2.jpg| frame |One of many examples.
</gallery>
</gallery>
----
----


====Shadows have noise====
====Rotation interpolation issue for shadowmap====
This noise appeared with [https://store.steampowered.com/news/app/362890/view/4174347361777844150?l Necro Patch], greatly spoils blurry shadows. The only workaround is to make <code>ShadowRadius</code> value very low, but then the shadows will become extremely sharp and stepped.
Rotating spot light can have troubles for shadowmap rotation interpolation, this issues causes unnatural "twitching". Example in this [https://youtu.be/sKgdpZbSZrE video].
<br>
<gallery mode=packed heights=250px>
<gallery mode=packed heights=450px>
File:nlsb_RotationInterpolationIssue1.jpg| thumb | left | 510px |First frame, everything looks good.
File:20240320202853_1.jpg| frame |An example.
File:nlsb_RotationInterpolationIssue2.jpg| thumb | left | 510px |Second frame, the shadow from the car battery is in a wrong position.
File:nlsb_RotationInterpolationIssue3.jpg| thumb | left | 510px |Third frame, everything looks good again.
</gallery>
</gallery>
----
----


====Shadows doesn't appear immediately after reload====
===NewLights_settings issues===
After game save and load shadows don't appear for short time, maybe it has something to do with caching. This appearance duration may vary depending on power of user PC and how much of lights with enabled shadows are turned on at level, but in any case user will get this issue even with most powerful PC.
====Range increasing doesn't increase [[Bounding box|BBOX]]====
{{workaround|Enable in [[worldspawn]] settings <code>Level Fade In</code> to hide this problem, this setting also will hide some other issues with loads that avaible in {{bms|4}}.}}
This results in the lighting disappearing before the player's field of view moved away completely from the lighting. This affects all light types, including Dynamic type.
<br>
{{workaround|You can use '''InputFixRotBugDueToTram''' input to reset BBOX values for {{ent|newLight_Spot}} entity.}}
<gallery mode=packed heights=450px>
<gallery mode=packed heights=290px>
File:cSDAIAR1.gif| frame |With no <code>Level Fade In</code>. It seems like the shadows flicker, which makes it unpleasant for eyes.
File:range_bug0.jpg| thumb | left | 510px | Before applying settings. Range - 56.
File:cSDAIAR2.gif| frame |With <code>Level Fade In</code>. Everything looks fine.
File:range_bug1.jpg| thumb | left | 510px | After applying settings. Range - 500.
</gallery>
</gallery>
----
----


====Shadows don't appear immediately with a lot of lights with shadows====
====OuterAngle increasing/decreasing doesn't change ShadowFOV====
If your level use a lot of lights with shadows - shadows from enabling lights will not appear immediately, this happens if light source was disabled and if player's camera did not see this light source enabled initially.
Static shadowmaps will be broken after increasing outer angle value for {{ent|newLight_Spot}} (fixes after save reload). For Static light type, you will not have notable issues with decreasing, but shadows will not look better. Stationary light type will be broken after decreasing as well.
{{workaround|Before turning on light, set the intensity for light (via <code>SetIntensityForLight</code> input) to 0, then turn on light source and set the intensity to the desired value with delay of 0.5 seconds. Also, {{command|nr_shadow_max_passes_per_frame}} set to 25 can help in some cases.}}
<gallery mode=packed heights=290px>
<br>
File:outerangle_bug0.jpg| thumb | left | 510px | Before applying settings. OuterAngle - 30.
<gallery mode=packed heights=450px>
File:outerangle_bug1.jpg| thumb | left | 510px | After applying settings. OuterAngle - 60.
File:cSDAIWALOLWS1alt.gif| frame |An example.
File:cSDAIWALOLWS2.gif| frame |bm_c2a1a.
</gallery>
</gallery>
----
----
====Shadows low passes per frame if used a lot of lights with shadows====
 
Sometimes many lights with shadows sets low values for {{command|nr_shadow_max_passes_per_frame}} cvar. This cause shadows to be looking a lot less natural.
====AngularFallOff may broke shadows for Stationary light type====
{{workaround|Very easy to fix with {{ent|point_servercommand}}, just place {{ent|logic_timer}} which will fire {{command|nr_shadow_max_passes_per_frame|28}} command each 2 seconds.}}
Sometimes, for some reason, changing AngularFallOff value for Stationary light type will make your shadows look broken.
<br>
<gallery mode=packed heights=290px>
<gallery mode=packed heights=420px>
File:AngularFallOff_bug0.jpg| thumb | left | 510px | Before applying settings. AngularFallOff - 0.
File:shadowpascom.gif| frame |nr_shadow_max_passes_per_frame - 16
File:AngularFallOff_bug1.jpg| thumb | left | 510px | After applying settings. AngularFallOff - 5.
File:shadowpascom2.gif| frame |nr_shadow_max_passes_per_frame - 28
</gallery>
</gallery>
----
----


====Viewmodel doesn't support self-shadowing with deferred ligths====
====Range increasing/decreasing will make static shadowmaps broken====
Unlike cascade shadows - viewmodel doesn't support self-shadowing with deferred ligths. Not a bug, but this is not what you expect from real life, it also isn't so with [[env_projectedtexture]].
Range increasing/decreasing doesn't update static shadowmaps, this leaves old static shadowmaps that cannot be properly overlaid with the changed range value.
<br>
 
<gallery mode=packed heights=250px>
This is how it looks with increasing.
File:C CSMSF.jpg| frame |Here you can see how one of gluon gun switches create shadow that fall on other part of gun.
<gallery mode=packed heights=290px>
File:C DFSF.jpg| frame |Light spot illuminates gluon gun, but lighting just ignore viewmodel and fully shine through, although only the side of the gun should be light.
File:rangeStaticShadow_bug-0.jpg| thumb | left | 510px | Before applying settings. Range - 50.
</gallery>
File:rangeStaticShadow_bug-1.jpg| thumb | left | 510px | After applying settings. Range - 500.
----
File:rangeStaticShadow_bug-2.jpg| thumb | left | 510px | This is how it supposed to look like.
====Spot lights have sharpness bug if shadows enabled====
It is most noticeable if spot light is at not a right angle. It greatly degrades quality of shadows. Issue can be partially fixed if make <code>NormalBias</code> value bigger. Also can be minimized with shadow quality, range, outer and inner angles.
<gallery mode=packed heights=250px>
File:)BUGSUCK1.jpg| frame | An example.
File:)BUGSUCK2.jpg| frame | bm_c1a2b.
</gallery>
</gallery>
----
This is how it looks with decreasing.
====Moving [[newLight_Spot]] clipping if shadows enabled====
<gallery mode=packed heights=290px>
Even with low speed, [[newLight_Spot]] clipping when rotating, but only if shadows enabled. With pause this bug get fix.
File:rangeStaticShadow_bug0.jpg| thumb | left | 510px | Before applying settings. Range - 500.
<br>
File:rangeStaticShadow_bug1.jpg| thumb | left | 510px | After applying settings. Range - 50.
<gallery mode=packed heights=250px>
File:rangeStaticShadow_bug2.jpg| thumb | left | 510px | This is how it supposed to look like.
File:DamnCrowbarCollective2.gif| frame | An example.
File:DamnCrowbarCollective1.gif| frame | bm_c1a3a - emergency light sources.
File:CrowbarPickUpSceneBuggy.gif| frame | bs_c3m0a - scene with the stucked scientist.
File:RosenberAndFlashLight.gif| frame | bs_c3m2a - Dr. Rosenberg scene.
</gallery>
</gallery>
----
----

Latest revision as of 12:22, 5 November 2025

edit

All the bugs and limitations divided into the following categories:

  • Lighting issues - mainly lighting shader issues.
  • Shadow issues - issues related to shadowmaps.
  • Godrays issues - issues related to godrays.
  • NewLight_Point issues - bugs and limitations only for newLight_Point entity.
  • NewLight_Spot issues - bugs and limitations only for newLight_Spot entity.
  • NewLights_settings issues - bugs and limitations only for newLights_settings entity.
Note.pngNote:Some entity specific bugs are in entity page.

Lighting issues

Transparency issues with deferred lighting

None of the available shaders that support transparency can render shadows and lighting on on objects if transparency is enabled. Usually other games and engines use deferred shading for opaque objects, then switch to forward rendering for transparent objects, but Black Mesa rendering is not doing so.

Deferred lighting is also incompatible with transparency for VertexLitGeneric and Lightmapped_4WayBlend, it shows one of the lighting layers applied to the color of the transparent texture.

This issue also applies to brushes with no transparency, but which is a part of a func entity with a transparent brush (the only exception is func_detail). This happen even if transparency used for shader that doesn't shows one of the lighting layers. Doesn't work only if brush has alpha texture.

The same will happen if used $decal material parameter.

Similar issue will happen if overlay/decal is applied on a geometry with transparency.

If a func entity or model uses render mode Glow (3) or World Space Glow (9) - they will show one of the lighting layers as well. This means that you can't use these renders to make your brush transparent, you will need a separate texture with alpha texture and material with $translucent.

Using other render modes (except Normal (0) and Don't Render (10)) on a brush entity will cause many rendering issues. Example in this short video.

The cloak material shader parameter will also cause this issue, even if object is not transparent at the moment.

There is not much workarounds. In some cases, $alphatest can be used, because it can give similar to $translucent result, it will also allow object to create dynamic shadows.

Confirm:Is there more ways to get transparency issues ?

No lighting for particles

Due to the issues with transparency, dynamic lights can't lit particles. For env_smokestack it can be partially workaround by using env_particlelight entity. Using ambient or bounced light from lightmapped lights can help in some cases.


Decals issues with deferred lighting

Decals and overlays don't use bump maps, this causes lighting to using bump map from object the decals applied to, this can cause issues like in the picture.

If a decal is applied to surface with alpha channel, using deferred light on such decal will make it transparent on pixel where alpha channel uses black color.


Brush polygons clipping deferred lighting

Sometimes brush polygons clip deferred lighting. Can be fixed if divide invalid brush into two parts.

Note.pngNote:Usually happens if used fast compile settings for a map.

Objects with refract shader can "self refract" if illuminated by deferred lighting

If a model uses texture with the refract shader and a regular texture with deferred lighting support, the lighting layer for regular texture will be visible in the model's refraction.

Similar issue happens if the model texture behind wall with refraction.

PlacementTip.pngWorkaround:Divide model into two separate parts, the first should use only regular textures, the second should use only textures with the refraction shader.

Viewmodel lighting in frame buffers where it should not exists

Despite the separate render pass for viewmodel lighting, it still appears in shaders where used the player's camera. This affects _rt_FullFrameDepth, _rt_PowerOfTwoFB, _rt_WaterRefraction and shaders that use these.

This also affects Refract and motion blur shaders.

This bug doesn't appear with disabled viewmodel rendering (r_drawviewmodel 0).

Todo: Find out if there is more shaders with this issue.

Gbuffer is not displayed during cubemaps building

This causes lighting and other gbuffer related affects not shown in cubemap reflections, which in some cases significantly affects the difference between the scene in the cubemap and the real scene.


Gbuffer is not displayed 3D Skybox

Due to gbuffer is not included for sky_camera, this causes gbuffer effects not displayed in 3D Skybox, including lighting, godrays, cascade shadows, lensflares, etc.


Gbuffer is broken with -tools window

If Full Screen is not used, the gbuffer will not work properly. One of issues caused by this is full absence of deferred lighting. It doesn't affect anything, but it can interfere in rare cases when working with -tools window.


Broken water transition for viewmodel

After the Necro Path update, viewmodel lighting does not transit properly between water surface. Only for water with enabled refraction.



Shadow issues

Deferred lighting shines through nodraw texture

The toolsnodraw texture doesn't create dynamic shadows for dynamic light sources, there is no option for this feature to be enabled/disabled.

PlacementTip.pngWorkaround:If a dynamic light source illuminates face that the player will never see, use cheap textures with low resolution, a good solution would be toolsblack or any UnlitGeneric texture.

Shadow acne when player's camera is at a great distance

Shadows ache can appear if the player is at a great distance from the light source. This happens because of aliasing issues. It is affected by the game resolution as well, for example, in bm_c4a1b1 this bug shows up in 1920x1080 resolution, while with 3840x2160 doesn't (although the light still flickers). The crossbow scope camera doesn't affect the bug, unlike regular zoom.

PlacementTip.pngWorkaround:Can be fixed by increasing the NormalBias value.

Lights with enabled shadowmaps disappear after materials reload

Only for lights which uses shadowmaps. This issue happen when Hammer Hammer opens while running the game, when a client disable cubemaps with mat_specular 0, when a client reload all materials with mat_reloadallmaterials, e. t. c. Can be fixed with save reload. This bug doesn't affect anything directly, but can confuse many mappers.


Shadow acne with moving lights

Shadow acne (also can be called "projection clipping") appears for moving lights with shadows if parent is moving at high speed. This issue appears even if used a very high value for nr_shadow_max_passes_per_frame console variable. This issue causes black squares or dark floors due to incorrect shadow overlaying. Multiple examples can be seen in this 1 minute long video.

Can be partially fixed with NormalBias value increasing. Also, if your moving light is just simple decoration (the puzzle crystals from Xen is great example), it is highly recommended to disable shadows to save limits and performance.


Noise in shadowmaps

The PCCS-based soft shadow filtering (implemented since Necro Patch) includes a noticeable noise effect. A compromise choice for ShadowRadius and ShadowLod helps minimize noise while keeping shadows soft.


Shadows doesn't appear instantly after save load

The game doesn't load shadowmap for dynamic lights instantly, which is why light sources remain without shadows for a short time. This issue doesn't depends on how powerful device the game running at. The more dynamic lights with shadows level has, the more noticeable this issue, because for the game it takes longer to load shadowmaps. Example in a short video.

PlacementTip.pngWorkaround:Enable in worldspawn settings Level Fade In to hide this issue, this setting also will hide some other issues with loads in Black Mesa Black Mesa. env_fade entity can be used for this as well.

No self-shadowing support for viewmodel

Deferred lights doesn't support self-shadowing for blackmesa_viewmodel entity, like env_cascade_light or env_projectedtexture from older Valve Valve engine branches. There is also no virtual lighting system.


Shadows doesn't appear instantly if light wasn't enabled

If dynamic light source was disabled on spawn, shadows will not appear instantly, this also happens if player's camera didn't see this light source enabled initially. It is noticeable in dark areas. Example in this short video.

PlacementTip.pngWorkaround:Use 0 value for light intensity on spawn. When should be turned on - set required value via SetIntensityForLight input with delay of ~0.1-0.5 seconds after turning on.

Flickering shadows and low frame rate

Using lots of lights in single frame can cause low frame rate for shadowmaps, unnatural flickering and "pulsing" shadows. Using a hight value from nr_shadow_max_passes_per_frame (60-100 or highter) can help fix the issue, but in some cases it won't help. Example in this short video.


Godrays issues

Transparency issues with godrays

Godrays and their also disk doesn't work with materials if enabled $translucent, or $decal, or cloak, or any render mode except Normal (0), or decal/overlay applied on a geometry with transparency. Disable godrays when you need or use $alphatest if it'll give required results.


Godrays doesn't process viewmodel if the player is underwater

Necro Patch fixed the old issue with godrays that wasn't processing models above water. This fix caused new issue. Godrays doesn't process blackmesa_viewmodel entity if the owner is underwater. Doesn't happen with func_water and func_water_analog.


Godrays can't be displayed in monitors and reflections

Godrays for monitors and reflections was added with Necro Patch. However, this is disabled in the code by default in the client code, because of incorrect godrays position. There is no way to enable this feature.


Godrays doesn't work with refraction

Even if godrays is behind surface with refraction, they will not correspond to the refracted scene, an object can be refracted, but not its shadow from the rays. Godrays will also not blend with refraction color.


NewLight_Point issues

Shadowmaps split boundary artifacts

newLight_Point uses 1–4 separate shadowmaps to cover its projection volume. When an object is positioned close to the boundary between these shadowmaps, the shadow may appear broken, clipped, or misaligned. This artifact is most noticeable with point lights using low-resolution shadowmaps, where precision issues become more visible.


Clipping near new light BBOX volume corners

If a client is near newlight_point's BBOX volume corner, the lighting starts clipping on the client side in a form of triangle shape. The size of clip depends on how close the client to the BBOX corner volume, it can be minimal or hide lighting completely. This bug disappears (the triangle shape goes away) if the client is in BBOX or is not near one of the 4 corners. The distance and how far/close should be the client directly depends on BBOX volume size.


NewLight_Spot issues

Sharpness for spot light with shadowmap

This is noticeable if the spotlight is not pointing straight ahead.

PlacementTip.pngWorkaround:Can be partially fixed by increasing the NormalBias value.

Сlipping shadowmap for rotating spot light

This appears if newLight_Spot rotates at medium or high speed. Using high value for NormaBias can partially solve this issue. Disabling shadows will solve the problem. Example in this video.


Rotation interpolation issue for shadowmap

Rotating spot light can have troubles for shadowmap rotation interpolation, this issues causes unnatural "twitching". Example in this video.


NewLights_settings issues

Range increasing doesn't increase BBOX

This results in the lighting disappearing before the player's field of view moved away completely from the lighting. This affects all light types, including Dynamic type.

PlacementTip.pngWorkaround:You can use InputFixRotBugDueToTram input to reset BBOX values for newLight_Spot entity.

OuterAngle increasing/decreasing doesn't change ShadowFOV

Static shadowmaps will be broken after increasing outer angle value for newLight_Spot (fixes after save reload). For Static light type, you will not have notable issues with decreasing, but shadows will not look better. Stationary light type will be broken after decreasing as well.


AngularFallOff may broke shadows for Stationary light type

Sometimes, for some reason, changing AngularFallOff value for Stationary light type will make your shadows look broken.


Range increasing/decreasing will make static shadowmaps broken

Range increasing/decreasing doesn't update static shadowmaps, this leaves old static shadowmaps that cannot be properly overlaid with the changed range value.

This is how it looks with increasing.

This is how it looks with decreasing.