Search Unity

Expose the Left/Right eye showing for desktop window for SteamVR

Discussion in 'AR/VR (XR) Discussion' started by LucentGames, Jun 29, 2017.

  1. LucentGames

    LucentGames

    Joined:
    Feb 28, 2017
    Posts:
    8
    Hi Guys,

    I've been in touch with Aaron Leiby from Valve regarding an issue with chosen eye for rendering the desktop window for VR games. This is currently effecting all SteamVR first person shooter games made with Unity.

    By default, SteamVR outputs the left eye to the desktop window. This makes streaming or recording footage of an FPS game more difficult than it should be! Since most of our users are right eye dominant, their desktop window won't show the view of them looking down the scope in game and makes for very bad viewing for those wanting to stream and record. I work on Onward, so it's a pretty widely complained about issue with our player base.



    Aaron's response suggests that exposing this functionality might be quite easy and I hoped that by highlighting it to you guys, it might be able to get included with an upcoming Unity version! Ideally the ability to swap on the fly via script, but having it set to right eye by default would be far more ideal (with the left eye dominant users being a large minority).



    The provided link - https://github.com/ValveSoftware/steamvr_unity_plugin/blob/v5/Assets/SteamVR/Scripts/SteamVR_GameView.cs#L35
     
    Last edited: Jun 29, 2017
  2. LucentGames

    LucentGames

    Joined:
    Feb 28, 2017
    Posts:
    8
    Just wondering if there's been any updates on this matter? It's super important for VR FPS games
     
  3. aoleynikov678

    aoleynikov678

    Joined:
    Aug 12, 2015
    Posts:
    8
  4. LucentGames

    LucentGames

    Joined:
    Feb 28, 2017
    Posts:
    8
    Actually, yes! In one of the newer versions of Unity (I can't remember whether it was a late 2017 or a 2018 version it was introduced in though), you are able to choose the default eye that's exposed through SteamVR. We implemented it in Onward as an option for the players.

    This is the code we used to change it -
    UnityEngine.XR.XRSettings.gameViewRenderMode = UnityEngine.XR.GameViewRenderMode.RightEye;
     
    PeterCar and phobos2077 like this.
  5. aoleynikov678

    aoleynikov678

    Joined:
    Aug 12, 2015
    Posts:
    8
    @LucentGames oh. cool! I though that it works only in editor! Thanks!
     
  6. Federica_96

    Federica_96

    Joined:
    Feb 19, 2021
    Posts:
    30
    Hello
    I'm having a problem... I want to see both eyes in the Game View... where can I find this

    Code (CSharp):
    1. UnityEngine.XR.XRSettings.gameViewRenderMode = UnityEngine.XR.GameViewRenderMode.RightEye;
    line of code? Or where do I have to put it?

    To get both eyes game view I think I have to change the line as this:

    Code (CSharp):
    1. UnityEngine.XR.XRSettings.gameViewRenderMode = UnityEngine.XR.GameViewRenderMode.BothEyes;
    Is that right? Thank you!
     
    Last edited: Feb 19, 2021