SkyStereoStatesetUpdater was incorrectly always using reverseZ matrices.

backport_gl_clamp_removal
Mads Buvik Sandvei 1 year ago
parent 00e02bb326
commit 7d057600ea

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

Loading…
Cancel
Save