From 9fbe9a02aafe6d7f874696bfd9f5d2ff327224e8 Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Sat, 7 Feb 2026 23:43:56 +0000 Subject: [PATCH] Fix #8952 Regression from 2754d4264c315a424aed89cb1c92ea37834e2e9c !5047 --- components/sceneutil/mwshadowtechnique.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/sceneutil/mwshadowtechnique.cpp b/components/sceneutil/mwshadowtechnique.cpp index ae1c837e10..82a9c232b1 100644 --- a/components/sceneutil/mwshadowtechnique.cpp +++ b/components/sceneutil/mwshadowtechnique.cpp @@ -645,6 +645,8 @@ 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); + if (zFar < 0) + zFar = minZNear; zNear = std::min(zNear, zFar); cv->clampProjectionMatrix(projectionMatrix, zNear, zFar);