Great article. How much do we know about how/whether the Rift takes this into account? I see no way in (for instance) Unity3d to skew the camera frustum in the way this article suggests.
The C++ SDK does take it into account. It's done in a weird way; first a frustum matrix for a standard non-skewed camera model is set up in one place of the code, and later, in some other place, the frustum matrix is multiplied with an offset (skewing) matrix. It's not elegant, but does the job.
I don't know enough about Unity3d to tell if/how it's done there. We looked through the code, but are not sure. The stereo effect is done by having two normal Unity3d cameras (left and right), which appear to be linked via a script. There might be more code somewhere that applies skewing matrices to both cameras prior to rendering.
But I didn't notice any differences in stereo quality between the Unity3d and native SDK demos, so my guess is that Unity3d (somehow) does the right thing.
Edit: It's also possible that skewing is not really necessary with the current dev kit hardware; from the way it's built, with both lenses more or less centered over their respective halves of the same planar screen, it might just happen to actually be a straight on-axis frustum camera.
3
u/gilmore606 Apr 08 '13
Great article. How much do we know about how/whether the Rift takes this into account? I see no way in (for instance) Unity3d to skew the camera frustum in the way this article suggests.