There's an issue with using a custom projection matrix together with the setting "quad_normals camera_direction" when using a quad pass. In our case, we have a custom matrix for the Oculus HMD, and use the quad pass for sky rendering. The camera direction ends up wrong in the quad pass, so the sky appears zoomed in and doesn't stay stationary with respect to other objects as you look around in the HMD.
The problem is fixed by the following change in the Ogre code base (clip space corners at -1 to 1 instead of -0.5 to 0.5):
Code: Select all
diff -r 04f7437fcbb8 OgreMain/src/OgreFrustum.cpp
--- a/OgreMain/src/OgreFrustum.cpp Mon Oct 17 19:32:28 2016 -0300
+++ b/OgreMain/src/OgreFrustum.cpp Mon Nov 14 11:51:26 2016 +0100
@@ -321,8 +321,8 @@
{
// Convert clipspace corners to camera space
Matrix4 invProj = mProjMatrix.inverse();
- Vector3 topLeft(-0.5f, 0.5f, 0.0f);
- Vector3 bottomRight(0.5f, -0.5f, 0.0f);
+ Vector3 topLeft(-1.0f, 1.0f, 0.0f);
+ Vector3 bottomRight(1.0f, -1.0f, 0.0f);
topLeft = invProj * topLeft;
bottomRight = invProj * bottomRight;