Skip to content

Commit 7281f3e

Browse files
committed
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
2 parents 3dedc5e + 2754d42 commit 7281f3e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

components/sceneutil/mwshadowtechnique.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,7 @@ MWShadowTechnique::Frustum::Frustum(osgUtil::CullVisitor* cv, double minZNear, d
645645
{
646646
osg::Matrix::value_type zNear = osg::maximum<osg::Matrix::value_type>(cv->getCalculatedNearPlane(),minZNear);
647647
osg::Matrix::value_type zFar = osg::minimum<osg::Matrix::value_type>(cv->getCalculatedFarPlane(),maxZFar);
648+
zNear = std::min(zNear, zFar);
648649

649650
cv->clampProjectionMatrix(projectionMatrix, zNear, zFar);
650651

0 commit comments

Comments
 (0)