diff --git a/apps/openmw/mwrender/skyutil.cpp b/apps/openmw/mwrender/skyutil.cpp index c0b6f81358..ead9d9af70 100644 --- a/apps/openmw/mwrender/skyutil.cpp +++ b/apps/openmw/mwrender/skyutil.cpp @@ -816,7 +816,7 @@ namespace MWRender osg::StateSet* queryStateSet = new osg::StateSet; if (queryVisible) { - osg::ref_ptr depth = new SceneUtil::AutoDepth; + osg::ref_ptr depth = new SceneUtil::AutoDepth(osg::Depth::LEQUAL); // This is a trick to make fragments written by the query always use the maximum depth value, // without having to retrieve the current far clipping distance. // We want the sun glare to be "infinitely" far away. diff --git a/components/terrain/material.cpp b/components/terrain/material.cpp index ae432d262e..6ae1a970d3 100644 --- a/components/terrain/material.cpp +++ b/components/terrain/material.cpp @@ -106,7 +106,7 @@ namespace osg::ref_ptr mValue; LequalDepth() - : mValue(new SceneUtil::AutoDepth) + : mValue(new SceneUtil::AutoDepth(osg::Depth::LEQUAL)) { } };