Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

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,843
    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:
    400
    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.