World composition may leads to some materials missing

Here’re the steps that i load levels with level streaming:

  • Enable world composition to composite all my levels and keep unloaded
  • Run the project, load specified levels with C++ codes below(use ‘ExecutionFunction’ for special purpose)

      
FString LevelName = "aaa";
      
bool bVisibleAfterLoad = true;
      
FLatenActionInfo info = GetLatenActionInfo();
      
info.ExecutionFunction = "OnLoadComplete";
      
UGamePlayStatics::LoadStreamLevel(this, LevelName, bVisibleAfterLoad, false, info);
      
-----------------------------------
      
void OnLoadComplete()
      
{ StreamingLevel->bShouldBeVisible = true; }

 - When loading complete, function "OnLoadComplete" is called and i just visualize the level. Then i can see some materials are not loaded as the picture shows below(just for showing the case, not the actual level)

![120136-vrmap.png|939x684](upload://gqG5esVU8b7cEitXQ3fF4Gj0LHT.png)

 

 - After some time, all the missing materials are loaded one by one and finally shows the actual fully loaded level

![120137-vrmap.png|936x664](upload://jJP2GE2eMSiU3CLE1Rs0FaqJsnW.png)

The trick is, if i use regular level streaming which means dragging all the levels manually under persistent level, execute the same c++ code, the level comes out fine. Is this a bug or some settings in world composition i missed? Thank you for answering :)

Hello,

I’ve tried putting this together myself but I’m not seeing the same results. Could you give some sort of example project that reproduces this issue or a step by step reproduction case? There could be something that I’m missing or we’re just doing differently.

Thanks for your reply:)
The actual scene with this problem is fully baked and contains many objects, the total size of all maps are nearly 512MB. Maybe it’s caused by loading too many lightmaps? And i was wondering what is the difference between dragging all levels under a persistent one and using world composition, then loading all levels with LevelStreaming. Looking forward to your next reply:)

This could be because of the size and the amount of maps you’re trying to load at once. When using World Composition, it’ll load any other maps in the folder with the map you just loaded, meaning that if all of your maps are in the folder, this could cause long loading times and cause these materials to be delayed. Could you try splitting your maps into different folders?

I got a little confused about your saying “it’ll load any other maps in the folder with the map you just loaded, meaning that if all of your maps are in the folder”. Suppose i got three maps ‘A’, ‘B’, ‘C’ in the same folder, when i call UGameplayStatics::LoadStreamLevel on map ‘A’, then map ‘B’ and ‘C’ are automatically loaded with map ‘A’?
Besides, i was wondering there’s a callback or sth can notify me when all the meshes, textures, materials in a level are fully loaded?
Thanks a lot:)

If World Composition is enabled, all of those maps will be loaded together. There’s a function wth a boolean variable you can use to check to see if a map has been fully loaded called “Is Level Loaded”.

We haven’t heard from you in a while. Are you still experiencing this issue? If so, was my last comment of any help? In the meantime, I’ll be marking this issue as resolved for tracking purposes.