Search Unity

Cardboard mode shows video horizon distorted, like a fish eye lens

Discussion in 'AR/VR (XR) Discussion' started by jaguardigital, Sep 27, 2019.

  1. jaguardigital

    jaguardigital

    Joined:
    Sep 29, 2015
    Posts:
    5
    Hi

    I'm creating an app for visualizing 360 videos in Unity 2019.2, using Google VR Android Version 1.18.4

    The scene is basically built by a sphere with inverted normals and a camera inside of it. In Player Settings > XR settings, I turned on the Virtual Reality Supported check, and added 2 items: "None" and "Cardboard" VR SDKs.

    When Cardboard mode is ON and I rotate the phone around me (only Y axis), the app shows the video distorted, like a sin wave which goes up and down, as if it had a fish eye lens. When Cardboard mode is OFF, the video shows as intended, with a flat horizon. This happens in Android and iOS

    This is a video capture of both scenarios:


    This is the code I'm using to activate Cardboard

    StartCoroutine(loadVR("Cardboard"));
    ....
    IEnumerator loadVR(string device){
    UnityEngine.XR.XRSettings.LoadDeviceByName(device);
    yield return null;
    UnityEngine.XR.XRSettings.enabled = true;
    }

    Attached you can find images of the same error

    In order to give you an idea of the scene, it's the same as in this tutorial



    Any help will be highly appreciated
     
    Last edited: Sep 27, 2019
  2. jaguardigital

    jaguardigital

    Joined:
    Sep 29, 2015
    Posts:
    5
    In case anybody runs into the same error: The distorsion was caused by the initial rotation of the camera because it wasn't at euler(0,0,0). This also caused the camera to rotate strangely around the Z axis, whenever the Y axis reach certain point of rotation (I don't know exactly which one)