microsoft / MixedRealityToolkit-Unity

This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
https://aka.ms/mrtkdocs
MIT License
6k stars 2.12k forks source link

Mirroring VR view on Desktop is not working in URP Build #11205

Closed J4CO3 closed 1 year ago

J4CO3 commented 1 year ago

This issue has been migrated a new MRTK repository, and the status of this issue will now be tracked at the following location:


Describe the bug

Mirroring VR to Desktop does not work in Universal Render Pipeline build. Only black screen without Unity loading logo appears. Mirroring works without issues in editor game view and in builds from the MRTKDevTemplate Unity Project that is not URP. Tested with HP Reverb G2 and Oculus Rift.

To reproduce

  1. Create a new Unity project from the 3D (URP) Core template
  2. Import all MRTK 3 features + Mixed Reality Open XR plugin via latest Mixed Reality Feature tool
  3. Activate Open XR plugin in XR Management
  4. Activate WMR Feature Group + Fix "Run in Background" issue in Project Validation
  5. Add Interaction Profiles
  6. Assign default MRTK Profile in MRTK3 Project Settings
  7. Put MRTK XR Rig into scene
  8. Build standalone

Expected behavior

VR view would be mirrored onto desktop screen.

Your setup (please complete the following information)

Target platform (please complete the following information)

Daniel4144 commented 1 year ago

I think I ran into the same problem - for me the culprit was the latest OpenXR Plugin 1.5.3 package. Reverting to 1.4.2 solved the problem for me.

In just noticed that the latest Mixed Reality OpenXR Plugin 1.6.0 has OpenXR Plugin 1.5.3 as dependency, so if you have that installed you also have to revert that to an older version or it will override OpenXR Plugin with the problematic version (Mixed Reality OpenXR Plugin 1.5.1 still worked for me).

KBonds commented 1 year ago

@J4CO3, this seems to be a known Unity issue occurring when the "run in background" option in the project settings is set to false. In versions of the MR OpenXR Plugin before 1.6.0, this was the recommendation of the validator.

For more information, here's a thread discussing what appears to be the same issue you're seeing (example #.2 in this list) https://github.com/microsoft/OpenXR-Unity-MixedReality-Samples/issues/107#issuecomment-1304292396

If you enable the "run in background" option (or run the validator with MR OpenXR Plugin version 1.6.0+), does this resolve your issue?

J4CO3 commented 1 year ago

@Daniel4144, Thank you. Reverting to Mixed Reality OpenXR Plugin 1.5.1 using the Mixed Reality Feature tool and making sure that OpenXR Plugin 1.4.2 is used resolved this issue.

@KBonds, Fixing "Run in Background" in Project Validation for MR OpenXR Plugin version 1.6.0 doesn't resolve this issue in my case. I have also tried changing the focus of the running app using the Win+Y, but that doesn't make it work either.

keveleigh commented 1 year ago

Looks like this might be fixed in Unity's latest release!

image