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.
  2. Dismiss Notice

Question VR with additional camera for spectator God's eye view in URP

Discussion in 'VR' started by ShaunUnity, Nov 10, 2021.

  1. ShaunUnity

    ShaunUnity

    Joined:
    Dec 8, 2017
    Posts:
    26
    I'm working on an on-location VR project for the HTC Vive in Unity 2019.3.0f6 (tried 2020.3.16f1 too) that incorporates a 2nd monitor. We are using this script from Unity. https://docs.unity3d.com/Manual/MultiDisplay.html

    Camera 1 is the VR cam. Target Display: Display 1, Target Eye: Both

    Camera 2 is a spectator cam. Target Display: Display 2, Target Eye: None

    When we build the game either the headset or the 2nd monitor does not work. I've see a few others with this problem.

    First, does anyone have a solution?

    Second, is this a general VR issue, or a URP issue?
     
    Ali_V_Quest likes this.
  2. ShaunUnity

    ShaunUnity

    Joined:
    Dec 8, 2017
    Posts:
    26
    Bump. Anyone?
     
  3. Charlicopter

    Charlicopter

    Joined:
    May 15, 2017
    Posts:
    123
    Hi, did you figure this out?

    All you have to do is add a second camera and set the target display to "Display 1", then set the Target Eye to "None"
     
  4. MrYellow

    MrYellow

    Joined:
    Sep 4, 2015
    Posts:
    2
    For some reason, in 2021.3, you also need to lower the render priority of the VR camera in the camera component settings (or raise the priority of the spectator camera) in order to view both cameras on their respective displays.
     
    Fletcher-Studios and troyspencer like this.
  5. djarcas

    djarcas

    Joined:
    Nov 15, 2012
    Posts:
    234
    How do you set render priorities for cameras with URP? I can't get this to work outside of the editor.
     
  6. djarcas

    djarcas

    Joined:
    Nov 15, 2012
    Posts:
    234
    Would also like to know if @ShaunUnity found a solution to this, as it's driving me mad here!
     
  7. Fletcher-Studios

    Fletcher-Studios

    Joined:
    Sep 25, 2014
    Posts:
    11
    Dunno if its different in other versions, but I'm using 2020.3.48f1 and in the spectator camera inspector under Rendering is a field called Priority and I changed mine to 1 while my VR camera rig is 0