Search Unity

unity_StereoEyeIndex broken in 5.6.0f3 or just not behaving as expected?

Discussion in 'Shaders' started by EddieOffermann, May 4, 2017.

  1. EddieOffermann

    EddieOffermann

    Joined:
    Sep 13, 2015
    Posts:
    13
    My situation:
    VR-related custom shader. Various tweaks in the vert function to select from an over/under texture to display to each eye, various other behaviors. Shader logic in general is fine. I get what I expect from everything but the following:

    This is always true (and obviously shouldn't be):
    if (unity_StereoEyeIndex == 0) {
    // Logic
    }

    This works as expected:
    if (unity_CameraProjection[0][2] < 0) {
    // Logic
    }

    Tested with GoogleVR SDK, both Daydream and Cardboard.
     
  2. catox

    catox

    Joined:
    Dec 19, 2014
    Posts:
    15
    unity_StereoEyeIndex should only be effected in single-pass stereo mode, and as far as I know, only GearVR support that offically on mobile VR platform.
     
  3. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,348
    For sure won't work for GoogleVR or Cardboard, but should work with Daydream if Single pass stereo is enabled. It might only be working in the latest 5.6 / 2017 builds though.