Packaged build + oculus rift + sublevel = black screen

I am just copying from here: https://answers.unrealengine.com/questions/587192/packaged-build-oculus-rift-sublevel-black-screen.html to get more visibility on the issue as we’ve been pulling our hair out about this

Everything works perfectly within PIE. I’ve got one of the funkiest bugs. When I view my game through the Oculus Rift on a packaged build and the level I am viewing has sub levels and any of those sublevels contain objects, my oculus rift is completely black and I can’t see anything. I have created a very basic level, which contains a cube, directional light source, player start, and atmospheric fog. I have a persistent level and a sub level. The sublevel only contains a static mesh and it is loaded by default and visible.

If I play the game within the editor, everything renders just fine within the Oculus Rift.

If I package the project, Oculus goes black.

If I switch from the Oculus Rift to the HTC Vive, everything renders just fine.

If I take the static mesh and move it into the persistent level, everything renders just fine in the packaged build.

Moving the mesh from the sublevel to the persistent level reliably toggles whether the oculus rift display is black (I can still see guardian boundaries when its black, so I’m getting video).

For the sake of testing, I even turned off the SteamVR plugin because Oculus has claimed that the plugin causes problems.

I created a blank project and created two levels. One is the persistent level, the other is a sublevel. The sublevel has the very same static mesh which causes a black display in my game project. When I package the game and run the level with the same level structure and configuration, it works perfectly. I can’t repro this in a blank project with the same settings and asset.

My solution was to set the sublevels to be unloaded by default. Once the player enters into the persistent level, I have a short delay node followed by manually loading in the sublevels. I know that viewing the persistent level without any other levels loaded works, so it’s a matter of loading in the sublevels when we finally have visuals. I too have no idea why this happens, exclusively on oculus, exclusively on packaged builds, exclusively on maps with sub levels.

A solution that worked for us was posted to the answer hub link above:

I had a similar problem on Oculus only (worked fine on Vive). The Oculus runtime was leaving the loading splash screen up which is black by default. Something had caused the Oculus plugin to not recognize that loading had completed. I worked around it by adding a “Hide Loading Splash Screen” with clear set to true from begin play on the level blueprint. If you are seeing the same problem, you’ll see in the log where the Oculus blacks the screen: LogHMD: FOculusRiftSplash::PushBlackFrame LogHMD: FOculusRiftSplash::Show But then won’t see the corresponding FOculusRiftSplash::Hide.

I’m using 19.2 & Rift CV1 and got the same problem … This aint work… I found that maybe it’s because the game state didn’t change to InProgress correctlly, which caused no ‘Load End’ and ‘Splash Hide’ got processed.

Here’s a part of the log file:
"
[2018.06.17-03.18.25:740][667]LogLoadingSplash: Loading begins
[2018.06.17-03.18.25:751][667]LogHMD: FSplash::OnShow

[2018.06.17-03.18.25:751][667]LogLoad: LoadMap: /Game/地图/MainMenu
[2018.06.17-03.18.26:057][667]LogAIModule: Creating AISystem for world MainMenu
[2018.06.17-03.18.26:057][667]LogLoad: Game class is ‘MaldeeGameMode_Menu_C’

[2018.06.17-03.18.26:059][667]LogWorld: Bringing World /Game/地图/MainMenu.MainMenu up for play (max tick rate 0) at 2018.06.17-11.18.26
[2018.06.17-03.18.26:059][667]LogSlate: New Slate User Created. User Index 8, Is Virtual User: 1
[2018.06.17-03.18.26:059][667]LogSlate: Slate User Registered. User Index 8, Is Virtual User: 1
[2018.06.17-03.18.26:060][667]LogWorld: Bringing up level for play took: 0.002000
[2018.06.17-03.18.26:060][667]LogGameMode: FindPlayerStart: PATHS NOT DEFINED or NO PLAYERSTART with positive rating
[2018.06.17-03.18.26:060][667]LogGameMode: Display: Match State Changed from EnteringMap to WaitingToStart
[2018.06.17-03.18.26:060][667]LogGameState: Match State Changed from EnteringMap to WaitingToStart
[2018.06.17-03.18.26:060][667]LogGameMode: Display: Match State Changed from WaitingToStart to InProgress
[2018.06.17-03.18.26:060][667]LogGameState: Match State Changed from WaitingToStart to InProgress
[2018.06.17-03.18.26:060][667]LogLoadingSplash: Loading ends
[2018.06.17-03.18.26:060][667]LogHMD: FSplash::OnHide
[2018.06.17-03.18.26:065][667]LogLoad: Took 0.313032 seconds to LoadMap(/Game/地图/MainMenu)

