Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Question about Windows Mixed Reality

Discussion in 'Windows Mixed Reality' started by IElectric, Jun 19, 2018.

  1. IElectric

    IElectric

    Joined:
    May 31, 2016
    Posts:
    127
    Hello, I have some questions about the Windows Mixed Reality because I'm working on adding virtual reality feature to my volleyball videogame, https://www.microsoft.com/store/apps/9P5GJQXZL1BQ .

    I have an Acer Visor and I'm using Unity 2018.1 and Visual Studio 2017, these are the questions :

    1) Is normal that with OpenVR the game view inside the visor is more bright than WindowsMR ? OpenVR works on SteamVR, how can I make more bright the WindowsMR game view and why is different ?

    2) I have read on documentation that the HMD visor works on the camera tagged as "main camera" in Unity, but I have more than one camera and I have observed that the visor modify the transform of each camera, how can avoid this ?

    I don't know if someone can help me, thank you very much, best regards...
     
    Last edited: Jun 20, 2018
  2. IElectric

    IElectric

    Joined:
    May 31, 2016
    Posts:
    127
    Hello, I confirm that on my project the view inside the mixed reality visor have different bright than the unity editor, I think to solve this difference by the post processing effects that is applied to the game.

    For the main camera question I have a workaround to use only one camera.

    I have other new question :

    3) Is possible to switch on an than off the virtual reality during the game ?

    I'm using the code that follow and works porpely inside the unity editor but on UWP build version the same code doesn't works, in pratically I switch on the windows mixed reality when a user select a menu option.

    When I push play on Unity editor the game start normally;

    When I select the visor option the game start the Windows mixed reality portal;

    This is what I'm watching inside the editor, I don't know how to take a screenshot from the visor (on my windows device portal I haven't this option);

    The code below works on Unity Editor as Universal Windows Platform but doesn't works on the UWP build version, the game works normally but doesn't switch on the Windows Mixed Reality.

    My target is to have only one game for both standalone UWP and virtual reality WMR, I don't know if it is possible.

    I will be very appreciate if there is someone that can help me, thank you very much, Best regards...

    [the c# code]
    private void EnableVisor()
    {
    #if UNITY_WSA
    this.StartCoroutine(this.LoadVisor("WindowsMR", true));
    #else
    this.StartCoroutine(this.LoadVisor("OpenVR", true));
    #endif
    }

    private void DisableVisor()
    {
    this.StartCoroutine(this.LoadVisor("", false));
    }

    private IEnumerator LoadVisor(string StringVisor, bool BoolEnable)
    {
    UnityEngine.XR.XRSettings.LoadDeviceByName(StringVisor);

    yield return null;

    if(BoolEnable == true)
    {
    UnityEngine.XR.XRSettings.enabled = true;
    Debug.Log("Enable Visor");

    UnityEngine.XR.InputTracking.disablePositionalTracking = true;

    Debug.Log("Recenter Visor");
    UnityEngine.XR.InputTracking.Recenter();
    }
    else
    {
    UnityEngine.XR.XRSettings.enabled = false;
    Debug.Log("Disable Visor");
    }
    }
     
    Last edited: Dec 30, 2018
    andre-ivankio likes this.
  3. IElectric

    IElectric

    Joined:
    May 31, 2016
    Posts:
    127
    Solved, is written in the Unity's documentation, to have a game that works both in Windows mixed reality mode and normal mode it's need to check virtual reality supported in the player settings and add "None" as first device, as next shown…

    4.png

    During the game is possible to switch on the virtual reality at runtime...

    Playing a volleyball game in virtual reality mode is great, it seems to playing a real match, congratulations to all the developers for this feature, Best Regards...
     
    Last edited: Jun 24, 2018
    arufolo likes this.
  4. JasonCostanza

    JasonCostanza

    Unity Technologies

    Joined:
    May 23, 2017
    Posts:
    346
    Hello IElectric, apologies for the lack of replies to your questions. We had a holiday here in the US and most of us have been away on vacations.

    Did you have any remaining issues? It sounds like you worked through all your issues using the documentation, glad you were able to find that. But if not, let me know what you need help with still and we can see what we can do to help.
     
  5. IElectric

    IElectric

    Joined:
    May 31, 2016
    Posts:
    127
    Hello, no problem, I've succeed to publish the virtual reality update of my game on Microsoft Store, thank you very much for your disponibility, If you can try it and let me know what do you think, Best regards...
     
  6. Renanmgs

    Renanmgs

    Joined:
    May 16, 2016
    Posts:
    27
    This just is not working anymore, it starts in normal mode and if i try to click to switch to vr mode nothing happens.
     
  7. JasonCostanza

    JasonCostanza

    Unity Technologies

    Joined:
    May 23, 2017
    Posts:
    346
    Hi @Renanmgs Can you elaborate on your exact issue? I like to clearly define each user from the prior cases just in case there are differences. Let me know some details and maybe we can work something out or have you file a new bug and we can investigate in detail. Thanks!