cancel
Showing results for 
Search instead for 
Did you mean: 

OvrPlugin.ipd doesn't work on gear vr

tdsgearvr2
Explorer
Hey guys,

From Unity, it seems that the parameters "Stereo Separation" and Stereo Convergence" don't affect anythings. At least I didn't find the code that change any proprieties in the platform libs.
I tried to use OvrPlugin.ipd but it's doesn't work, always return the default ipd 64mm. it means that on gear vr the sdk lock the ipd? maybe because the hw can't change the ipd of lens? 

I have also the same problem with OVRProfile.eyeHeight. I need to change it but I can't find a way

Thanks
8 REPLIES 8

vrdaveb
Oculus Staff
OVRPlugin is not a public API. To scale the IPD, please scale the Camera as a whole by making it the child of a GameObject and setting Transform.localScale on that. The benefit to using scale instead of directly setting IPD is that head motion will match stereo separation, which is important for comfort.

tdsgearvr2
Explorer
do you have links ore references? how much scale?
for example, I'd like to reach 40mm, I have to scale the parent x to 0.625? (because the default is 63mm)

tdsgearvr2
Explorer
and what about OVRProfile.eyeHeight? to change it I have to scale the parent y?

Thanks

vrdaveb
Oculus Staff
do you have links ore references? how much scale? 

Here is the doc.

> I'd like to reach 40mm, I have to scale the parent x to 0.625? (because the default is 63mm)

The default varies per-user based on their calibration. Try this:
    rig.trackingSpace.localScale = Vector3.one * (0.04f / Vector3.Distance(rig.leftEyeAnchor.position, rig.rightEyeAnchor.position));

what about OVRProfile.eyeHeight?

OVRProfile.eyeHeight is currently hard-coded to return an average height across all users. If you want to use another value, set OVRPlayerController.useProfileData = false and then set the Y position of the OVRCameraRig to whatever you want.

tdsgearvr2
Explorer
Thanks man.

the last question, what exactly means eyeDepth, it looks like stereo convergence? and if so how to change it in gear vr.

vrdaveb
Oculus Staff
There is no stereo convergence setting. The cameras need to point parallel to match the optics of the VR headset. Eye depth is the z distance between the center of head rotation (the base of your neck) and the camera position (your eye). Again, on Gear VR this is hard-coded to an average value for all users.

tdsgearvr2
Explorer
Thanks for your great help 🙂

ShawnFeatherly
Explorer
This post came up while doing some Googling. I found setting a custom IPD for the Rift to work in Unity 2018.2.0f1 with the follow:

        float myDreamIpd = 0.042f; // enter the IPD in meters
        var leftEye = UnityEngine.XR.InputTracking.GetLocalPosition(UnityEngine.XR.XRNode.LeftEye);
        var rightEye = UnityEngine.XR.InputTracking.GetLocalPosition(UnityEngine.XR.XRNode.RightEye);
        float hardwareIpd = Vector3.Distance(leftEye, rightEye);

        float scale = myDreamIpd / hardwareIpd;
        Camera.main.transform.localScale = new Vector3(scale, 1, 1);