Splash Screen for Hybrid Rendering

I have a hybrid app, it starts in an unbounded polyspatial setup and eventually transitions into a metal at some point when I want to render some different things.

The older version of my app that only used PolySpatial used to have a starting screen that looks like this:

But now when my hybrid app starts there is a 20-30 second stretch of no visual feedback.

I’ve been messing with the xCode project to try and create my own splash screen for about a week but I’m just not getting it.

Worst case I’d be happy with the ugly default splash screen returning. So if anyone knows how to get that to show up in a hybrid app that would be amazing.

But I think ideally I get my custom splash screen working. Has anyone achieved this with a hybrid app?

I tried adding a new WindowGroup to the default scene in the body that launches. Then in the app delegate I moved Unity launching out into a seperate function that gets delayed a frame. But this only works if I removed “unityVisionOSCompositorSpace” from the “mainScene” because when the app delegate finishes initializing and it tries to show the UI it initializes “unityVisionOSCompositorSpace” which only can be done if Unity is fully launched.

Also tried modifying the “unityVisionOSCompositorSpace” so it could initialize which made the app launch correctly with my fake splash screen. But then when I try to switch to metal mode I get some UnityGfxDeviceWorker errors so I assume the compositor space actually failed to initialize without telling me.

I feel like me asking for this info is a bit of a long shot as I doubt many are making hybrid apps at the moment. But this is basically my final blocker for getting the app out so any advice or ideas would be great.

Hi there! Sorry to hear you’re having trouble.

Ugly or not, that’s just what visionOS gives you when your default SwiftUI scene is a WindowGroup. :slight_smile:
You can get this back in your Unity project by setting the default volume configuration (Project Settings > PolySpatial - Default Volume Camera Window Config) to one that is in Bounded mode. That should put a WindowGroup at the top of the SwiftUI scene, and the app will launch with a default loading window like you see in that screenshot. It will have your app icon in the center (yours shows the “null” icon).

Was it the first item in the scene? The order matters. VisionOS will always launch the first scene in the list, regardless of what your Volume Cameras are doing. In the case I described above, the whole point of changing the default config is to change how Unity writes out the swiftUI scene, ensuring that default volume configuration (which translates to a named WindowGroup) is first.

Yeah, you’re not going to have much luck with that. :slight_smile: The compositor space “branches” off right at the ImmersiveSpace which can’t have anything aide from the CompositorLayer in it, and as you discovered, we have to start things just so if the compositor layer is the startup scene. You should be able to have what you want as long as your custom WindowGroup is the first scene in the swiftUI app body. Also, if you try adding code to automatically close the startup window, bear in mind that dismissWindow won’t do anything if you try to dismiss the only open window or volume. There’s a quick mention of that in this documentation but no warning/error to tell you what’s wrong. It just… doesn’t do anything. :upside_down_face: If you want to programmatically dismiss your splash screen window you need to make sure the immersive space or at least one other window/volume for your app is open.

Thanks so much for the tips! Things are much better now and I’m handling most things in Unity. Defaulting to bounded gives me the native loading screen. Then I put a rig in the initially loaded scene with my planned splash screen logo.

My loading times are terrible (49 seconds) but at least I have visual feedback. I still have 6 seconds in between going from bounded to unbounded where my my main UI is but that’s probably because I’m remaking the rig. Also I have about 15 seconds of setting up different networking services I could probably cut down.

Anyway, thanks for the help :slight_smile: Looking forward to getting my app live.

Nice! Glad to hear you’re on your way :slight_smile:

Solved my long load by manually switching to “release” in xCode. I have a feeling the Unity setting either doesn’t work right now or doesn’t work as I think it does. Seems to always default to debug

That change plus setting the default to bounded mode makes my app launch feel decently smooth and quick (~5 seconds)