Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question How can I prevent a VR scene from being displayed on the hmd and on the computer screen on build?

Discussion in 'VR' started by jma00049, Oct 19, 2021.

  1. jma00049

    jma00049

    Joined:
    Feb 21, 2019
    Posts:
    89
    Hello, I have a VR project in Unity 2020.3.7. I am using HTC Vive Pro Eye with SteamVR. When I make the build and I run it, on my computer screen I can see the same as the person who wears the HMD but I don't want the scene to be rendered for the computer screen. I just want the user who wears the HMD to see the scene so I can achieve better performance. How can I do that?

    Thanks.
     
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,768
    There's two ways you could approach this. You could try using XR.XRDisplaySubsystem.SetPreferredMirrorBlitMode (https://docs.unity3d.com/ScriptReference/XR.XRDisplaySubsystem.SetPreferredMirrorBlitMode.html) to set the mirror blt mode to `None`.


    You could also try using `XRSettings.gameViewRenderMode` (https://docs.unity3d.com/ScriptReference/XR.XRSettings-gameViewRenderMode.html) to disable this as well.

    Please let me know if that helps! If not, I can circle back with the team for more advice!
     
    RedRiverStudio and DevDunk like this.
  3. jma00049

    jma00049

    Joined:
    Feb 21, 2019
    Posts:
    89
    I will try that. Thank you!
     
  4. RedRiverStudio

    RedRiverStudio

    Joined:
    Sep 8, 2014
    Posts:
    136
    This has been very helpful, but does anybody know how to render some sort of splash screen so its not just a black rectangle?
     
  5. thep3000

    thep3000

    Unity Technologies

    Joined:
    Aug 9, 2013
    Posts:
    383
    For built-in renderer you can add another camera with "target eye" = none / main display. And then use culling mask / layers to choose what is rendered by that camera. For URP you'll have to do some scripting pipeline modifications, I think.