NewLight Point/Bugs and limitations

From Valve Developer Community
Jump to navigation Jump to search
Todo: Rework this page.

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 ?

Clipping near new light BBOX volume corners (newLight_Point only)

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.


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.

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.

Objects with refract shader self refract if illuminated by deferred render

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.


Similar issue happen if model with refraction behind wall with refraction.

PlacementTip.pngWorkaround:Divide model into two separate parts, one should use only textures with refraction, the second without textures with refractions.

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.

Strange "holes" 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 bm_c4a1b1 this bug shows up well with a resolution wtih 1920x1080, but with 3840x2160 the light source from the teleporter flickers, but does not form a hole.

Confirm:Does it happen with newLight_Spot ?
PlacementTip.pngWorkaround:Can be fixed with NormalBias value increasing.





Gbuffer doesn't draw during cubemaps building

This leads to lighting and other affects will not be shown in cubemap image, which in some cases significantly affects the difference between the scene in the cubemap and the real scene.


Gbuffer doesn't draw in 3D Skybox

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


Materials reload causes new lights with enabled shadows to disappear

Only for new lights which uses shadows. This issue happen when you open Hammer while game is opened, 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.


Deferred lighting does not draw with -tools

If you don't use Full Screen - deferred lighting will not draw.


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.


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 (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.


Godrays fully draws through water

Deferred lighting doesn't fully draws through water, unlike godrays.


Godrays doesn't process viewmodel if player is underwater

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.


Godrays can't be displayed in monitors and reflections

Godrays is post process effect that depends on player screen. That means that they can't water reflections or monitors can't show it.

Note.pngNote:Godrays for monitors and reflections was added with 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.



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.


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.


Shadowmaps split boundary artifacts (newLight_Point only)

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.


Shadows have noise

This noise appeared with Necro Patch, greatly spoils blurry shadows. The only workaround is to make ShadowRadius value very low, but then the shadows will become extremely sharp and stepped.


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.

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.

Shadows low passes per frame if used a lot of lights with shadows

Sometimes many lights with shadows sets low values for nr_shadow_max_passes_per_frame cvar. This cause shadows to be looking a lot less natural.

PlacementTip.pngWorkaround:Very easy to fix with point_servercommand, just place logic_timer which will fire nr_shadow_max_passes_per_frame 28 command each 2 seconds.



Viewmodel doesn't support self-shadowing with deferred ligths

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.


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 NormalBias value bigger. Also can be minimized with shadow quality, range, outer and inner angles.


Moving newLight_Spot clipping if shadows enabled

Even with low speed, newLight_Spot clipping when rotating, but only if shadows enabled. With pause this bug get fix.