summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2022-02-04 12:46:23 +0200
committerMnikolenko Productengine <mnikolenko@productengine.com>2022-02-04 12:46:23 +0200
commit7af2d51f57416cb68b435cecfd4eacf5d1a4c9fc (patch)
treed5b92f8afea4b4477e6f4fb3b07e27b801da67a0
parent817f764edc6d71727300bfaba533821a8d428950 (diff)
SL-15923 increase the shortcut level to the minimum required when clicking advanced lighting or shadows settings
-rw-r--r--indra/newview/llfloaterperformance.cpp55
-rw-r--r--indra/newview/llfloaterperformance.h4
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml28
3 files changed, 84 insertions, 3 deletions
diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp
index 9cb3c4ce66..e45d7a0c73 100644
--- a/indra/newview/llfloaterperformance.cpp
+++ b/indra/newview/llfloaterperformance.cpp
@@ -32,6 +32,7 @@
#include "llavataractions.h"
#include "llavatarrendernotifier.h"
#include "llcheckboxctrl.h"
+#include "llcombobox.h"
#include "llfeaturemanager.h"
#include "llfloaterpreference.h" // LLAvatarComplexityControls
#include "llfloaterreg.h"
@@ -120,6 +121,8 @@ BOOL LLFloaterPerformance::postBuild()
mSettingsPanel->getChild<LLButton>("advanced_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickAdvanced, this));
mSettingsPanel->getChild<LLRadioGroup>("graphics_quality")->setCommitCallback(boost::bind(&LLFloaterPerformance::onChangeQuality, this, _2));
+ mSettingsPanel->getChild<LLCheckBoxCtrl>("advanced_lighting_model")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::onClickAdvancedLighting, this));
+ mSettingsPanel->getChild<LLComboBox>("ShadowDetail")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::onClickShadows, this));
mNearbyPanel->getChild<LLButton>("exceptions_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickExceptions, this));
mNearbyPanel->getChild<LLCheckBoxCtrl>("hide_avatars")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickHideAvatars, this));
@@ -540,4 +543,56 @@ void LLFloaterPerformance::onAvatarListRightClick(LLUICtrl* ctrl, S32 x, S32 y)
}
}
+const U32 RENDER_QUALITY_LEVEL = 3;
+void LLFloaterPerformance::changeQualityLevel(const std::string& notif)
+{
+ LLNotificationsUtil::add(notif, LLSD(), LLSD(),
+ [](const LLSD&notif, const LLSD&resp)
+ {
+ S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp);
+ if (opt == 0)
+ {
+ LLFloaterPreference* instance = LLFloaterReg::getTypedInstance<LLFloaterPreference>("preferences");
+ if (instance)
+ {
+ gSavedSettings.setU32("RenderQualityPerformance", RENDER_QUALITY_LEVEL);
+ instance->onChangeQuality(LLSD((S32)RENDER_QUALITY_LEVEL));
+ }
+ }
+ });
+}
+
+bool is_ALM_available()
+{
+ bool bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump") && gSavedSettings.getBOOL("RenderObjectBump");
+ bool shaders = gSavedSettings.getBOOL("WindLightUseAtmosShaders");
+
+ return LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") &&
+ bumpshiny &&
+ shaders &&
+ gGLManager.mHasFramebufferObject;
+}
+
+void LLFloaterPerformance::onClickAdvancedLighting()
+{
+ if (!is_ALM_available())
+ {
+ changeQualityLevel("AdvancedLightingConfirm");
+ }
+}
+
+void LLFloaterPerformance::onClickShadows()
+{
+ if (gSavedSettings.getBOOL("AutoFPS"))
+ {
+ LLFloaterPreference::showAutoAdjustWarning();
+ }
+ else
+ {
+ if (!is_ALM_available() || !gSavedSettings.getBOOL("RenderDeferred"))
+ {
+ changeQualityLevel("ShadowsConfirm");
+ }
+ }
+}
// EOF
diff --git a/indra/newview/llfloaterperformance.h b/indra/newview/llfloaterperformance.h
index d8288b0728..9ccb29cd7b 100644
--- a/indra/newview/llfloaterperformance.h
+++ b/indra/newview/llfloaterperformance.h
@@ -62,10 +62,14 @@ private:
void onChangeQuality(const LLSD& data);
void onClickHideAvatars();
void onClickExceptions();
+ void onClickShadows();
+ void onClickAdvancedLighting();
void updateMaxComplexity();
void updateComplexityText();
+ static void changeQualityLevel(const std::string& notif);
+
LLPanel* mMainPanel;
LLPanel* mNearbyPanel;
LLPanel* mComplexityPanel;
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 2fed214d69..e01865a5ea 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -1848,9 +1848,9 @@ Graphics Quality can be raised in Preferences &gt; Graphics.
</notification>
<notification
- icon="alertmodal.tga"
- name="AutoFPSConfirmDisable"
- type="alertmodal">
+ icon="alertmodal.tga"
+ name="AutoFPSConfirmDisable"
+ type="alertmodal">
Changing this setting will disable automatic adjustment and turn off 'Auto FPS' setting.
Are you sure you want to continue?
<tag>confirm</tag>
@@ -1859,6 +1859,28 @@ Are you sure you want to continue?
notext="Cancel"
yestext="Continue"/>
</notification>
+ <notification
+ icon="alertmodal.tga"
+ name="AdvancedLightingConfirm"
+ type="alertmodal">
+To turn on advanced lighting, we need to increase quality to level 4.
+ <tag>confirm</tag>
+ <usetemplate
+ name="okcancelbuttons"
+ notext="Cancel"
+ yestext="OK"/>
+ </notification>
+ <notification
+ icon="alertmodal.tga"
+ name="ShadowsConfirm"
+ type="alertmodal">
+To enable shadows, we need to increase quality to level 4.
+ <tag>confirm</tag>
+ <usetemplate
+ name="okcancelbuttons"
+ notext="Cancel"
+ yestext="OK"/>
+ </notification>
<notification
icon="alertmodal.tga"