Description

Indirect lighting samples were not made correctly when building lighting with umap duplicated via the content browser and registering both source and destination as sublevels in one map.

Steps to Reproduce

Reported by developer:

■ Reproduction procedure
1. Expand the following zip and open the LevelBuildDataId.uproject in it
LevelBuildDataId.zip

2. On the viewport, click "View" -> "Visualize" -> "Volume Lighting Samples" so that the lighting sample is displayed

3. Lighting build with NewMap 1 or NewMap 2 sub-level invisible makes the same look as "Expected Result"
[Link Removed]

4. When making a lighting build with all sublevels visible, it looks the same as "result obtained"
[Link Removed]

■ Supplement
The problem has been solved by creating a new sublevel, moving all the contents of NewMap 2 and making a lighting build.
I think that duplication of ULevel :: LevelBuildDataId is the cause, but I do not know exactly.

■Avoidance
We made the following correction to avoid problems

Engine/Source/Runtime/Engine/Private/Level.cpp

 void ULevel::PostDuplicate(bool bDuplicateForPIE)
 {
         Super::PostDuplicate(bDuplicateForPIE);
 
         bWasDuplicatedForPIE = bDuplicateForPIE;
         ★↓Add 3 lines below
         if (!bDuplicateForPIE)
         {
                 LevelBuildDataId = FGuid::NewGuid();
         }
 }

Engine/Source/Runtime/Engine/Private/World.cpp

static void RestoreLevelBuildDataIds(UWorld* InWorld)
 {
         if (!InWorld)
         {
                 return;
         }
 
         UE_LOG(LogWorld, Log, TEXT("--- Restore duplicated LevelBuildDataIds ---"));
 
         TSet<FGuid> LevelBuildDataIds;
 
         UE_LOG(LogWorld, Log, TEXT("  Levels:"));
         for(ULevel* Level : InWorld->GetLevels())
         {
                 const FGuid LevelBuildDataId = Level->LevelBuildDataId;
                 if (!LevelBuildDataIds.Contains(LevelBuildDataId))
                 {
                         UE_LOG(LogWorld, Log, TEXT("    %s : %s"), *GetFullNameSafe(Level), *(LevelBuildDataId.ToString()));
                         LevelBuildDataIds.Add(Level->LevelBuildDataId);
                 }
                 else
                 {
                         InWorld->ModifyLevel(Level);
                         Level->MarkPackageDirty();
                         Level->LevelBuildDataId = FGuid::NewGuid();
                         UE_LOG(LogWorld, Warning, TEXT("    Fixed %s : %s -> %s"), *GetFullNameSafe(Level), *(LevelBuildDataId.ToString()), *(Level->LevelBuildDataId.ToString()));
                 }
         }
 }
 
 static FAutoConsoleCommandWithWorld RestoreLevelBuildDataIdsCmd(
         TEXT("RestoreLevelBuildDataIds"),
         TEXT("Restore levels' duplicated BuildDataId in the current world."),
         FConsoleCommandWithWorldDelegate::CreateStatic(RestoreLevelBuildDataIds)
         );

Have Comments or More Details?

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

1
Login to Vote

Won't Fix
ComponentUE - Graphics Features
Affects Versions4.16.34.17.1
CreatedAug 29, 2017
ResolvedAug 18, 2021
UpdatedAug 18, 2021