UE5.7 - Fix: Lumen not working for SM5 DX11 and DX12

When using the cvar r.Lumen.Supported.SM5=1 which was working fine in 5.6 … UE5.7 presents with the following in DX11 and DX12 SM5

https://github.com/uno1982/UnrealEngine/tree/5.7-Lumen-D3D-SM5-Fix

Fix: Restore Lumen support for D3D Shader Model 5 (DX11/DX12 SM5)

Unreal Engine 5.7 broke Lumen on D3D SM5 due to StochasticLighting shader
requiring 8 UAVs (hardware limit: 4 UAVs). This commit restores full Lumen
functionality with a fallback path that combines UE 5.6’s simpler approach
with 5.7’s compatibility requirements.

Key Changes:

  • StochasticLighting.cpp: D3D SM5 detection, simplified 2-UAV depth/normal copy

  • Created LumenTileBitmask with all tiles marked (0xFF) for 5.7 compatibility

  • LumenScreenProbeGather.cpp: Fixed GI temporal validation (check data not pointer)

  • LumenReflectionDenoiserTemporal.usf: Conditional depth read for D3D SM5

  • New shader: StochasticLightingDenoising.usf (5.6-style history storage)

Result:
:white_check_mark: Full Lumen GI + Reflections working on DX11 and DX12 SM5
:white_check_mark: DX11 SM5 with Lumen SWRT is fastest performing Lumen path
:white_check_mark: Quality identical to SM6+, no tile culling optimization
:white_check_mark: Production ready, tested across multiple scenarios

Files Modified:

  • StochasticLighting.cpp (fallback path + LumenTileBitmask creation)

  • LumenScreenProbeGather.cpp (temporal validation fix)

  • LumenReflections.cpp (D3D SM5 comment)

  • LumenReflectionDenoiserTemporal.usf (depth consistency)

  • LumenScreenProbeGatherTemporal.usf (PackedPixelData validation)

  • StochasticLightingDenoising.usf (new 5.6-style shader)

  • DeferredShadingRenderer.h (function declaration)

  • LUMEN_D3D_SM5_FIX_SUMMARY.md (comprehensive documentation)

4 Likes

Amazing work, thanks!

1 Like

Hello @Uno1982,

Firstly, thank you for the fix!

Here is a small bug report:
There are shadow artifacts only in High Global illumination scalibility settings. While moving in a real scene, some places are extra dark but with a very big pattern and the pattern is moving. Place some huge rectangular cubes like skyscraper, then you can see them.

By default
r.Lumen.ScreenProbeGather.ShortRangeAO.BentNormal=0 on High

When I use
r.Lumen.ScreenProbeGather.ShortRangeAO.BentNormal=1 on High
shadow artifacts are gone but it probably cost extra on GPU

Those artifacts does not exist when using DX12, SM6

I’ve bumped the branch to 5.7.1 and included some fixes .. thanks for the headsup! Please let me know if your issues remain.