Description

With more than one directional light in the scene, ResolvedView.DirectionalLightColor and ResolvedView.DirectionalLightDirection can report the wrong light, or black and a zero vector, while a directional light is still lighting the scene normally. This was hit in a day/night cycle that swaps between a sun and a moon light. Materials that read these values break during the swap.

Both values come from FScene::SimpleDirectionalLight. It is set to the first directional light added to the scene and ignores the rest, whatever their intensity or ForwardShadingPriority. When that light is removed, which includes hiding it, the pointer is set to null and never re-picked from the directional lights still in the scene. So the result depends on the order the lights were added, not on which light is actually lighting the scene.

Expected: the values follow the same directional light the renderer already selects every frame (by ForwardShadingPriority, then intensity) for forward shading, translucency and volumetric fog, and that the Forward Selected Directional Light material node reads. The height fog and volumetric fog fallbacks read the same pointer and have the same problem. Present in 5.6 through current mainline.

Steps to Reproduce
  1. Create a new blank project and open a level containing a floor mesh.
  2. Add a Directional Light, set it Movable, set its colour to blue and its intensity to 5.
  3. Add an unlit material with a Custom HLSL node whose body is: return ResolvedView.DirectionalLightColor.rgb; wired to Emissive. Apply it to a cube in view.
  4. Add a second Directional Light, set it Movable, set its colour to red and its intensity to 20. Observe the cube stays blue even though the red light is four times brighter and is visibly lighting the floor.
  5. Hide the first (blue) Directional Light. Observe the cube goes fully black while the red light continues to light the floor red.
  6. Hide the second (red) Directional Light as well, then unhide it. Observe the cube now reports red.
  7. Unhide the first (blue) Directional Light so both are visible again. Observe the cube stays red.
  8. Hide the second (red) Directional Light. Observe the cube goes fully black while the blue light continues to light the floor blue.

Steps 4, 5 and 8 are the failures. Steps 6 and 7 are correct only by accident of the order the lights were added. The attached project automates all of this and writes a pixel readback per step.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-399013 in the post.

0
Login to Vote

Unresolved
ComponentUE - Rendering - Features
Affects Versions5.6, 5.7, 5.8, 5.8.3
Target Fix5.9
CreatedSep 25, 2026
UpdatedSep 30, 2026
View Jira Issue