Search Unity

Detecting Single Pass Stereo Rendering enabled at runtime from script

Discussion in 'AR/VR (XR) Discussion' started by Kronnect, Feb 24, 2017.

  1. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,904
    Hi !

    Does anyone know how to check if Single Pass Stereo Rendering is enabled at runtime from script (not from shaders)?
    Currently I have a "redundant" setting in a custom inspector that gets set/cleared aligned with the editor setting but I'd like to get rid of this value.

    Seems VRSettings class does not expose this setting or at least I have not found it.

    Thanks.
     
  2. PawelPodzus

    PawelPodzus

    Joined:
    Oct 11, 2016
    Posts:
    1
    Bump. Need access to this as well.
     
    Kronnect likes this.
  3. DanielDickinson

    DanielDickinson

    Joined:
    Aug 4, 2013
    Posts:
    278
    Check out PlayerSettings.StereoRenderingPath :).
     
  4. cecarlsen

    cecarlsen

    Joined:
    Jun 30, 2006
    Posts:
    862
    But that would only work in the editor (PlayerSettings exists in UnityEditor namespace).
     
  5. DanielDickinson

    DanielDickinson

    Joined:
    Aug 4, 2013
    Posts:
    278
    Seems you are correct, perhaps you could cache this variable in editor? but that does seem a bit of a hack. If I find something better I'll let you know.
     
    cecarlsen likes this.