Performance issue after loading level with sublevels


I’m working on a project consisting of different ArchViz scenes that will be used both in VR (HTC Vive) and desktop mode. It is actually several houses that are split up in different levels.

Each house consists of three levels:

  • Persistent level: Environment (lights, landscape, skydome etc.)
  • Sublevel 1: House (walls, floor, ceiling, windows etc.)
  • Sublevel 2: Props and furniture

When I load a level I get a performance hit the first 10-20 seconds. There is lag and stuttering which is especially noticable in VR. I assume it comes from loading all the level contents. The CPU goes to about 50% load to later go back to a much lower number. After that everything is fine performance-wise and totally smooth running, even in VR. This happens even on the inital load of the project in the packaged build when one of the house levels is started.

If I during runtime open another level with another house the same effect comes back, 10-20 seconds of stuttering and then fine again.

I should say that I use the “open level” command and not loading/unloading streaming levels.

I have worked successfully with very detailed ArchViz scenes in VR before without having this issue. Is this problem due to the fact that sub-levels are in use?

Any suggetions for a solution would be greatly appreciated!

Kind regards,

It’s most likely something to do with loading in textures

Of course hard for you to tell, but do you think that they are too many / unoptimized / big? And is there a way to preload this content while the actual level loads rather than after it starts?

No, that might not necessarily be the issue, you’ll notice the effect in shipped games where textures will pop in after the level loads, if it’s something where it is genuinely taking that much time to load fully the fix would be to have something like a loading screen that keeps things hidden until they’re fully loaded.

Or you have a transition space like a hallway that loads first and then load the rest while still in the transition space. That might not be possible in a house.

I have been loading separate apartments and it only takes a couple of seconds. So maybe your scenes are a bit big and heavy?

The scene might be big and heavy, but since it runs well after a while I would rather want to have everything load properly before actually putting the users into the level. If this is not possible then mabye loading screens is the best option.

You will always have a limited amount of texture memory. If that is already full from the previous scene then the engine needs to unload the old stuff and load the new stuff which will take some time.

This happens also after the inital load of the startup map. But maybe my understanding of this whole thing is limited and it’s not even possible to load everything before the level starts.

What helps a bit is if you make a quick run through the scene on your own before you show the app to anyone. This way at least all shaders are built. Other than that I do have a start/loading screen with an image for how to control the app before I switch to the menu. That way some of the loading happens invisible. I just put a delay node before I enable switching to the main menu. Same when I switch to another apartment. Not sure if that matters too much but I guess you already set the correct texture pool size. Don’t set it higher than necessary. Leave a bit of memory for other apps.