History

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.

Anthony J. Thibault committed 9 years ago

Commit f314ba31 parent a41aced1 file · +1 −1Browse files

Showing the changes to plugins/oculus/src/OculusBaseDisplayPlugin.cpp (1 of 1 file). Show all

Unified · Split

plugins/oculus/src/OculusBaseDisplayPlugin.cpp+1−1
@@ -84,7 +84,7 @@ glm::mat4 OculusBaseDisplayPlugin::getCullingProjection(const glm::mat4& basePro · 83 unmodified lines
8484 float baseFarClip = baseFrustum.getFarClip();
8585 auto combinedFov = _eyeFovs[0];
8686 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));
8888 } else {
8989 return baseProjection;
9090 }