Editor 'Build All Levels' discards Volumetrics Lightmaps in persistent level

In many cases ‘Build All Levels’ ends up discarding any volumetric lightmap data that should have been stored in the persistent level’s built data.

What seems to happen is that during UWorld::ReInitWorld the level’s UMapBuildDataRegistry has its RF_Standalone flag cleared. This pointer is then captured directly into FStaticLightingBuildContext without checking that it’s actually in the expected state (e.g. by getting it through GetOrCreateMapBuildData instead). Much much later when finishing up the build process - and after volumetric lightmap importing has completed - GetOrCreateMapBuildData does get called on the persistent build data (usually from some variant of FStaticLightingTextureMapping::Apply) and it realizes the RF_Standalone flags is missing and promptly discards all static lighting before recreating the object. This works for ‘Build Lighting Only’ as it doesn’t re-init the world and as such never clears that flag before starting the build.

An additional problem is that certain things (like there being non-volume brushes in the level e.g.) forces ‘Build Lighting Only’ to actually take the ‘Build All Levels’ path meaning there’s no effective workaround for cases where brushes are used in the level - and it can feel like it ‘inexplicably breaks’ for users when they haven’t made any lighting related changes to the level.

Build Lighting Only:

[Image Removed]

Build All Levels:

[Image Removed]

Build Lighting Only but there’s a brush in the level:

[Image Removed]

Steps to Reproduce

  1. Build a simple scene using geometry only and some movable object relying on light probes lighting.
  2. Turn on ‘Visualize -> Volumetric Lightmap’
  3. Execute ‘Build Lighting Only’
  4. Observe probes being present and providing indirect/baked lighting to dynamic objects as expected.
  5. Execute ‘Build All Levels’
  6. Debug probes disappear and dynamic objects no longer receive any indirect/baked lighting.

Hello,

Thank you for reaching out.

I’ve been assigned this issue, and we will be looking into these lost Volumetric Lightmaps for you.

Hello,

Thank you for reporting this. I can confirm the issue can be reproduced as described in the latest CL, and am opening a bug report.

I will reply here when I have a public tracker for this issue.

Hello,

We have opened a bug report:

The tracker will be visible after it is approved internally at Epic Games and is publicly accessible.

If you have any further questions, please let us know.