[2018.06.17-03.18.33:098][296]LogGameMode: Display: Match State Changed from InProgress to LeavingMap
[2018.06.17-03.18.33:098][296]LogGameState: Match State Changed from InProgress to LeavingMap
[2018.06.17-03.18.33:098][296]LogNet: Browse: /Game/地图/MainWorld
[2018.06.17-03.18.33:098][296]LogLoadingSplash: Loading begins
[2018.06.17-03.18.33:109][296]LogHMD: FSplash::OnShow

[2018.06.17-03.18.33:109][296]LogLoad: LoadMap: /Game/地图/MainWorld
[2018.06.17-03.18.33:119][296]LogSlate: Slate User Unregistered. User Index 8
[2018.06.17-03.18.33:119][296]LogSlate: Slate User Destroyed. User Index 8, Is Virtual User: 1
[2018.06.17-03.18.36:387][296]LogAIModule: Creating AISystem for world MainWorld
[2018.06.17-03.18.36:387][296]LogLoad: Game class is ‘MaldeeGameMode_Main_C’
[2018.06.17-03.18.36:487][296]LogUMG: Display: Widget Class UMG_Seq_Footprint0_C - Loaded Fast Template.
[2018.06.17-03.18.36:488][296]LogWorld: Bringing World /Game/地图/MainWorld.MainWorld up for play (max tick rate 0) at 2018.06.17-11.18.36
[2018.06.17-03.18.36:572][296]LogWorld: Bringing up level for play took: 0.185915
[2018.06.17-03.18.36:573][296]LogGameMode: Display: Match State Changed from EnteringMap to WaitingToStart
[2018.06.17-03.18.36:573][296]LogGameState: Match State Changed from EnteringMap to WaitingToStart
[2018.06.17-03.18.36:573][296]LogGameMode: Display: Match State Changed from WaitingToStart to InProgress
[2018.06.17-03.18.36:573][296]LogUMG: Display: Widget Class UMGMainWorld_PlayerNotification_C - Loaded Fast Template.
[2018.06.17-03.18.36:574][296]LogLevel: ActivateLevel /Game/地图/MainWorld_A 1 1 0
[2018.06.17-03.18.36:574][296]LogLevel: ActivateLevel /Game/地图/MainWorld_C 1 1 0
[2018.06.17-03.18.37:114][296]LogSlate: FSceneViewport::OnFocusLost() reason 2
[2018.06.17-03.18.37:116][296]LogUMG: Display: Widget Class UMGMainWorldMainMenu_C - Loaded Fast Template.
[2018.06.17-03.18.37:116][296]LogSlate: New Slate User Created. User Index 8, Is Virtual User: 1
[2018.06.17-03.18.37:116][296]LogSlate: Slate User Registered. User Index 8, Is Virtual User: 1
[2018.06.17-03.18.37:117][296]LogSlate: Slate User Unregistered. User Index 8
[2018.06.17-03.18.37:117][296]LogSlate: Slate User Destroyed. User Index 8, Is Virtual User: 1
[2018.06.17-03.18.37:117][296]LogSlate: Slate User Unregistered. User Index 8
[2018.06.17-03.18.37:117][296]LogSlate: New Slate User Created. User Index 8, Is Virtual User: 0
[2018.06.17-03.18.37:117][296]LogSlate: Slate User Registered. User Index 8, Is Virtual User: 0
[2018.06.17-03.18.37:117][296]LogSlate: Slate User Destroyed. User Index 8, Is Virtual User: 0
[2018.06.17-03.18.37:118][296]LogSlate: New Slate User Created. User Index 8, Is Virtual User: 1
[2018.06.17-03.18.37:118][296]LogSlate: Slate User Registered. User Index 8, Is Virtual User: 1
[2018.06.17-03.18.37:119][296]LogLevel: ActivateLevel /Game/地图/MainWorld_A 0 0 0
[2018.06.17-03.18.37:119][296]LogLevel: ActivateLevel /Game/地图/MainWorld_C 0 0 0
[2018.06.17-03.18.37:121][296]LogGameState: Match State Changed from WaitingToStart to InProgress
[2018.06.17-03.18.37:123][296]LogLoad: Took 4.013268 seconds to LoadMap(/Game/地图/MainWorld)
[2018.06.17-03.18.37:166][296]LogStaticMesh: Allocated 512x242x64 distance field atlas = 15.1Mb, with 41 objects containing 9.6Mb backing data
"