Skip to content

Commit

Permalink
[GL] Planar Reflections had inverted Y if rendered to a RenderTexture
Browse files Browse the repository at this point in the history
Thanks Crystal Hammer for the repro!
  • Loading branch information
darksylinc committed Mar 10, 2024
1 parent 2983b02 commit d7b95f4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Components/PlanarReflections/src/OgrePlanarReflections.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -887,8 +887,11 @@ namespace Ogre
memset( passBufferPtr, 0, (mMaxActiveActors - mActiveActors.size()) * 4u * sizeof(float) );
passBufferPtr += (mMaxActiveActors - mActiveActors.size()) * 4u;

Matrix4 reflProjMat = PROJECTIONCLIPSPACE2DTOIMAGESPACE_PERSPECTIVE * projectionMatrix;
for( size_t i=0; i<16; ++i )
// We call getProjectionMatrixWithRSDepth directly because
// it must NOT account for requiresTextureFlipping.
Matrix4 reflProjMat =
PROJECTIONCLIPSPACE2DTOIMAGESPACE_PERSPECTIVE * camera->getProjectionMatrixWithRSDepth();
for( size_t i = 0; i < 16; ++i )
*passBufferPtr++ = (float)reflProjMat[0][i];

*passBufferPtr++ = static_cast<float>( mInvMaxDistance );
Expand Down

0 comments on commit d7b95f4

Please sign in to comment.