From f314ba38dfe93dcee16d248c291e8218183d290e Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Mon, 18 Sep 2017 14:38:03 -0700 Subject: [PATCH] Oculus: fix for lighting changes as avatar scale changes The code was incorrectly NOT using the near and far clip distances when computing the culling projection matrix. This projection matrix is used by the lighting system to for deferred lighting, if it does not match actual projection used for rendering into the g-buffer, the lighting will be incorrect. --- plugins/oculus/src/OculusBaseDisplayPlugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/oculus/src/OculusBaseDisplayPlugin.cpp b/plugins/oculus/src/OculusBaseDisplayPlugin.cpp index ea0af0d5f5..7e7fcc0db3 100644 --- a/plugins/oculus/src/OculusBaseDisplayPlugin.cpp +++ b/plugins/oculus/src/OculusBaseDisplayPlugin.cpp @@ -84,7 +84,7 @@ glm::mat4 OculusBaseDisplayPlugin::getCullingProjection(const glm::mat4& basePro float baseFarClip = baseFrustum.getFarClip(); auto combinedFov = _eyeFovs[0]; combinedFov.LeftTan = combinedFov.RightTan = std::max(combinedFov.LeftTan, combinedFov.RightTan); - return toGlm(ovrMatrix4f_Projection(combinedFov, DEFAULT_NEAR_CLIP, DEFAULT_FAR_CLIP, ovrProjection_ClipRangeOpenGL)); + return toGlm(ovrMatrix4f_Projection(combinedFov, baseNearClip, baseFarClip, ovrProjection_ClipRangeOpenGL)); } else { return baseProjection; }