1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2026-02-01 15:18:27 +00:00

Merge branch 'near-far-wherever-you-are' into 'master'

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

See merge request OpenMW/openmw!5047
This commit is contained in:
psi29a 2025-12-18 10:43:53 +00:00
commit 7281f3e3f6

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);