MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

Loading overlays for Windows Mixed Reality in Unity

Open subzero110 opened this issue 9 years ago • 8 comments

It seems that Steam and OVR plugins in Unity ship with a script that can be used during transitions (scene change, load behavior, etc.) to display overlays (instead of the screen going all dark). This is a pretty useful out-of-box script that anyone can use while developing their games.

Attached are the scripts.

Can we do something similar for Windows MR, so that not everyone has to write one from scratch?

OVROverlay.cs.txt SteamVR_Overlay.cs.txt

subzero110 avatar Aug 15 '17 19:08 subzero110

@subzero110 - In the Dev_Unity_2017.2 branch, in the Utilities/Scripts area, there is a fadescript script. Check that out and see if that is similar to what you are talking about, or maybe that's what we need to extend for this.

jessemcculloch avatar Aug 15 '17 19:08 jessemcculloch

I'd like to second that request. The FadeScript seems to be something else. What we are talking about, as implemented in Steam and OVR, is the ability to set an image (i.e. a Sprite in Unity) to be displayed on the HUD of the headset without any Unity involvement. (In Steam and OVR, the image is displayed only on the HUD (not in the mirror view), so I believe it is a rather low-level access mechanism).

This is super-helpful for displaying loading screens in-between scenes. I.e. you fade out, display that image, and then load a new scene (synchronously) in Unity, all the while only displaying the loading image, no hickkups. When the loading is done, you remove the image and fade in your scene. The loading screen is thus independent of any one scene.

In OVR: OVRPlugin.SetOverlayQuad(isOverlayInsteadOfUnderlay, isHeadLocked, nativeTexture, nativeTexture, IntPtr.Zero, pose.flipZ().ToPosef(), scale.ToVector3f());

In SteamVR: OpenVR.Overlay.CreateOverlay(key, overlayName, ref loadingScreenOverlayHandle);

This is currently one of the things holding us back in porting our Vive/Rift game to the Windows Store; we are looking into workarounds, but this would be a great addition for the WMR toolkit.

plmayer avatar Nov 20 '17 10:11 plmayer

One other thing to keep in mind is that if we add anything to the Mixed Reality Camera Parent then we also need a way to disable this overlay so it doesn't impact performance.

StephenHodgson avatar Nov 20 '17 15:11 StephenHodgson

@StephenHodgson @jessemcculloch I've noticed that the Haptics implementation only works at runtime, and by directly calling Windows API. Is there any way to do something similar for a screen overlay? If there are classes in the Windows API which can do this I'd really appreciate a tip. Thanks.

I've not found a workaround for this, and the issue with Unity Scene loading is that, whether using additive or not, or asynchronous loading or not, the WMR headset blanks out during the scene loading process which makes the user wonder whether the app has crashed (our scene takes ~10 second to load). I've posted about this here: https://forum.unity.com/threads/vr-camera-additive-scene-loading-previous-scene-doesnt-stay-visible.505732/

plmayer avatar Nov 25 '17 10:11 plmayer

I'm also looking for a way to do this.

265lutab avatar Dec 16 '17 00:12 265lutab

@StephenHodgson I am still interested in this feature - any updates?

plmayer avatar Mar 28 '18 12:03 plmayer

None yet

StephenHodgson avatar Mar 28 '18 16:03 StephenHodgson

Closing issues older than 180 days. If this is still an issue, please reactivate with recent information.

wiwei avatar Apr 11 '19 20:04 wiwei