Search code examples
unity-game-enginehololensmrtk

Hololens Unity app always deploys in 2D instead of 3D


I'm developing an app for the Hololens 1 in Unity, and it runs perfectly fine on the device when using Holographic Remote. However whenever I build and deploy the application through Visual Studio, it then only launches in 2D mode on the Hololens (as a flat "window" you can position in space). What settings control this behaviour?

  • Unity version is 2019.1.4f1,
  • Visual Studio is 2017 Community Edition,
  • I'm on Windows 10.

Developer mode is turned on on both the HL and my desktop. Virtual Reality Support is ticked in Unity, the Mixed Reality SDK is added to the list and the Build settings are on x86 / D3D Project.

I tried replacing my scene with one of the examples from the MRTK, but to no avail. Strangely enough, if I make a clean new project with nothing except the MRTK example in it it does deploy properly, so there must be something in my project interfering. I just can't figure out what.

Expected behaviour is that the application launches in "room scale" mode, i.e. all other applications disappear and the objects in my scene can be viewed in 3D.

EDIT: This has been marked as a possible duplicate. The answers given there do not solve my problem, however. I already made sure that "Virtual Reality Supported" is ticked in the XR settings and the SDK is added to the list. I don't think I have a Windows Insider preview, but since I was able to deploy perfectly fine with a fresh project I don't think that's really the problem...


Solution

  • It appears Vuforia was causing the issues. I got it to deploy in 3D with 'Vuforia Augmented Reality Supported' ticked and the following settings in VuforiaConfiguration:

    • Camera Device Mode: MODE_OPTIMIZED_SPEED
    • Device Type: Digital Eyewear
    • Device Config: Hololens
    • Video Background DISABLED
    • Device Tracker DISABLED

    Furthermore, 'Vuforia' must not be added to the list of Virtual Reality SDKs in XR Settings.

    Note that I have not tried all subsets of these settings individually, some of them might not have an impact whatsoever (except for the last one, I am quite certain adding that SDK will force the app into 2D mode).

    Also note that I haven't verified that Vuforia actually works correctly on the Hololens, just that I can deploy the app in 3D mode with it enabled, given the above settings. If someone could confirm that Vuforia is even supported by MRTK v2?

    EDIT: apparently the problem is also caused by ticking "WSA Holographic Remoting Supported" in the XR Settings, so be sure to disable that.