Skip to content

Commit

Permalink
Clamp number of shadow maps, as described in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
akortunov committed Nov 13, 2019
1 parent 5c6ca82 commit 7074baa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/sceneutil/shadow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ namespace SceneUtil
void ShadowManager::disableShadowsForStateSet(osg::ref_ptr<osg::StateSet> stateset)
{
int numberOfShadowMapsPerLight = Settings::Manager::getInt("number of shadow maps", "Shadows");
numberOfShadowMapsPerLight = std::max(1, std::min(numberOfShadowMapsPerLight, 8));

int baseShadowTextureUnit = 8 - numberOfShadowMapsPerLight;

osg::ref_ptr<osg::Image> fakeShadowMapImage = new osg::Image();
Expand Down

0 comments on commit 7074baa

Please sign in to comment.