I’m using a variety of builds of Unity, ranging from 2018 - 2019. For this discussion, I’m using 2019.2.7f2.
I need to know the exact different between calling camera.worldToCameraMatrix = xxx VS camera.SetStereoViewMatrix( eye, xxx ).
Q1: does setting camera.worldToCameraMatrix mean “for the current eye”, and I would want to move it once per L/R eye pair, or does it mean, “set the center of the camera there, and Unity will move the camera slightly L or R to account for stereo” ??
The example in Unity code shows calling SetStereoViewMatrix with the result of camera.worldToCameraMatrix. Actually it shows this for both the L and R cameras, plus or minus some offsets. This is sort of misleading (at least to me).
Q2: does calling camera.SetStereoViewMatrix modify camera.worldToCameraMatrix? If that was the case, then the above example in the docs becomes pretty weird. recursive, sort of. If calling it doesn’t modify camera.worldToCameraMatrix, then how does camera’s worldToCameraMatrix affect the camera when you’re currently calling camera.SetStereoViewMatrix? (or, does it not affect the camera). Are the two modifications additive, or exclusive?
Q3: when I call camera.SetStereoViewMatrix(), in my VR app (Windows Mixed Reality), the camera’s position in the Inspector stops moving around. Prior, it’s position every frame was seemingly set by the XR subsystem to the headset’s current location. After calling SetStereoViewMatrix(), the updating stops. WHY? As far as I understand it, calling SetStereoViewMatrix is simply setting the camera’s VIEW on the scene, not the camera’s actual position. Is this not true? It’s certainly true for setting camera.worldToCameraMatrix. When I use that method (only), the camera’s position and rotation is updated from the current headset’s tracking.
Q4: Why does calling camera.SetStereoViewMatrix( ) goof up in Unity 2019 when in “single instance” 3D render mode? MultiPass works fine, but single instance breaks it quick. (the camera’s output looks very funny). (this question is not as important).
Q5: exactly what is the difference between camera.worldToCameraMatrix and camera.SetStereoViewMatrix( )?