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

Resolved Secondary Camera with Oculus XR overriding frustum

Discussion in 'VR' started by green-giant, Nov 7, 2020.

Thread Status:
Not open for further replies.
  1. green-giant

    green-giant

    Joined:
    Jun 21, 2013
    Posts:
    43
    I have blank project with XR (Oculus) xr rig and a secondary orthographic camera outputting to a render target. At playtime the orthographic camera's view frustum seems to be over written with the one of the xr camera.

    I tried to set the camera's projectionMatrix in code from LateUpdate() and OnPreRender() but no effect.

    Code (CSharp):
    1. camera.projectionMatrix = Matrix4x4.Ortho(-1, 1, -1, 1, 0.001f, 1);
    How can I preserve my secondary cameras view frustum?

    Just to note, I am NOT using the Oculus asset package, it is just the XR plugin
     
  2. jj-unity

    jj-unity

    Unity Technologies

    Joined:
    Jan 4, 2017
    Posts:
    69
    Is the Target Eye on your orthographic camera set to None?
     
  3. jeffries7

    jeffries7

    Joined:
    Jun 25, 2014
    Posts:
    59
  4. green-giant

    green-giant

    Joined:
    Jun 21, 2013
    Posts:
    43
    I know Target Eye used to be a property on cameras, but I havent seen it in a while. I am in Unity 2019.4.13 using the URP

    Is it still a thing, and if so how can I set it, since it doesnt seem to be visible in the Inspector window?
     
  5. korinVR

    korinVR

    Joined:
    Jul 7, 2012
    Posts:
    30
    PaulTheForger and ctaggart27 like this.
  6. green-giant

    green-giant

    Joined:
    Jun 21, 2013
    Posts:
    43
  7. jeffries7

    jeffries7

    Joined:
    Jun 25, 2014
    Posts:
    59
    Life saver, that was the issue. Oddly enough I was only having this issue when using a render texture in conjunction with at UI canvas.
     
  8. Shaunyowns

    Shaunyowns

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    328
Thread Status:
Not open for further replies.