Skip to content

Commit

Permalink
Fix disappearing shadows when sun is 0 -1 0 (#107)
Browse files Browse the repository at this point in the history
Fixes #107
  • Loading branch information
darksylinc committed Jul 5, 2020
1 parent 6a587e9 commit 49141c7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion OgreMain/src/OgreShadowCameraSetupConcentric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ namespace Ogre
texCam->setNearClipDistance( light->_deriveShadowNearClipDistance( cam ) );
texCam->setFarClipDistance( light->_deriveShadowFarClipDistance( cam ) );

const AxisAlignedBox &casterBox = sm->getCurrentCastersBox();
AxisAlignedBox casterBox = sm->getCurrentCastersBox();
// Add some padding. Needed to fix Disappearing shadows when sun is 0 -1 0
// See https://github.com/OGRECave/ogre-next/issues/107
casterBox.setExtents( casterBox.getMinimum() - 0.1f, casterBox.getMaximum() + 0.1f );

// Will be overriden, but not always (in case we early out to use uniform shadows)
mMaxDistance = casterBox.getMinimum().distance( casterBox.getMaximum() );
Expand Down

0 comments on commit 49141c7

Please sign in to comment.