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.
Showing the changes to plugins/oculus/src/OculusBaseDisplayPlugin.cpp (1 of 1 file). Show all
Unified · Split
| @@ -84,7 +84,7 @@ glm::mat4 OculusBaseDisplayPlugin::getCullingProjection(const glm::mat4& basePro · 83 unmodified lines | |||
| 84 | float baseFarClip = baseFrustum.getFarClip(); | 84 | float baseFarClip = baseFrustum.getFarClip(); |
| 85 | auto combinedFov = _eyeFovs[0]; | 85 | auto combinedFov = _eyeFovs[0]; |
| 86 | combinedFov.LeftTan = combinedFov.RightTan = std::max(combinedFov.LeftTan, combinedFov.RightTan); | 86 | combinedFov.LeftTan = combinedFov.RightTan = std::max(combinedFov.LeftTan, combinedFov.RightTan); |
| 87 | return toGlm(ovrMatrix4f_Projection(combinedFov, DEFAULT_NEAR_CLIP, DEFAULT_FAR_CLIP, ovrProjection_ClipRangeOpenGL)); | 87 | return toGlm(ovrMatrix4f_Projection(combinedFov, baseNearClip, baseFarClip, ovrProjection_ClipRangeOpenGL)); |
| 88 | } else { | 88 | } else { |
| 89 | return baseProjection; | 89 | return baseProjection; |
| 90 | } | 90 | } |