1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-20 09:53:51 +00:00

Make disableShadowsForStateSet a no-op when shadows are disabled

Otherwise the GPU has to do useless shadow comparisons when shadows
are disabled.
This commit is contained in:
Icecream95 2020-05-17 19:52:23 +12:00
parent 8d01897942
commit f14db21745
No known key found for this signature in database
GPG key ID: 339D18472C107D93

View file

@ -69,6 +69,9 @@ namespace SceneUtil
void ShadowManager::disableShadowsForStateSet(osg::ref_ptr<osg::StateSet> stateset) void ShadowManager::disableShadowsForStateSet(osg::ref_ptr<osg::StateSet> stateset)
{ {
if (!Settings::Manager::getBool("enable shadows", "Shadows"))
return;
int numberOfShadowMapsPerLight = Settings::Manager::getInt("number of shadow maps", "Shadows"); int numberOfShadowMapsPerLight = Settings::Manager::getInt("number of shadow maps", "Shadows");
numberOfShadowMapsPerLight = std::max(1, std::min(numberOfShadowMapsPerLight, 8)); numberOfShadowMapsPerLight = std::max(1, std::min(numberOfShadowMapsPerLight, 8));