SceneCaptureComponent2D with Capture Every Frame disables Global Distance Field in the main view

Summary

In Unreal Engine 5.8, enabling Capture Every Frame on a SceneCaptureComponent2D
with a TextureRenderTarget2D causes Global Distance Field material functions in
the main viewport to stop working.

Disabling Capture Every Frame immediately restores the Distance Field result.

The problem occurs even in an older project where the Distance Field material
worked correctly before adding the continuously updating Scene Capture.

What Type of Bug are you experiencing?

Rendering (Graphics / Niagara)

Steps to Reproduce

  1. Create a project with Generate Mesh Distance Fields enabled.
  2. Create a material that visibly uses DistanceToNearestSurface or another
    Global Distance Field function.
  3. Apply the material and confirm that the Distance Field result works.
  4. Create a TextureRenderTarget2D.
  5. Add a SceneCaptureComponent2D to the level.
  6. Assign the Render Target to its Texture Target.
  7. Enable Capture Every Frame.
  8. Observe that the Distance Field material stops working in the main viewport.
  9. Disable Capture Every Frame.
  10. Observe that the Distance Field result immediately works again.

Expected Result

The SceneCaptureComponent2D should update its Render Target without disabling
or invalidating Global Distance Field sampling in the main view.

Observed Result

While Capture Every Frame is enabled, the Global Distance Field result in the
main viewport becomes unusable. Disabling continuous capture restores it.

Affects Versions

5.8

Platform(s)

Windows

Video

Confirming this on 5.8.1 (Windows, desktop SM6). It also reproduces in PIE and Standalone, so it is not editor-only. Same content worked in 5.7.

Repro: a SceneCaptureComponent2D with Capture Every Frame writing to a render target. While it is enabled, any material in the main view sampling DistanceToNearestSurface stops getting valid data - in my case the shoreline foam lines of a water shader vanish. Toggling bCaptureEveryFrame flips it instantly, both ways.

Note: the Global Distance Field itself is fine. ShowFlag.VisualizeGlobalDistanceField 1 shows correct data while the bug is active. Only its availability to materials breaks.

Likely cause - ShouldPrepareGlobalDistanceField() in DistanceFieldAmbientOcclusion.cpp gates GDF preparation on View.PrevViewInfo.bUsesGlobalDistanceField, i.e. the previous frame’s relevance. That assumes one renderer per frame; a scene capture rendering every frame makes two, and the main view stops being recognised as needing the GDF.

Workaround, restores everything with Capture Every Frame left on, no measurable cost:

[SystemSettings]
r.AOGlobalDistanceField.DetailedNecessityCheck=0

Hello, I have the same problem. My cube is all black (shader is just Distance to nearest surface/100). When I deactivate “Render Every Frame”, it’w working again but when i go play, the cube flicker) (and my blueprint setup for footprint on the terrain using 2d scene capture, doesnt work anymore.)