Search Unity

Question Camera.SetStereoViewMatrix not working (2020+)

Discussion in 'VR' started by crysis1331, Apr 21, 2021.

  1. crysis1331

    crysis1331

    Joined:
    Nov 23, 2018
    Posts:
    1
    I wanted to upgrade my project from 2019.4 (Virtual Reality Supported tick) to 2020.3 with XR Plugin Management (tested both Oculus and OpenXR). I was using Camera.SetStereoViewMatrix function to rotate cameras for each eye in addition to headset movement. Now using it does not change anything and also stereoEnabled on main camera returns false. I'm using URP and XR Interaction Toolkit.

    I set up a fresh project with just an XR Rig on the demo scene with a script from here https://docs.unity3d.com/ScriptReference/Camera.SetStereoViewMatrix.html and it didn't work either (also tested on 2021.1.3).

    Is there any way to do this or should I stick with the older version of Unity for now?
     
    ModLunar and david-mal like this.
  2. thep3000

    thep3000

    Unity Technologies

    Joined:
    Aug 9, 2013
    Posts:
    400
  3. david-mal

    david-mal

    Joined:
    Nov 27, 2017
    Posts:
    6
    Rickmc3280 likes this.
  4. Rickmc3280

    Rickmc3280

    Joined:
    Jun 28, 2014
    Posts:
    189
    ModLunar likes this.
  5. ModLunar

    ModLunar

    Joined:
    Oct 16, 2016
    Posts:
    374
    I'm also wondering why there seems to be no easy way to set camera.stereoEnabled..
    Even after converting the main camera to an "XR Rig" with the following 2 packages, it's still always false:

    "com.unity.xr.management": "4.2.1",
    "com.unity.xr.openxr": "1.2.8"

    upload_2022-1-20_18-26-28.png

    Kind of confused how to get stereo double-wide rendering working. (Note that I've never done VR development before, so maybe this is obvious?)