Is there any way in Unity to get the stereo view and projection matrices for the Hololens? I really want to save the previous frame’s view and proj matrices for various effects. I’ve tried everything I can think of:
- Camera.GetStereoViewMatrix and Camera.GetStereoProjectionMatrix are always identity.
- The camera’s transform/Camera.worldToCameraMatrix and GL.GetGPUProjectionMatrix do not produce correct View-projection matrices. In fact they are always the same for both cameras. (NOTE: I use two cameras with stereoTargetEye set to Left and Right to locate the separate camera passes)
- I’ve tried Material.GetMatrix(“UNITY_MATRIX_V”) and Material.GetMatrix(“UNITY_MATRIX_P”), which always fail, likely because they are packed in Constant Buffers (UnityShaderVariables.cginc).
- I’ve tried writing a native UWP dll that manually extracts camera poses from a HolographicFrame, yet HolographicSpace::CreateForCoreWindow barfs (SEH) because Unity has already done it for the app’s CoreWindow.
Am I missing something? These seems like fundamental data that should be readily available.