From 609831b5d244c52a21aef438785cd7c090d4b242 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 13 Feb 2024 01:37:46 +0200 Subject: secondlife/triage#59 Show 'Friends Only' rendering mode --- indra/newview/app_settings/settings.xml | 29 ++++--------- indra/newview/llfloaterpreference.cpp | 15 +++++++ indra/newview/llfloaterpreference.h | 6 +-- .../llfloaterpreferencesgraphicsadvanced.cpp | 37 ++++++++++++++-- .../newview/llfloaterpreferencesgraphicsadvanced.h | 3 ++ indra/newview/llviewercontrol.cpp | 10 ++++- indra/newview/llvoavatar.cpp | 26 ++++++++---- indra/newview/llvoavatar.h | 9 +++- .../en/floater_preferences_graphics_advanced.xml | 36 ++++++++++++++++ .../default/xui/en/panel_performance_nearby.xml | 41 ++++++++++++++---- .../default/xui/en/panel_preferences_graphics1.xml | 49 ++++++++++++++++------ 11 files changed, 199 insertions(+), 62 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index a9b4ebcc04..a787010346 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -8817,17 +8817,6 @@ Value 1 - AlwaysRenderFriends - - Comment - Always render friends regardless of max complexity - Persist - 1 - Type - Boolean - Value - 0 - RenderAvatar Comment @@ -10921,16 +10910,16 @@ Value 1 - RenderUseImpostors + RenderAvatarComplexityMode - Comment - OBSOLETE and UNUSED. See RenderAvatarMaxNonImpostors and RenderAvatarMaxComplexity. - Persist - 0 - Type - Boolean - Value - 0 + Comment + 0 - complexity limit applies to everyone, 1 - always show friends, 2 - only show friends + Persist + 0 + Type + S32 + Value + 0 RenderAvatarMaxNonImpostors diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 5b4138e2e9..93292926b6 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -437,6 +437,12 @@ bool LLFloaterPreference::postBuild() gSavedSettings.getControl("PreferredMaturity")->getSignal()->connect(boost::bind(&LLFloaterPreference::onChangeMaturity, this)); + gSavedSettings.getControl("RenderAvatarComplexityMode")->getSignal()->connect( + [this](LLControlVariable* control, const LLSD& new_val, const LLSD& old_val) + { + onChangeComplexityMode(new_val); + }); + gSavedPerAccountSettings.getControl("ModelUploadFolder")->getSignal()->connect(boost::bind(&LLFloaterPreference::onChangeModelFolder, this)); gSavedPerAccountSettings.getControl("PBRUploadFolder")->getSignal()->connect(boost::bind(&LLFloaterPreference::onChangePBRFolder, this)); gSavedPerAccountSettings.getControl("TextureUploadFolder")->getSignal()->connect(boost::bind(&LLFloaterPreference::onChangeTextureFolder, this)); @@ -476,6 +482,9 @@ bool LLFloaterPreference::postBuild() LLSliderCtrl* fov_slider = getChild("camera_fov"); fov_slider->setMinValue(LLViewerCamera::getInstance()->getMinView()); fov_slider->setMaxValue(LLViewerCamera::getInstance()->getMaxView()); + + bool enable_complexity = gSavedSettings.getS32("RenderAvatarComplexityMode") != LLVOAvatar::AV_RENDER_ONLY_SHOW_FRIENDS; + getChild("IndirectMaxComplexity")->setEnabled(enable_complexity); // Hook up and init for filtering mFilterEdit = getChild("search_prefs_edit"); @@ -1629,6 +1638,12 @@ void LLFloaterPreference::onChangeMaturity() getChild("rating_icon_adult")->setVisible(sim_access == SIM_ACCESS_ADULT); } +void LLFloaterPreference::onChangeComplexityMode(const LLSD& newvalue) +{ + bool enable_complexity = newvalue.asInteger() != LLVOAvatar::AV_RENDER_ONLY_SHOW_FRIENDS; + getChild("IndirectMaxComplexity")->setEnabled(enable_complexity); +} + std::string get_category_path(LLUUID cat_id) { LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id); diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 8a231cc10b..c6891c61aa 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -164,7 +164,6 @@ public: void onClickLogPath(); void changeLogPath(const std::vector& filenames, std::string proposed_name); bool moveTranscriptsAndLog(); - void enableHistory(); void setPersonalInfo(const std::string& visibility); void refreshEnabledState(); void onCommitWindowedMode(); @@ -174,10 +173,8 @@ public: void refreshUI(); - void onCommitMediaEnabled(); - void onCommitMusicEnabled(); - void applyResolution(); void onChangeMaturity(); + void onChangeComplexityMode(const LLSD& newvalue); void onChangeModelFolder(); void onChangePBRFolder(); void onChangeTextureFolder(); @@ -199,7 +196,6 @@ public: void buildPopupLists(); static void refreshSkin(void* data); void selectPanel(const LLSD& name); - void saveCameraPreset(std::string& preset); void saveGraphicsPreset(std::string& preset); void setRecommendedSettings(); diff --git a/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp index 77482fc75e..6741dbb7e4 100644 --- a/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp +++ b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp @@ -51,14 +51,14 @@ LLFloaterPreferenceGraphicsAdvanced::LLFloaterPreferenceGraphicsAdvanced(const L mCommitCallbackRegistrar.add("Pref.Cancel", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::onBtnCancel, this, _2)); mCommitCallbackRegistrar.add("Pref.OK", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::onBtnOK, this, _2)); - - gSavedSettings.getControl("RenderAvatarMaxNonImpostors")->getSignal()->connect(boost::bind(&LLFloaterPreferenceGraphicsAdvanced::updateIndirectMaxNonImpostors, this, _2)); } LLFloaterPreferenceGraphicsAdvanced::~LLFloaterPreferenceGraphicsAdvanced() { mComplexityChangedSignal.disconnect(); + mComplexityModeChangedSignal.disconnect(); mLODFactorChangedSignal.disconnect(); + mNumImpostorsChangedSignal.disconnect(); } bool LLFloaterPreferenceGraphicsAdvanced::postBuild() @@ -78,8 +78,26 @@ bool LLFloaterPreferenceGraphicsAdvanced::postBuild() use_HiDPI->setVisible(false); #endif - mComplexityChangedSignal = gSavedSettings.getControl("RenderAvatarMaxComplexity")->getCommitSignal()->connect(boost::bind(&LLFloaterPreferenceGraphicsAdvanced::updateComplexityText, this)); - mLODFactorChangedSignal = gSavedSettings.getControl("RenderVolumeLODFactor")->getCommitSignal()->connect(boost::bind(&LLFloaterPreferenceGraphicsAdvanced::updateObjectMeshDetailText, this)); + mComplexityChangedSignal = gSavedSettings.getControl("RenderAvatarMaxComplexity")->getCommitSignal()->connect( + [this](LLControlVariable* control, const LLSD& new_val, const LLSD& old_val) + { + updateComplexityText(); + }); + mComplexityModeChangedSignal = gSavedSettings.getControl("RenderAvatarComplexityMode")->getSignal()->connect( + [this](LLControlVariable* control, const LLSD& new_val, const LLSD& old_val) + { + updateComplexityMode(new_val); + }); + mLODFactorChangedSignal = gSavedSettings.getControl("RenderVolumeLODFactor")->getCommitSignal()->connect( + [this](LLControlVariable* control, const LLSD& new_val, const LLSD& old_val) + { + updateObjectMeshDetailText(); + }); + mNumImpostorsChangedSignal = gSavedSettings.getControl("RenderAvatarMaxNonImpostors")->getSignal()->connect( + [this](LLControlVariable* control, const LLSD& new_val, const LLSD& old_val) + { + updateIndirectMaxNonImpostors(new_val); + }); return true; } @@ -144,6 +162,10 @@ void LLFloaterPreferenceGraphicsAdvanced::refresh() gSavedSettings.getU32("RenderAvatarMaxComplexity"), getChild("IndirectMaxComplexityText", true)); refreshEnabledState(); + + bool enable_complexity = gSavedSettings.getS32("RenderAvatarComplexityMode") != LLVOAvatar::AV_RENDER_ONLY_SHOW_FRIENDS; + getChild("IndirectMaxComplexity")->setEnabled(enable_complexity); + getChild("IndirectMaxNonImpostors")->setEnabled(enable_complexity); } void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledGraphics() @@ -159,6 +181,13 @@ void LLFloaterPreferenceGraphicsAdvanced::updateMaxComplexity() getChild("IndirectMaxComplexityText")); } +void LLFloaterPreferenceGraphicsAdvanced::updateComplexityMode(const LLSD& newvalue) +{ + bool enable_complexity = newvalue.asInteger() != LLVOAvatar::AV_RENDER_ONLY_SHOW_FRIENDS; + getChild("IndirectMaxComplexity")->setEnabled(enable_complexity); + getChild("IndirectMaxNonImpostors")->setEnabled(enable_complexity); +} + void LLFloaterPreferenceGraphicsAdvanced::updateComplexityText() { LLAvatarComplexityControls::setText(gSavedSettings.getU32("RenderAvatarMaxComplexity"), diff --git a/indra/newview/llfloaterpreferencesgraphicsadvanced.h b/indra/newview/llfloaterpreferencesgraphicsadvanced.h index ed7c1fc926..8791bdce19 100644 --- a/indra/newview/llfloaterpreferencesgraphicsadvanced.h +++ b/indra/newview/llfloaterpreferencesgraphicsadvanced.h @@ -48,6 +48,7 @@ public: void updateIndirectMaxNonImpostors(const LLSD& newvalue); void setMaxNonImpostorsText(U32 value, LLTextBox* text_box); void updateMaxComplexity(); + void updateComplexityMode(const LLSD& newvalue); void updateComplexityText(); void updateObjectMeshDetailText(); void refresh(); @@ -61,7 +62,9 @@ protected: void onBtnCancel(const LLSD& userdata); boost::signals2::connection mComplexityChangedSignal; + boost::signals2::connection mComplexityModeChangedSignal; boost::signals2::connection mLODFactorChangedSignal; + boost::signals2::connection mNumImpostorsChangedSignal; }; #endif //LLFLOATERPREFERENCEGRAPHICSADVANCED_H diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index a7583136eb..2a248cd120 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -638,8 +638,13 @@ void handlePerformanceStatsEnabledChanged(const LLSD& newValue) } void handleUserImpostorByDistEnabledChanged(const LLSD& newValue) { - const auto newval = gSavedSettings.getBOOL("AutoTuneImpostorByDistEnabled"); - LLPerfStats::tunables.userImpostorDistanceTuningEnabled = newval; + bool auto_tune_newval = false; + S32 mode = gSavedSettings.getS32("RenderAvatarComplexityMode"); + if (mode != LLVOAvatar::AV_RENDER_ONLY_SHOW_FRIENDS) + { + auto_tune_newval = gSavedSettings.getBOOL("AutoTuneImpostorByDistEnabled"); + } + LLPerfStats::tunables.userImpostorDistanceTuningEnabled = auto_tune_newval; } void handleUserImpostorDistanceChanged(const LLSD& newValue) { @@ -708,6 +713,7 @@ void settings_setup_listeners() setting_setup_signal_listener(gSavedSettings, "RenderGlowNoise", handleSetShaderChanged); setting_setup_signal_listener(gSavedSettings, "RenderGammaFull", handleSetShaderChanged); setting_setup_signal_listener(gSavedSettings, "RenderVolumeLODFactor", handleVolumeLODChanged); + setting_setup_signal_listener(gSavedSettings, "RenderAvatarComplexityMode", handleUserImpostorByDistEnabledChanged); setting_setup_signal_listener(gSavedSettings, "RenderAvatarLODFactor", handleAvatarLODChanged); setting_setup_signal_listener(gSavedSettings, "RenderAvatarPhysicsLODFactor", handleAvatarPhysicsLODChanged); setting_setup_signal_listener(gSavedSettings, "RenderTerrainLODFactor", handleTerrainLODChanged); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 0ab0006fc9..1e785ba757 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -8344,13 +8344,17 @@ bool LLVOAvatar::isFullyLoaded() const bool LLVOAvatar::isTooComplex() const { bool too_complex; - static LLCachedControl always_render_friends(gSavedSettings, "AlwaysRenderFriends"); - bool render_friend = (LLAvatarTracker::instance().isBuddy(getID()) && always_render_friends); + static LLCachedControl compelxity_render_mode(gSavedSettings, "RenderAvatarComplexityMode"); + bool render_friend = (LLAvatarTracker::instance().isBuddy(getID()) && compelxity_render_mode > AV_RENDER_LIMIT_BY_COMPLEXITY); if (isSelf() || render_friend || mVisuallyMuteSetting == AV_ALWAYS_RENDER) { too_complex = false; } + else if (compelxity_render_mode == AV_RENDER_ONLY_SHOW_FRIENDS && !mIsControlAvatar) + { + too_complex = true; + } else { // Determine if visually muted or not @@ -8370,13 +8374,17 @@ bool LLVOAvatar::isTooComplex() const bool LLVOAvatar::isTooSlow() const { - static LLCachedControl always_render_friends(gSavedSettings, "AlwaysRenderFriends"); - bool render_friend = (LLAvatarTracker::instance().isBuddy(getID()) && always_render_friends); + static LLCachedControl compelxity_render_mode(gSavedSettings, "RenderAvatarComplexityMode"); + bool render_friend = (LLAvatarTracker::instance().isBuddy(getID()) && compelxity_render_mode > AV_RENDER_LIMIT_BY_COMPLEXITY); if (render_friend || mVisuallyMuteSetting == AV_ALWAYS_RENDER) { return false; } + else if (compelxity_render_mode == AV_RENDER_ONLY_SHOW_FRIENDS && !mIsControlAvatar) + { + return true; + } return mTooSlow; } @@ -8384,7 +8392,7 @@ bool LLVOAvatar::isTooSlow() const void LLVOAvatar::updateTooSlow() { LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; - static LLCachedControl alwaysRenderFriends(gSavedSettings, "AlwaysRenderFriends"); + static LLCachedControl compelxity_render_mode(gSavedSettings, "RenderAvatarComplexityMode"); static LLCachedControl allowSelfImpostor(gSavedSettings, "AllowSelfImpostor"); const auto id = getID(); @@ -8417,12 +8425,14 @@ void LLVOAvatar::updateTooSlow() if(!mTooSlowWithoutShadows) // if we were not previously above the full impostor cap { - bool render_friend_or_exception = ( alwaysRenderFriends && LLAvatarTracker::instance().isBuddy( id ) ) || + bool always_render_friends = compelxity_render_mode > AV_RENDER_LIMIT_BY_COMPLEXITY; + bool render_friend_or_exception = (always_render_friends && LLAvatarTracker::instance().isBuddy( id ) ) || ( getVisualMuteSettings() == LLVOAvatar::AV_ALWAYS_RENDER ); - if( (!isSelf() || allowSelfImpostor) && !render_friend_or_exception ) + if( (!isSelf() || allowSelfImpostor) && !render_friend_or_exception) { // Note: slow rendering Friends still get their shadows zapped. - mTooSlowWithoutShadows = getGPURenderTime()*2.f >= max_art_ms; // NOTE: assumes shadow rendering doubles render time + mTooSlowWithoutShadows = (getGPURenderTime()*2.f >= max_art_ms) // NOTE: assumes shadow rendering doubles render time + || (compelxity_render_mode == AV_RENDER_ONLY_SHOW_FRIENDS && !mIsControlAvatar); } } } diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index f8b71aa364..979eac6dbc 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -487,7 +487,14 @@ public: U32 renderImpostor(LLColor4U color = LLColor4U(255,255,255,255), S32 diffuse_channel = 0); bool isVisuallyMuted(); bool isInMuteList() const; - void forceUpdateVisualMuteSettings(); + + // states for RenderAvatarComplexityMode + enum ERenderComplexityMode + { + AV_RENDER_LIMIT_BY_COMPLEXITY = 0, + AV_RENDER_ALWAYS_SHOW_FRIENDS = 1, + AV_RENDER_ONLY_SHOW_FRIENDS = 2 + }; // Visual Mute Setting is an input. Does not necessarily determine // what the avatar looks like, because it interacts with other diff --git a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml index bc237322af..af6df9dad3 100644 --- a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml +++ b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml @@ -128,6 +128,42 @@ Avatar + + Detail Mode: + + + + + + + + - - + top_pad="3" + name="AvatarComplexityModeLabel" + text_readonly_color="LabelDisabledColor" + width="128"> + Detail Mode: + + + + + + + + + Avatar Detail Mode: + + + + + + [https://community.secondlife.com/t5/Featured-News/Why-are-all-these-people-made-of-colored-jelly/ba-p/3031255 What's this?] - - -