NewLight Point/Bugs and limitations: Difference between revisions
MyGamepedia (talk | contribs) (Moving) |
MyGamepedia (talk | contribs) |
||
| (6 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{todo|Rework this page.}} | {{todo|Rework this page.}} | ||
===Lighting issues=== | |||
====Transparency issues with deferred lighting==== | ====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. | 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. | ||
| Line 53: | Line 49: | ||
</gallery> | </gallery> | ||
{{Confirm|Is there more ways to get transparency issues ?}} | {{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 {{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=550px> | |||
File:bmsgb_NoLightingForParticles.jpg| frame |Example using dynamic light and regular light for {{ent|func_smokevolume}}. | |||
</gallery> | |||
---- | ---- | ||
| Line 65: | Line 68: | ||
File:C BPb0.jpg| frame |Second example with {{cmd|mat_wireframe|0}}. | File:C BPb0.jpg| frame |Second example with {{cmd|mat_wireframe|0}}. | ||
File:C BPb1.jpg| frame |Second example with {{cmd|mat_wireframe|1}}. | File:C BPb1.jpg| frame |Second example with {{cmd|mat_wireframe|1}}. | ||
</gallery> | </gallery> | ||
---- | ---- | ||
| Line 106: | Line 100: | ||
This bug doesn't appear with disabled viewmodel rendering ({{cmd|r_drawviewmodel|0}}). | This bug doesn't appear with disabled viewmodel rendering ({{cmd|r_drawviewmodel|0}}). | ||
{{todo|Find out if there is more shaders with this issue.}} | {{todo|Find out if there is more shaders with this issue.}} | ||
---- | ---- | ||
| Line 138: | Line 116: | ||
<gallery mode=packed heights=350px> | <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. | 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> | ||
---- | ---- | ||
| Line 164: | Line 134: | ||
---- | ---- | ||
==== | |||
===Shadow issues=== | |||
====Deferred lighting shines through [[nodraw]] texture==== | |||
<gallery mode=packed heights= | The [[toolsnodraw]] texture doesn't create dynamic shadows for dynamic light sources, there is no option for this feature to be enabled/disabled. | ||
File: | {{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.}} | ||
File: | <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> | ||
---- | ---- | ||
==== | ====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 <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. | |||
{{workaround|Can be fixed by increasing the <code>NormalBias</code> value.}} | |||
<gallery mode=packed heights=350px> | |||
File:C_BMSH42.jpg| frame |Example in bm_c4a1b1. | |||
</gallery> | |||
<gallery mode=packed heights=350px> | |||
File:C_BMSH_1.jpg| frame |bm_c4a1b1. NormalBias - 1. | |||
File:C_BMSH_2.jpg| frame |bm_c4a1b1. NormalBias - 5. | |||
</gallery> | |||
<gallery mode=packed heights=350px> | <gallery mode=packed heights=350px> | ||
File: | File:C_BMOBSH_1.jpg| frame |Black Mesa: Black Ops - Restored, bmops_map_2. NormalBias - 0.5. | ||
File: | File:C_BMOBSH_2.jpg| frame |Black Mesa: Black Ops - Restored, bmops_map_2. NormalBias - 1.5. | ||
</gallery> | </gallery> | ||
---- | ---- | ||
==== | ====Lights with enabled shadowmaps disappear after materials reload==== | ||
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. | |||
<gallery mode=packed heights=250px> | <gallery mode=packed heights=250px> | ||
File: | File:DLDAMR_1.jpg| frame |Before <code>mat_reloadallmaterials</code>. | ||
File: | File:DLDAMR_2.jpg| frame |After <code>mat_reloadallmaterials</code>. Note that the dynamic lighting from the tripod spotlight disappeared. | ||
< | |||
< | |||
</gallery> | </gallery> | ||
---- | ---- | ||
| Line 207: | Line 180: | ||
File:MLWSAR1.jpg| frame |<code>NormalBias</code> - 1 | File:MLWSAR1.jpg| frame |<code>NormalBias</code> - 1 | ||
File:MLWSAR2.jpg| frame |<code>NormalBias</code> - 10 | File:MLWSAR2.jpg| frame |<code>NormalBias</code> - 10 | ||
</gallery> | </gallery> | ||
---- | ---- | ||
| Line 233: | Line 197: | ||
</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.}} | {{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.}} | ||
---- | |||
====No self-shadowing support for viewmodel==== | |||
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. | |||
<gallery mode=packed heights=350px> | |||
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> | |||
---- | ---- | ||
| Line 244: | Line 216: | ||
---- | ---- | ||
==== | ===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 {{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> | |||
<gallery mode=packed heights=250px> | |||
File:cGodraysTransBug.jpg| frame |Bug example in ''bm_c1a3c''. | |||
File:cGodraysTransBugSide.jpg| frame |Sign from the other side. | |||
</gallery> | |||
---- | |||
====Godrays doesn't process [[viewmodel]] if the player is underwater==== | |||
[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}}. | |||
<gallery mode=packed heights=350px> | <gallery mode=packed heights=350px> | ||
File:C | File:GDPVIPUU_0.jpg| frame |The player is not underwater. | ||
File: | File:GDPVIPUU_1.jpg| frame |The player is underwater. | ||
</gallery> | |||
---- | |||
====Godrays can't be displayed in monitors and reflections==== | |||
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. | |||
<gallery mode=packed heights=250px> | |||
File:C GodraysInWater.jpg| frame |Example with water. | |||
File:C GodraysInMonitor.jpg| frame |Example with monitor. | |||
</gallery> | |||
---- | |||
====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. | |||
<gallery mode=packed heights=450px> | |||
File:bmsgb_GodraysDoesntWorkWithRefraction_1.jpg| frame |Example, note that the magnifying glass is refracted, but not rays. | |||
</gallery> | |||
---- | |||
===NewLight_Point issues=== | |||
====Shadowmaps split boundary artifacts==== | |||
{{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. | |||
<gallery mode=packed heights=250px> | |||
File:Nlpb shadowmapssplitboundaryartifacts 1.jpg| frame | | |||
File:Nlpb shadowmapssplitboundaryartifacts 2.jpg| frame | | |||
File:Nlpb shadowmapssplitboundaryartifacts 3.jpg| frame | | |||
</gallery> | |||
---- | |||
====Clipping near new light BBOX volume corners==== | |||
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. | |||
<gallery mode=packed heights=290px> | |||
File:Nlpb volumeedge.jpg| thumb | left | 510px |Example with enabled BBOX rendering. | |||
</gallery> | </gallery> | ||
---- | ---- | ||
====Sharpness for spot light with shadowmap | ===NewLight_Spot issues=== | ||
====Sharpness for spot light with shadowmap==== | |||
This is noticeable if the spotlight is not pointing straight ahead. | This is noticeable if the spotlight is not pointing straight ahead. | ||
{{workaround|Can be partially fixed by increasing the <code>NormalBias</code> value.}} | {{workaround|Can be partially fixed by increasing the <code>NormalBias</code> value.}} | ||
| Line 261: | Line 277: | ||
---- | ---- | ||
====Сlipping shadowmap for rotating spot light | ====Сlipping shadowmap for rotating spot light==== | ||
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]. | 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]. | ||
<gallery mode=packed heights=512px> | <gallery mode=packed heights=512px> | ||
File:nlsb_СlippingShadowmapForRotatingSpotLight1.jpg| thumb | left | 510px |Example in a dark room. | File:nlsb_СlippingShadowmapForRotatingSpotLight1.jpg| thumb | left | 510px |Example in a dark room. | ||
</gallery> | |||
---- | |||
====Rotation interpolation issue for shadowmap==== | |||
Rotating spot light can have troubles for shadowmap rotation interpolation, this issues causes unnatural "twitching". Example in this [https://youtu.be/sKgdpZbSZrE video]. | |||
<gallery mode=packed heights=250px> | |||
File:nlsb_RotationInterpolationIssue1.jpg| thumb | left | 510px |First frame, everything looks good. | |||
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> | ||
---- | ---- | ||
Latest revision as of 07:38, 4 November 2025
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.
The same scene, but with
Counter-Strike: Global Offensive cascade lighting which is not using gbuffer.
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.
No $translucent. Behind the wall placed lighting and some models with in a small room.
With $translucent. Now the player can see everything, but only what the light covers.
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.
This sticker is brush, that is part of func_brush, which uses glass as part of itself. Flashlight off.
This sticker is brush, that is part of func_brush, which uses glass as part of itself. Flashlight on.
The same will happen if used $decal material parameter.
Similar issue will happen if overlay/decal is applied on a geometry with transparency.
The metal speaker is overlay that use $alphatest, but lighting from the health charger is still visible, because the overlay is applied on the transparent window.
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.
Example in
bm_c2a3c. The female assassin is not transparent, but the lighting layer is still showing through.
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.
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.
Example using dynamic light and regular light for func_smokevolume.
Brush polygons clipping deferred lighting
Sometimes brush polygons clip deferred lighting. Can be fixed if divide invalid brush into two parts.
First example with
mat_wireframe 0.First example with
mat_wireframe 1.
Second example with
mat_wireframe 0.Second example with
mat_wireframe 1.
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.
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).
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.
The scene during cubemaps building (the tunnel appears to be dark, although the crystal glows due to $selfillum).
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.
Example, the sky_camera is used in this small area with alien grunt melee model and newlight_point, but the lighting and godrays is not visible in 3D Skybox.
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.
Example with crowbar, note that the top part is not lit.
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.
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.
NormalBias value.Lights with enabled shadowmaps disappear after materials reload
Only for lights which uses shadowmaps. This issue happen when
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.
Level Fade In to hide this issue, this setting also will hide some other issues with loads in 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 engine branches. There is also no virtual lighting system.
Example with cascade shadows, note how one of gluon gun switches creates dynamic shadow on the model.
Example with newLight_Spot, note that there is no shadows on the gun.
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.
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.
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.
