diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp index 421691a55..d48e627e1 100644 --- a/apps/launcher/graphicspage.cpp +++ b/apps/launcher/graphicspage.cpp @@ -144,9 +144,9 @@ bool Launcher::GraphicsPage::loadSettings() if (mEngineSettings.getBool("enable indoor shadows", "Shadows")) indoorShadowsCheckBox->setCheckState(Qt::Checked); - shadowNearFarComputationComboBox->setCurrentIndex( - shadowNearFarComputationComboBox->findText( - QString(tr(mEngineSettings.getString("near far computation", "Shadows").c_str())))); + shadowComputeSceneBoundsComboBox->setCurrentIndex( + shadowComputeSceneBoundsComboBox->findText( + QString(tr(mEngineSettings.getString("compute scene bounds", "Shadows").c_str())))); int shadowDistLimit = mEngineSettings.getInt("maximum shadow map distance", "Shadows"); if (shadowDistLimit > 0) @@ -267,9 +267,9 @@ void Launcher::GraphicsPage::saveSettings() if (cShadowRes != mEngineSettings.getInt("shadow map resolution", "Shadows")) mEngineSettings.setInt("shadow map resolution", "Shadows", cShadowRes); - auto cShadowNearFarMode = shadowNearFarComputationComboBox->currentText().toStdString(); - if (cShadowNearFarMode != mEngineSettings.getString("near far computation", "Shadows")) - mEngineSettings.setString("near far computation", "Shadows", cShadowNearFarMode); + auto cComputeSceneBounds = shadowComputeSceneBoundsComboBox->currentText().toStdString(); + if (cComputeSceneBounds != mEngineSettings.getString("compute scene bounds", "Shadows")) + mEngineSettings.setString("compute scene bounds", "Shadows", cComputeSceneBounds); } QStringList Launcher::GraphicsPage::getAvailableResolutions(int screen) diff --git a/components/sceneutil/shadow.cpp b/components/sceneutil/shadow.cpp index 0476768f8..1e14fbbb1 100644 --- a/components/sceneutil/shadow.cpp +++ b/components/sceneutil/shadow.cpp @@ -40,10 +40,10 @@ namespace SceneUtil mShadowSettings->setMinimumShadowMapNearFarRatio(Settings::Manager::getFloat("minimum lispsm near far ratio", "Shadows")); - std::string computeNearFarMode = Settings::Manager::getString("near far computation", "Shadows"); - if (Misc::StringUtils::lowerCase(computeNearFarMode) == "primitives") + std::string computeSceneBounds = Settings::Manager::getString("compute scene bounds", "Shadows"); + if (Misc::StringUtils::lowerCase(computeSceneBounds) == "primitives") mShadowSettings->setComputeNearFarModeOverride(osg::CullSettings::COMPUTE_NEAR_FAR_USING_PRIMITIVES); - else + else if (Misc::StringUtils::lowerCase(computeSceneBounds) == "bounds") mShadowSettings->setComputeNearFarModeOverride(osg::CullSettings::COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES); int mapres = Settings::Manager::getInt("shadow map resolution", "Shadows"); diff --git a/docs/source/reference/modding/settings/shadows.rst b/docs/source/reference/modding/settings/shadows.rst index 746e9b0df..0670a8109 100644 --- a/docs/source/reference/modding/settings/shadows.rst +++ b/docs/source/reference/modding/settings/shadows.rst @@ -80,15 +80,15 @@ enable debug overlay Enable or disable the debug overlay to see the area covered by each shadow map. This setting is only recommended for developers, bug reporting and advanced users performing fine-tuning of shadow settings. -near far computation +compute scene bounds -------------------- :Type: string -:Range: primitives|bounds +:Range: primitives|bounds|none :Default: bounding volumes Two different ways to make better use of shadow map(s) by making them cover a smaller area. -While primitives give better shadows at expense of more CPU, bounds gives better performance overall but with lower quality shadows. +While primitives give better shadows at expense of more CPU, bounds gives better performance overall but with lower quality shadows. There is also the ability to disable this computation with none. shadow map resolution --------------------- diff --git a/files/settings-default.cfg b/files/settings-default.cfg index 5a0d787f9..91c0443ec 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -806,7 +806,7 @@ enable debug hud = false enable debug overlay = false # Used to set the type of tight scene bound calculation method to be used by the shadow map that covers a smaller area. "bounds" (default) is less precise shadows but better performance or "primitives" for more precise shadows at expense of CPU. -near far computation = bounds +compute scene bounds = bounds # How large to make the shadow map(s). Higher values increase GPU load, but can produce better-looking results. Power-of-two values may turn out to be faster on some GPU/driver combinations. shadow map resolution = 1024 diff --git a/files/ui/graphicspage.ui b/files/ui/graphicspage.ui index 9a7d986a7..cfa2c800c 100644 --- a/files/ui/graphicspage.ui +++ b/files/ui/graphicspage.ui @@ -253,17 +253,17 @@ - + - <html><head/><body><p>Type of "near far plane" computation method to be used. Bounding Volumes (default) for better performance, Primitives for better looking shadows or none.</p></body></html> + <html><head/><body><p>Type of "compute scene bounds" computation method to be used. Bounds (default) for good balance between performance and shadow quality, primitives for better looking shadows or none for no computation.</p></body></html> Shadow Near Far Computation Method: - - + compute scene bounds + bounds @@ -274,6 +274,11 @@ primitives + + + none + +