1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-12-20 05:53:06 +00:00

Ensure near plane doesn't go past far plane when there are no shadow receivers

This commit is contained in:
AnyOldName3 2025-12-14 00:21:42 +00:00
parent 6801ebec0d
commit 2754d4264c

View file

@ -645,6 +645,7 @@ MWShadowTechnique::Frustum::Frustum(osgUtil::CullVisitor* cv, double minZNear, d
{
osg::Matrix::value_type zNear = osg::maximum<osg::Matrix::value_type>(cv->getCalculatedNearPlane(),minZNear);
osg::Matrix::value_type zFar = osg::minimum<osg::Matrix::value_type>(cv->getCalculatedFarPlane(),maxZFar);
zNear = std::min(zNear, zFar);
cv->clampProjectionMatrix(projectionMatrix, zNear, zFar);