1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-31 21:45:35 +00:00

SkyStereoStatesetUpdater was incorrectly always using reverseZ matrices.

This commit is contained in:
Mads Buvik Sandvei 2023-03-11 14:01:11 +01:00
parent 00e02bb326
commit 7d057600ea

View file

@ -629,7 +629,7 @@ namespace MWRender
for (int view : {0, 1}) for (int view : {0, 1})
{ {
auto projectionMatrix = sm.computeEyeProjection(view, true); auto projectionMatrix = sm.computeEyeProjection(view, SceneUtil::AutoDepth::isReversed());
auto viewOffsetMatrix = sm.computeEyeViewOffset(view); auto viewOffsetMatrix = sm.computeEyeViewOffset(view);
for (int col : {0, 1, 2}) for (int col : {0, 1, 2})
viewOffsetMatrix(3, col) = 0; viewOffsetMatrix(3, col) = 0;
@ -644,14 +644,14 @@ namespace MWRender
{ {
auto& sm = Stereo::Manager::instance(); auto& sm = Stereo::Manager::instance();
auto* projectionMatrixUniform = stateset->getUniform("projectionMatrix"); auto* projectionMatrixUniform = stateset->getUniform("projectionMatrix");
auto projectionMatrix = sm.computeEyeProjection(0, true); auto projectionMatrix = sm.computeEyeProjection(0, SceneUtil::AutoDepth::isReversed());
projectionMatrixUniform->set(projectionMatrix); projectionMatrixUniform->set(projectionMatrix);
} }
void applyRight(osg::StateSet* stateset, osgUtil::CullVisitor* /*cv*/) override void applyRight(osg::StateSet* stateset, osgUtil::CullVisitor* /*cv*/) override
{ {
auto& sm = Stereo::Manager::instance(); auto& sm = Stereo::Manager::instance();
auto* projectionMatrixUniform = stateset->getUniform("projectionMatrix"); auto* projectionMatrixUniform = stateset->getUniform("projectionMatrix");
auto projectionMatrix = sm.computeEyeProjection(1, true); auto projectionMatrix = sm.computeEyeProjection(1, SceneUtil::AutoDepth::isReversed());
projectionMatrixUniform->set(projectionMatrix); projectionMatrixUniform->set(projectionMatrix);
} }