@@ -62,23 +62,6 @@ namespace
6262 return " #{OMWEngine:TextureFilteringOther}" ;
6363 }
6464
65- MyGUI::UString lightingMethodToStr (SceneUtil::LightingMethod method)
66- {
67- std::string_view result;
68- switch (method)
69- {
70- case SceneUtil::LightingMethod::PerObjectUniform:
71- result = " #{OMWEngine:LightingMethodShadersCompatibility}" ;
72- break ;
73- case SceneUtil::LightingMethod::SingleUBO:
74- default :
75- result = " #{OMWEngine:LightingMethodShaders}" ;
76- break ;
77- }
78-
79- return MyGUI::LanguageManager::getInstance ().replaceTags (MyGUI::UString (result));
80- }
81-
8265 bool sortResolutions (std::pair<int , int > left, std::pair<int , int > right)
8366 {
8467 if (left.first == right.first )
@@ -281,7 +264,7 @@ namespace MWGui
281264 getWidget (mSecondaryLanguage , " SecondaryLanguage" );
282265 getWidget (mGmstOverridesL10n , " GmstOverridesL10nButton" );
283266 getWidget (mWindowModeHint , " WindowModeHint" );
284- getWidget (mLightingMethodButton , " LightingMethodButton " );
267+ getWidget (mClusteredLightingButton , " ClusteredLightingButton " );
285268 getWidget (mLightsResetButton , " LightsResetButton" );
286269 getWidget (mMaxLights , " MaxLights" );
287270 getWidget (mScriptFilter , " ScriptFilter" );
@@ -290,6 +273,9 @@ namespace MWGui
290273 getWidget (mScriptView , " ScriptView" );
291274 getWidget (mScriptAdapter , " ScriptAdapter" );
292275 getWidget (mScriptDisabled , " ScriptDisabled" );
276+ getWidget (mClassicFalloffWidget , " ClassicFalloffWidget" );
277+ getWidget (mMinimumBrightnessText , " MinimumBrightnessText" );
278+ getWidget (mMinimumBrightnessScroll , " MinimumBrightnessScroll" );
293279
294280#ifndef WIN32
295281 // hide gamma controls since it currently does not work under Linux
@@ -323,8 +309,6 @@ namespace MWGui
323309 mWaterRainRippleDetail ->eventComboChangePosition
324310 += MyGUI::newDelegate (this , &SettingsWindow::onWaterRainRippleDetailChanged);
325311
326- mLightingMethodButton ->eventComboChangePosition
327- += MyGUI::newDelegate (this , &SettingsWindow::onLightingMethodButtonChanged);
328312 mLightsResetButton ->eventMouseButtonClick
329313 += MyGUI::newDelegate (this , &SettingsWindow::onLightsResetButtonClicked);
330314 mMaxLights ->eventComboChangePosition += MyGUI::newDelegate (this , &SettingsWindow::onMaxLightsChanged);
@@ -554,21 +538,6 @@ namespace MWGui
554538 apply ();
555539 }
556540
557- void SettingsWindow::onLightingMethodButtonChanged (MyGUI::ComboBox* sender, size_t pos)
558- {
559- if (pos == MyGUI::ITEM_NONE )
560- return ;
561-
562- sender->setCaptionWithReplacing (sender->getItemNameAt (sender->getIndexSelected ()));
563-
564- MWBase::Environment::get ().getWindowManager ()->interactiveMessageBox (
565- " #{OMWEngine:ChangeRequiresRestart}" , { " #{Interface:OK}" }, true );
566-
567- Settings::shaders ().mLightingMethod .set (
568- Settings::parseLightingMethod (*sender->getItemDataAt <std::string>(pos)));
569- apply ();
570- }
571-
572541 void SettingsWindow::onLanguageChanged (size_t langPriority, MyGUI::ComboBox* sender, size_t pos)
573542 {
574543 if (pos == MyGUI::ITEM_NONE )
@@ -658,11 +627,8 @@ namespace MWGui
658627 Settings::shaders ().mLightFadeStart .reset ();
659628 Settings::shaders ().mMinimumInteriorBrightness .reset ();
660629 Settings::shaders ().mMaxLights .reset ();
661- Settings::shaders ().mLightingMethod .reset ();
630+ Settings::shaders ().mClusteredLighting .reset ();
662631
663- const SceneUtil::LightingMethod lightingMethod = Settings::shaders ().mLightingMethod ;
664- const std::size_t lightIndex = mLightingMethodButton ->findItemIndexWith (lightingMethodToStr (lightingMethod));
665- mLightingMethodButton ->setIndexSelected (lightIndex);
666632 updateMaxLightsComboBox (mMaxLights );
667633
668634 apply ();
@@ -779,6 +745,8 @@ namespace MWGui
779745 MWBase::Environment::get ().getInputManager ()->processChangedSettings (changed);
780746 MWBase::Environment::get ().getMechanicsManager ()->processChangedSettings (changed);
781747 Settings::Manager::resetPendingChanges ();
748+
749+ updateLightSettings ();
782750 }
783751
784752 void SettingsWindow::onKeyboardSwitchClicked (MyGUI::Widget* /* sender*/ )
@@ -848,25 +816,15 @@ namespace MWGui
848816
849817 void SettingsWindow::updateLightSettings ()
850818 {
851- auto lightingMethod = MWBase::Environment::get ().getResourceSystem ()->getSceneManager ()->getLightingMethod ();
852- MyGUI::UString lightingMethodStr = lightingMethodToStr (lightingMethod);
853-
854- mLightingMethodButton ->removeAllItems ();
819+ mClusteredLightingButton ->setEnabled (
820+ MWBase::Environment::get ().getResourceSystem ()->getSceneManager ()->isClusteredLightingSupported ());
855821
856- std::array<SceneUtil::LightingMethod, 2 > methods = {
857- SceneUtil::LightingMethod::PerObjectUniform,
858- SceneUtil::LightingMethod::SingleUBO,
859- };
822+ const bool isClustered = Settings::shaders ().mClusteredLighting ;
823+ const bool isClassic = !isClustered && Settings::shaders ().mClassicFalloff ;
860824
861- for (const auto & method : methods)
862- {
863- if (!MWBase::Environment::get ().getResourceSystem ()->getSceneManager ()->isSupportedLightingMethod (method))
864- continue ;
865-
866- mLightingMethodButton ->addItem (
867- lightingMethodToStr (method), SceneUtil::LightManager::getLightingMethodString (method));
868- }
869- mLightingMethodButton ->setIndexSelected (mLightingMethodButton ->findItemIndexWith (lightingMethodStr));
825+ mClassicFalloffWidget ->setVisible (!isClustered);
826+ mMinimumBrightnessText ->setVisible (!isClassic);
827+ mMinimumBrightnessScroll ->setVisible (!isClassic);
870828 }
871829
872830 void SettingsWindow::updateWindowModeSettings ()
0 commit comments