Hi,
The simplest way to verify there is a problem is that if you print out the values of OVRCameraRig.leftEyeCamera.projectionMatrix and OVRCameraRig.rightEyeCamera.projectionMatrix, they have the same coefficients, while they should be different as we are in parallel stereo/asymmetric frusta.
In my scenario I’m using these projection matrices to render a scene in an external renderer and merge it back in Unity. The left eye projection matrix is perfect, the right eye projection is slightly wrong. Close objects are well aligned with local Unity objects but the further from the camera the more divergence.
This points to me that the Unity renderer doesn’t internally use OVRCameraRig.rightEyeCamera.projectionMatrix for its own rendering, and that this matrix is actually the projection for the left eye. How can I get the correct right eye projection matrix used by Unity?
I’m using single pass stereo, the OVRCameraRig is from Oculus Unity Utilities v1.18.1 but the same issue existed with older versions. Unity 2017.1.1.
I also tried Camera.GetStereoProjectionMatrix(Camera.StereoscopicEye), but again this returns the same projection matrix for both eyes which is wrong.
I also tried OVRPlugin.GetEyeFrustum(eyeId) but this returns a Frustumf which is a symmetric frustum by construction and thus cannot be the correct projection matrix.
I also tried to use OVRPlugin.CalculateLayerDesc because the LayerDesc structure contains a Fovport for each eye (the tan angles in each direction), but the fov port is not filled in by that function.