From 2754d4264c315a424aed89cb1c92ea37834e2e9c Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Sun, 14 Dec 2025 00:21:42 +0000 Subject: [PATCH] Ensure near plane doesn't go past far plane when there are no shadow receivers --- components/sceneutil/mwshadowtechnique.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/components/sceneutil/mwshadowtechnique.cpp b/components/sceneutil/mwshadowtechnique.cpp index fa0269776c..ae1c837e10 100644 --- a/components/sceneutil/mwshadowtechnique.cpp +++ b/components/sceneutil/mwshadowtechnique.cpp @@ -645,6 +645,7 @@ MWShadowTechnique::Frustum::Frustum(osgUtil::CullVisitor* cv, double minZNear, d { osg::Matrix::value_type zNear = osg::maximum(cv->getCalculatedNearPlane(),minZNear); osg::Matrix::value_type zFar = osg::minimum(cv->getCalculatedFarPlane(),maxZFar); + zNear = std::min(zNear, zFar); cv->clampProjectionMatrix(projectionMatrix, zNear, zFar);