Skip to main content
Up and Coming
September 28, 2016

How to display stereo photosphere in Unity - Gear VR

I am following this tutorial to view Stereo image in Unity3D. Unfortunately it only covers Oculus Rift and Google Cardboard. Both of there SDKs have two separate cameras for left eye and right eye. Here is a summary of how to do it:

  1. Create 2 spheres for both eyes and place them at origin.
  2. Put them in different layers (left and right).
  3. Set culling mask of each camera (left eye and right eye) to left layer and right layer respectively.

PROBLEM:

In Gear VR camera setup, Oculus SDK is using only one camera component which is on CenterEyeAnchor child of OVRCameraRig:

I don't know how to apply the above procedure in this case. I know there are 2 transforms LelftEyeAnchor and RightEyeAnchor which are used for stereo view but There is always one camera in the scene. Is there a way to achieve stereo rendering for this setup?

Thanks in advance.

    This topic has been closed for replies.

    11 replies

    October 26, 2016
    OVRCameraRig script has an option Use Per Eye Cameras to enable/disable per eye cameras. 
    Up and Coming
    November 3, 2016
    I don't see anything in inspector.



    I have also checked the script, there are properties for left/right cameras:
    public Camera leftEyeCamera { get; private set; }
    public Camera rightEyeCamera { get; private set; }
    but only assignment reference I can find is this:
    leftEyeCamera = centerEyeCamera;
    rightEyeCamera = centerEyeCamera;
    Inspiring
    November 3, 2016
    Please update to the latest Utilities.
    Up and Coming
    November 3, 2016
    Thanks for responses. I just updated to vs 1.9.0 and it serves the purpose but it created another issue for me:
    I am using OVRInputModule from from this post. And due to changes in OVRInput.cs single tap on touchpad is firing click twice. So its impossible for me to turn a toggle off. I was using Utilities vrsion 1.7.0 before.
    Does anyone know how to fix this?
    Inspiring
    November 3, 2016
    OVRInputModule needs to be updated to use OVRInput's touchpad support instead of the deprecated OVRTouchpad script. We will do that soon. As a quick hack, you could comment out "OVRTouchpad.Update();" from OVRTouchpad.cs.
    Up and Coming
    November 3, 2016
    Thanks for responses. I just updated to vs 1.9.0 and it serves the purpose but it created another issue for me:
    I am using OVRInputModule from from this post. And due to changes in OVRInput.cs single tap on touchpad is firing click twice. So its impossible for me to turn a toggle off. Does anyone know how to fix this. I was using Utilities 1.7.0 before.
    November 4, 2016
    I'm having the same issue, Dave. Commenting out OVRTouchpad.Update(); (and in fact all references to OVRTouchpad) doesn't change anything. Changing the joyPadClickButton to None solves it, but may break joypad functionality (can't test that at the moment). Alternatively, commenting out lines 877 - 882 seems to work too.
    #if UNITY_ANDROID && !UNITY_EDITOR
    // On Gear VR the mouse button events correspond to touch pad events. We only use these as gaze pointer clicks
    // on Gear VR because on PC the mouse clicks are used for actual mouse pointer interactions.
    pressed |= Input.GetMouseButtonDown(0);
    released |= Input.GetMouseButtonUp(0);
    #endif


    Edit: On further investigation, commenting out 877 - 882 seems to break touchpad swiping/scrolling (at least in Scroll View)
    Inspiring
    November 4, 2016
    The new behavior of OVRInput was introduced in 1.9. We have a change to OVRInputModule that we'll release in 1.10 to properly support it. In the meantime can you downgrade to Utils 1.8.0?
    Up and Coming
    November 4, 2016

    vrdaveb said:

    OVRInputModule needs to be updated to use OVRInput's touchpad support instead of the deprecated OVRTouchpad script. We will do that soon.


    If you are updating OVRInputModule at all, here is another issue which I have came across. At the moment OVRInputModule only supports single click. In case, I am looking at a scroll view (with some buttons as childs) and swipe on touchpad to scroll it. I will end up clicking on one of button. Even if I implement OVRTouchpad.TouchHandler event and handle swipe manually. It still process clicks which is annoying. Am I doing anything wrong?

    EDIT :
    I can see following code in the script but these variables are not used anywhere else.

    #region GearVR swipe scroll
    private Vector2 swipeStartPos;
    private Vector2 unusedSwipe;
    #endregion
    Up and Coming
    November 4, 2016
    If I am using older version of script, is there any repository where I can find newer/updated version of OVRInputModule?