From 10a770047d90045e882a65e5347da3530b189c42 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 11 Jun 2021 19:10:43 +0300 Subject: SL-15297 WIP Implement performance floater --- indra/newview/CMakeLists.txt | 2 + indra/newview/llavatarrendernotifier.cpp | 2 + indra/newview/llavatarrendernotifier.h | 3 + indra/newview/llfloaterperformance.cpp | 216 ++++++++++ indra/newview/llfloaterperformance.h | 65 +++ indra/newview/llnamelistctrl.cpp | 39 +- indra/newview/llnamelistctrl.h | 23 +- indra/newview/llviewerfloaterreg.cpp | 2 + indra/newview/skins/default/colors.xml | 6 + .../skins/default/textures/icons/green_dot.png | Bin 0 -> 18614 bytes indra/newview/skins/default/textures/textures.xml | 2 + .../skins/default/xui/en/floater_performance.xml | 447 +++++++++++++++++++++ indra/newview/skins/default/xui/en/menu_viewer.xml | 7 + .../default/xui/en/panel_performance_huds.xml | 112 ++++++ .../default/xui/en/panel_performance_nearby.xml | 161 ++++++++ .../xui/en/panel_performance_preferences.xml | 257 ++++++++++++ .../default/xui/en/panel_performance_scripts.xml | 82 ++++ .../xui/en/panel_performance_troubleshooting.xml | 190 +++++++++ 18 files changed, 1602 insertions(+), 14 deletions(-) create mode 100644 indra/newview/llfloaterperformance.cpp create mode 100644 indra/newview/llfloaterperformance.h create mode 100644 indra/newview/skins/default/textures/icons/green_dot.png create mode 100644 indra/newview/skins/default/xui/en/floater_performance.xml create mode 100644 indra/newview/skins/default/xui/en/panel_performance_huds.xml create mode 100644 indra/newview/skins/default/xui/en/panel_performance_nearby.xml create mode 100644 indra/newview/skins/default/xui/en/panel_performance_preferences.xml create mode 100644 indra/newview/skins/default/xui/en/panel_performance_scripts.xml create mode 100644 indra/newview/skins/default/xui/en/panel_performance_troubleshooting.xml (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index fc8d8b805b..1ec1e2cc24 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -286,6 +286,7 @@ set(viewer_SOURCE_FILES llfloaterpathfindinglinksets.cpp llfloaterpathfindingobjects.cpp llfloaterpay.cpp + llfloaterperformance.cpp llfloaterperms.cpp llfloaterpostprocess.cpp llfloaterpreference.cpp @@ -924,6 +925,7 @@ set(viewer_HEADER_FILES llfloaterpathfindinglinksets.h llfloaterpathfindingobjects.h llfloaterpay.h + llfloaterperformance.h llfloaterperms.h llfloaterpostprocess.h llfloaterpreference.h diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index 94584a623b..4fd57c7341 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -298,6 +298,8 @@ void LLHUDRenderNotifier::updateNotificationHUD(hud_complexity_list_t complexity return; } + mHUDComplexityList = complexity; + // TODO: // Find a way to show message with list of issues, but without making it too large // and intrusive. diff --git a/indra/newview/llavatarrendernotifier.h b/indra/newview/llavatarrendernotifier.h index ec17b3d9e6..3fd7a32d84 100644 --- a/indra/newview/llavatarrendernotifier.h +++ b/indra/newview/llavatarrendernotifier.h @@ -121,6 +121,8 @@ public: void updateNotificationHUD(hud_complexity_list_t complexity); bool isNotificationVisible(); + hud_complexity_list_t getHUDComplexityList() { return mHUDComplexityList; } + private: enum EWarnLevel { @@ -141,6 +143,7 @@ private: EWarnLevel mReportedHUDWarning; LLHUDComplexity mLatestHUDComplexity; LLFrameTimer mHUDPopUpDelayTimer; + hud_complexity_list_t mHUDComplexityList; }; #endif /* ! defined(LL_llavatarrendernotifier_H) */ diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp new file mode 100644 index 0000000000..8024d1539c --- /dev/null +++ b/indra/newview/llfloaterperformance.cpp @@ -0,0 +1,216 @@ +/** + * @file llfloaterperformance.cpp + * + * $LicenseInfo:firstyear=2021&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2021, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llfloaterperformance.h" + +#include "llappearancemgr.h" +#include "llavatarrendernotifier.h" +#include "llfeaturemanager.h" +#include "llfloaterreg.h" +#include "llnamelistctrl.h" +#include "lltextbox.h" +#include "llvoavatar.h" + + +LLFloaterPerformance::LLFloaterPerformance(const LLSD& key) + : LLFloater(key) +{ + +} + +LLFloaterPerformance::~LLFloaterPerformance() +{ +} + +BOOL LLFloaterPerformance::postBuild() +{ + mMainPanel = getChild("panel_performance_main"); + mTroubleshootingPanel = getChild("panel_performance_troubleshooting"); + mNearbyPanel = getChild("panel_performance_nearby"); + mScriptsPanel = getChild("panel_performance_scripts"); + mPreferencesPanel = getChild("panel_performance_preferences"); + mHUDsPanel = getChild("panel_performance_huds"); + + getChild("troubleshooting_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mTroubleshootingPanel)); + getChild("nearby_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mNearbyPanel)); + getChild("scripts_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mScriptsPanel)); + getChild("preferences_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mPreferencesPanel)); + getChild("huds_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mHUDsPanel)); + + initBackBtn(mTroubleshootingPanel); + initBackBtn(mNearbyPanel); + initBackBtn(mScriptsPanel); + initBackBtn(mPreferencesPanel); + initBackBtn(mHUDsPanel); + + + mHUDsPanel->getChild("refresh_list_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::populateHUDList, this)); + + mHUDList = mHUDsPanel->getChild("hud_list"); + mHUDList->setNameListType(LLNameListCtrl::SPECIAL); + mHUDList->setHoverIconName("StopReload_Off"); + mHUDList->setIconClickedCallback(boost::bind(&LLFloaterPerformance::detachItem, this, _1)); + + mPreferencesPanel->getChild("advanced_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickAdvanced, this)); + mPreferencesPanel->getChild("defaults_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickRecommended, this)); + + mNearbyPanel->getChild("exceptions_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickExceptions, this)); + mNearbyList = mNearbyPanel->getChild("nearby_list"); + + return TRUE; +} + +void LLFloaterPerformance::showSelectedPanel(LLPanel* selected_panel) +{ + selected_panel->setVisible(TRUE); + mMainPanel->setVisible(FALSE); + + if (mHUDsPanel == selected_panel) + { + populateHUDList(); + } + else if (mNearbyPanel == selected_panel) + { + populateNearbyList(); + } +} + +void LLFloaterPerformance::showMainPanel() +{ + mTroubleshootingPanel->setVisible(FALSE); + mNearbyPanel->setVisible(FALSE); + mScriptsPanel->setVisible(FALSE); + mHUDsPanel->setVisible(FALSE); + mPreferencesPanel->setVisible(FALSE); + mMainPanel->setVisible(TRUE); +} + +void LLFloaterPerformance::initBackBtn(LLPanel* panel) +{ + panel->getChild("back_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::showMainPanel, this)); + + panel->getChild("back_lbl")->setShowCursorHand(false); + panel->getChild("back_lbl")->setSoundFlags(LLView::MOUSE_UP); + panel->getChild("back_lbl")->setClickedCallback(boost::bind(&LLFloaterPerformance::showMainPanel, this)); +} + +void LLFloaterPerformance::populateHUDList() +{ + mHUDList->clearRows(); + mHUDList->updateColumns(true); + + hud_complexity_list_t complexity_list = LLHUDRenderNotifier::getInstance()->getHUDComplexityList(); + + hud_complexity_list_t::iterator iter = complexity_list.begin(); + hud_complexity_list_t::iterator end = complexity_list.end(); + + for (; iter != end; ++iter) + { + LLHUDComplexity hud_object_complexity = *iter; + + LLSD item; + item["special_id"] = hud_object_complexity.objectId; + item["target"] = LLNameListCtrl::SPECIAL; + LLSD& row = item["columns"]; + row[0]["column"] = "complex_visual"; + row[0]["type"] = "text"; + row[0]["value"] = "*"; + + row[1]["column"] = "complex_value"; + row[1]["type"] = "text"; + row[1]["value"] = std::to_string(hud_object_complexity.objectsCost); + row[1]["font"]["name"] = "SANSSERIF"; + + row[2]["column"] = "name"; + row[2]["type"] = "text"; + row[2]["value"] = hud_object_complexity.objectName; + row[2]["font"]["name"] = "SANSSERIF"; + + mHUDList->addElement(item); + } + + mHUDsPanel->getChild("huds_value")->setValue(std::to_string(complexity_list.size())); +} + +void LLFloaterPerformance::populateNearbyList() +{ + mNearbyList->clearRows(); + mNearbyList->updateColumns(true); + + std::vector::iterator char_iter = LLCharacter::sInstances.begin(); + while (char_iter != LLCharacter::sInstances.end()) + { + LLVOAvatar* avatar = dynamic_cast(*char_iter); + if (avatar && !avatar->isDead() && !avatar->isControlAvatar()) + { + avatar->calculateUpdateRenderComplexity(); + + LLSD item; + item["id"] = avatar->getID(); + LLSD& row = item["columns"]; + row[0]["column"] = "complex_visual"; + row[0]["type"] = "text"; + row[0]["value"] = "*"; + + row[1]["column"] = "complex_value"; + row[1]["type"] = "text"; + row[1]["value"] = std::to_string( avatar->getVisualComplexity()); + row[1]["font"]["name"] = "SANSSERIF"; + + row[2]["column"] = "name"; + row[2]["type"] = "text"; + row[2]["value"] = avatar->getFullname(); + row[2]["font"]["name"] = "SANSSERIF"; + + mNearbyList->addElement(item); + } + char_iter++; + } + +} + +void LLFloaterPerformance::detachItem(const LLUUID& item_id) +{ + LLAppearanceMgr::instance().removeItemFromAvatar(item_id); + mHUDList->removeNameItem(item_id); +} + +void LLFloaterPerformance::onClickRecommended() +{ + LLFeatureManager::getInstance()->applyRecommendedSettings(); +} + +void LLFloaterPerformance::onClickAdvanced() +{ + LLFloaterReg::showInstance("prefs_graphics_advanced"); +} + +void LLFloaterPerformance::onClickExceptions() +{ + LLFloaterReg::showInstance("avatar_render_settings"); +} + +// EOF diff --git a/indra/newview/llfloaterperformance.h b/indra/newview/llfloaterperformance.h new file mode 100644 index 0000000000..a70a328d3a --- /dev/null +++ b/indra/newview/llfloaterperformance.h @@ -0,0 +1,65 @@ +/** + * @file llfloaterperformance.h + * + * $LicenseInfo:firstyear=2021&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2021, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLFLOATERPERFORMANCE_H +#define LL_LLFLOATERPERFORMANCE_H + +#include "llfloater.h" + +class LLNameListCtrl; + +class LLFloaterPerformance : public LLFloater +{ +public: + LLFloaterPerformance(const LLSD& key); + virtual ~LLFloaterPerformance(); + + /*virtual*/ BOOL postBuild(); + + void showSelectedPanel(LLPanel* selected_panel); + void showMainPanel(); + + void detachItem(const LLUUID& item_id); + +private: + void initBackBtn(LLPanel* panel); + void populateHUDList(); + void populateNearbyList(); + + void onClickAdvanced(); + void onClickRecommended(); + void onClickExceptions(); + + LLPanel* mMainPanel; + LLPanel* mTroubleshootingPanel; + LLPanel* mNearbyPanel; + LLPanel* mScriptsPanel; + LLPanel* mHUDsPanel; + LLPanel* mPreferencesPanel; + LLNameListCtrl* mHUDList; + LLNameListCtrl* mNearbyList; +}; + +#endif // LL_LLFLOATERPERFORMANCE_H diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index 3209d23e43..e1bf9b1a17 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -67,7 +67,9 @@ LLNameListCtrl::LLNameListCtrl(const LLNameListCtrl::Params& p) mNameColumn(p.name_column.column_name), mAllowCallingCardDrop(p.allow_calling_card_drop), mShortNames(p.short_names), - mPendingLookupsRemaining(0) + mPendingLookupsRemaining(0), + mHoverIconName("Info_Small"), + mNameListType(INDIVIDUAL) {} // public @@ -134,7 +136,12 @@ BOOL LLNameListCtrl::handleDragAndDrop( void LLNameListCtrl::showInspector(const LLUUID& avatar_id, bool is_group, bool is_experience) { - if(is_experience) + if (isSpecialType()) + { + mIconClickedSignal(avatar_id); + return; + } + if(is_experience) { LLFloaterReg::showInstance("experience_profile", avatar_id, true); return; @@ -215,14 +222,16 @@ BOOL LLNameListCtrl::handleToolTip(S32 x, S32 y, MASK mask) S32 column_index = getColumnIndexFromOffset(x); LLNameListItem* hit_item = dynamic_cast(hitItem(x, y)); LLFloater* floater = gFloaterView->getParentFloater(this); - if (floater + + + if (floater && floater->isFrontmost() && hit_item - && column_index == mNameColumnIndex) + && ((column_index == mNameColumnIndex) || isSpecialType())) { - // ...this is the column with the avatar name - LLUUID avatar_id = hit_item->getUUID(); - if (avatar_id.notNull()) + // ...this is the column with the avatar name + LLUUID item_id = isSpecialType() ? hit_item->getSpecialID() : hit_item->getUUID(); + if (item_id.notNull()) { // ...valid avatar id @@ -230,13 +239,13 @@ BOOL LLNameListCtrl::handleToolTip(S32 x, S32 y, MASK mask) if (hit_cell) { S32 row_index = getItemIndex(hit_item); - LLRect cell_rect = getCellRect(row_index, column_index); + LLRect cell_rect = getCellRect(row_index, isSpecialType() ? getNumColumns() - 1 : column_index); // Convert rect local to screen coordinates LLRect sticky_rect; localRectToScreen(cell_rect, &sticky_rect); // Spawn at right side of cell - LLPointer icon = LLUI::getUIImage("Info_Small"); + LLPointer icon = LLUI::getUIImage(mHoverIconName); S32 screenX = sticky_rect.mRight - info_icon_size; S32 screenY = sticky_rect.mTop - (sticky_rect.getHeight() - icon->getHeight()) / 2; LLCoordGL pos(screenX, screenY); @@ -250,7 +259,7 @@ BOOL LLNameListCtrl::handleToolTip(S32 x, S32 y, MASK mask) LLToolTip::Params params; params.background_visible(false); - params.click_callback(boost::bind(&LLNameListCtrl::showInspector, this, avatar_id, is_group, is_experience)); + params.click_callback(boost::bind(&LLNameListCtrl::showInspector, this, item_id, is_group, is_experience)); params.delay_time(0.0f); // spawn instantly on hover params.image(icon); params.message(""); @@ -321,6 +330,7 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow( // use supplied name by default std::string fullname = name_item.name; + switch(name_item.target) { case GROUP: @@ -339,8 +349,10 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow( } break; case SPECIAL: - // just use supplied name - break; + { + item->setSpecialID(name_item.special_id()); + return item; + } case INDIVIDUAL: { LLAvatarName av_name; @@ -420,7 +432,8 @@ void LLNameListCtrl::removeNameItem(const LLUUID& agent_id) for (item_list::iterator it = getItemList().begin(); it != getItemList().end(); it++) { LLScrollListItem* item = *it; - if (item->getUUID() == agent_id) + LLUUID cur_id = isSpecialType() ? dynamic_cast(item)->getSpecialID() : item->getUUID(); + if (cur_id == agent_id) { idx = getItemIndex(item); break; diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index ef0be135e6..1a31b1cc10 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -46,6 +46,8 @@ public: void setIsGroup(bool is_group) { mIsGroup = is_group; } bool isExperience() const { return mIsExperience; } void setIsExperience(bool is_experience) { mIsExperience = is_experience; } + void setSpecialID(const LLUUID& special_id) { mSpecialID = special_id; } + const LLUUID& getSpecialID() const { return mSpecialID; } protected: friend class LLNameListCtrl; @@ -68,6 +70,8 @@ protected: private: bool mIsGroup; bool mIsExperience; + + LLUUID mSpecialID; }; @@ -95,10 +99,12 @@ public: { Optional name; Optional target; + Optional special_id; NameItem() : name("name"), - target("target", INDIVIDUAL) + target("target", INDIVIDUAL), + special_id("special_id", LLUUID()) {} }; @@ -170,6 +176,12 @@ public: /*virtual*/ void updateColumns(bool force_update); /*virtual*/ void mouseOverHighlightNthItem( S32 index ); + + bool isSpecialType() { return (mNameListType == SPECIAL); } + + void setNameListType(e_name_type type) { mNameListType = type; } + void setHoverIconName(std::string icon_name) { mHoverIconName = icon_name; } + private: void showInspector(const LLUUID& avatar_id, bool is_group, bool is_experience = false); void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name, std::string suffix, std::string prefix, LLHandle item); @@ -186,6 +198,11 @@ private: S32 mPendingLookupsRemaining; namelist_complete_signal_t mNameListCompleteSignal; + + std::string mHoverIconName; + e_name_type mNameListType; + + boost::signals2::signal mIconClickedSignal; public: boost::signals2::connection setOnNameListCompleteCallback(boost::function onNameListCompleteCallback) @@ -193,6 +210,10 @@ public: return mNameListCompleteSignal.connect(onNameListCompleteCallback); } + boost::signals2::connection setIconClickedCallback(boost::function cb) + { + return mIconClickedSignal.connect(cb); + } }; diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 414ae1fad6..eabdb67188 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -102,6 +102,7 @@ #include "llfloaterpathfindingconsole.h" #include "llfloaterpathfindinglinksets.h" #include "llfloaterpay.h" +#include "llfloaterperformance.h" #include "llfloaterperms.h" #include "llfloaterpostprocess.h" #include "llfloaterpreference.h" @@ -299,6 +300,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("pathfinding_linksets", "floater_pathfinding_linksets.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("pathfinding_console", "floater_pathfinding_console.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("people", "floater_people.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("performance", "floater_performance.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("perms_default", "floater_perms_default.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("places", "floater_places.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("preferences", "floater_preferences.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index efe8102f83..3816bf7e9a 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -963,4 +963,10 @@ + + diff --git a/indra/newview/skins/default/textures/icons/green_dot.png b/indra/newview/skins/default/textures/icons/green_dot.png new file mode 100644 index 0000000000..02c07810c2 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/green_dot.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index a875c4e848..51bb91cbf9 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -234,6 +234,8 @@ with the same filename but different name + + diff --git a/indra/newview/skins/default/xui/en/floater_performance.xml b/indra/newview/skins/default/xui/en/floater_performance.xml new file mode 100644 index 0000000000..42269ba34a --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_performance.xml @@ -0,0 +1,447 @@ + + + + + Current FPS + + + 75.2 + + + + + + + + Client: + + + Network: + + + Server: + + + Normal + + + Normal + + + Normal + + + + General troubleshooting + + + Choose among common problems and see what you can do. + + + + + + Avatars nearby: + + + 42 (very high) + + + Click to review avatars and choose a complexity limit. + + + + + + This location is + + + very complex + + + Try changing graphics quality or draw distance. + + + + + + Your avatar: + + + 12 scripts + + + Removing high-impact attachments may improve graphics speed. + + + + + + Your HUDs: + + + 7 + + + Removing HUDs you are not using can improve graphics speed. + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 0a50ff089f..f275b309a1 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -238,6 +238,13 @@ + + + + + + + Back + + + HUDs displayed: + + + 7 + + + If there are any you don't need, detaching them may improve graphics speed. + + + Note: Using a HUD's minimize button does not save memory. + + + + + + + + + Back + + + Avatars within draw distance: + + + 42 (very high) + + + Some avatars nearby are slow to display. Choosing complexity limit may help graphics speed. + + + + + + 0 + + + + + + + + You can also right-click on an avatar to control display. + + + + + + + diff --git a/indra/newview/skins/default/xui/en/panel_performance_preferences.xml b/indra/newview/skins/default/xui/en/panel_performance_preferences.xml new file mode 100644 index 0000000000..81605b35a2 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_performance_preferences.xml @@ -0,0 +1,257 @@ + + + + + Back + + + This location is very complex + + + While you are here, you may want to reduce graphics quality or draw distance. + + + + Graphics quality + + + Fastest + + + + + Best quality + + + Enhancements + + + + + + + Draw distance + + + Faster + + + + m + + + Farther + + + Regions are 256 m x 256 m. + + + To zoom out and see long distances, increase the draw distance. + + + If you are socializing in a small area, decrease the draw distance. + + + + + Back + + + Avatar attachment scripts: + + + 12 + + + These attachments contain scripts (embedded apps) that use memory. + + + If there are any you don't need, detaching them may improve graphics speed. + + diff --git a/indra/newview/skins/default/xui/en/panel_performance_troubleshooting.xml b/indra/newview/skins/default/xui/en/panel_performance_troubleshooting.xml new file mode 100644 index 0000000000..d942580880 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_performance_troubleshooting.xml @@ -0,0 +1,190 @@ + + + + + Back + + + Fixes for common problems + + + Some problems result from the complexity of the location where you are. All you can do is leave. + + + Rubberbanding + + + When you walk, your avatar may be pulled backward again and again. + + + Fix: XXXXXXX + + + Texture thrashing + + + On objects near you, you may see their surfaces get blurry, then sharp, then blurry again. + + + Fix: XXXXXXX + + + Avatars are not moving smoothly + + + Lorem ipsum dolor sit amet. + + + Fix: XXXXXXX + + + Will a better graphics card or new computer help? + + + Lorem ipsum dolor sit amet. + + + Fix: XXXXXXX + + -- cgit v1.2.3 From 0914f5c48f777705bdc57188e7372707f7977e5a Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 15 Jun 2021 19:25:08 +0300 Subject: SL-15297 WIP Implement performance floater #2 --- indra/newview/CMakeLists.txt | 2 + indra/newview/llfloaterperformance.cpp | 36 +- indra/newview/llfloaterperformance.h | 5 + indra/newview/llfloaterpreference.cpp | 409 +----------------- indra/newview/llfloaterpreference.h | 31 +- .../llfloaterpreferencesgraphicsadvanced.cpp | 466 +++++++++++++++++++++ .../newview/llfloaterpreferencesgraphicsadvanced.h | 63 +++ indra/newview/llviewerfloaterreg.cpp | 1 + .../default/xui/en/panel_performance_nearby.xml | 3 - 9 files changed, 575 insertions(+), 441 deletions(-) create mode 100644 indra/newview/llfloaterpreferencesgraphicsadvanced.cpp create mode 100644 indra/newview/llfloaterpreferencesgraphicsadvanced.h (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 1ec1e2cc24..888796015b 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -290,6 +290,7 @@ set(viewer_SOURCE_FILES llfloaterperms.cpp llfloaterpostprocess.cpp llfloaterpreference.cpp + llfloaterpreferencesgraphicsadvanced.cpp llfloaterpreferenceviewadvanced.cpp llfloaterpreviewtrash.cpp llfloaterproperties.cpp @@ -929,6 +930,7 @@ set(viewer_HEADER_FILES llfloaterperms.h llfloaterpostprocess.h llfloaterpreference.h + llfloaterpreferencesgraphicsadvanced.h llfloaterpreferenceviewadvanced.h llfloaterpreviewtrash.h llfloaterproperties.h diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp index 8024d1539c..a44c3a262d 100644 --- a/indra/newview/llfloaterperformance.cpp +++ b/indra/newview/llfloaterperformance.cpp @@ -27,11 +27,15 @@ #include "llfloaterperformance.h" #include "llappearancemgr.h" +#include "llavataractions.h" #include "llavatarrendernotifier.h" #include "llfeaturemanager.h" #include "llfloaterreg.h" #include "llnamelistctrl.h" +#include "llfloaterpreference.h" // LLAvatarComplexityControls +#include "llsliderctrl.h" #include "lltextbox.h" +#include "lltrans.h" #include "llvoavatar.h" @@ -43,6 +47,7 @@ LLFloaterPerformance::LLFloaterPerformance(const LLSD& key) LLFloaterPerformance::~LLFloaterPerformance() { + mComplexityChangedSignal.disconnect(); } BOOL LLFloaterPerformance::postBuild() @@ -79,7 +84,11 @@ BOOL LLFloaterPerformance::postBuild() mNearbyPanel->getChild("exceptions_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickExceptions, this)); mNearbyList = mNearbyPanel->getChild("nearby_list"); - + + updateComplexityText(); + mComplexityChangedSignal = gSavedSettings.getControl("IndirectMaxComplexity")->getCommitSignal()->connect(boost::bind(&LLFloaterPerformance::updateComplexityText, this)); + mNearbyPanel->getChild("IndirectMaxComplexity")->setCommitCallback(boost::bind(&LLFloaterPerformance::updateMaxComplexity, this)); + return TRUE; } @@ -151,6 +160,7 @@ void LLFloaterPerformance::populateHUDList() mHUDList->addElement(item); } + mHUDList->sortByColumnIndex(1, FALSE); mHUDsPanel->getChild("huds_value")->setValue(std::to_string(complexity_list.size())); } @@ -185,10 +195,19 @@ void LLFloaterPerformance::populateNearbyList() row[2]["value"] = avatar->getFullname(); row[2]["font"]["name"] = "SANSSERIF"; - mNearbyList->addElement(item); + LLScrollListItem* av_item = mNearbyList->addElement(item); + if(av_item && LLAvatarActions::isFriend(avatar->getID())) + { + LLScrollListText* name_text = dynamic_cast(av_item->getColumn(2)); + if (name_text) + { + name_text->setColor(LLUIColorTable::instance().getColor("ConversationFriendColor")); + } + } } char_iter++; } + mNearbyList->sortByColumnIndex(1, FALSE); } @@ -213,4 +232,17 @@ void LLFloaterPerformance::onClickExceptions() LLFloaterReg::showInstance("avatar_render_settings"); } +void LLFloaterPerformance::updateMaxComplexity() +{ + LLAvatarComplexityControls::updateMax( + mNearbyPanel->getChild("IndirectMaxComplexity"), + mNearbyPanel->getChild("IndirectMaxComplexityText")); +} + +void LLFloaterPerformance::updateComplexityText() +{ + LLAvatarComplexityControls::setText(gSavedSettings.getU32("RenderAvatarMaxComplexity"), + mNearbyPanel->getChild("IndirectMaxComplexityText", true)); +} + // EOF diff --git a/indra/newview/llfloaterperformance.h b/indra/newview/llfloaterperformance.h index a70a328d3a..0cba07f21e 100644 --- a/indra/newview/llfloaterperformance.h +++ b/indra/newview/llfloaterperformance.h @@ -52,6 +52,9 @@ private: void onClickRecommended(); void onClickExceptions(); + void updateMaxComplexity(); + void updateComplexityText(); + LLPanel* mMainPanel; LLPanel* mTroubleshootingPanel; LLPanel* mNearbyPanel; @@ -60,6 +63,8 @@ private: LLPanel* mPreferencesPanel; LLNameListCtrl* mHUDList; LLNameListCtrl* mNearbyList; + + boost::signals2::connection mComplexityChangedSignal; }; #endif // LL_LLFLOATERPERFORMANCE_H diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 6bf2136f60..1ab6621c4c 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -50,6 +50,7 @@ #include "llfloaterreg.h" #include "llfloaterabout.h" #include "llfavoritesbar.h" +#include "llfloaterpreferencesgraphicsadvanced.h" #include "llfloatersidepanelcontainer.h" #include "llfloaterimsession.h" #include "llkeyboard.h" @@ -74,7 +75,6 @@ #include "llviewereventrecorder.h" #include "llviewermessage.h" #include "llviewerwindow.h" -#include "llviewershadermgr.h" #include "llviewerthrottle.h" #include "llvoavatarself.h" #include "llvotree.h" @@ -98,11 +98,9 @@ #include "lltextbox.h" #include "llui.h" #include "llviewerobjectlist.h" -#include "llvoavatar.h" #include "llvovolume.h" #include "llwindow.h" #include "llworld.h" -#include "pipeline.h" #include "lluictrlfactory.h" #include "llviewermedia.h" #include "llpluginclassmedia.h" @@ -115,8 +113,6 @@ #include "llpresetsmanager.h" #include "llviewercontrol.h" #include "llpresetsmanager.h" -#include "llfeaturemanager.h" -#include "llviewertexturelist.h" #include "llsearchableui.h" @@ -751,33 +747,6 @@ void LLFloaterPreference::onRenderOptionEnable() refreshEnabledGraphics(); } -void LLFloaterPreferenceGraphicsAdvanced::onRenderOptionEnable() -{ - LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); - if (instance) - { - instance->refresh(); - } - - refreshEnabledGraphics(); -} - -void LLFloaterPreferenceGraphicsAdvanced::onAdvancedAtmosphericsEnable() -{ - LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); - if (instance) - { - instance->refresh(); - } - - refreshEnabledGraphics(); -} - -void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledGraphics() -{ - refreshEnabledState(); -} - void LLFloaterPreference::onAvatarImpostorsEnable() { refreshEnabledGraphics(); @@ -1216,124 +1185,6 @@ void LLFloaterPreference::refreshEnabledState() getChildView("block_list")->setEnabled(LLLoginInstance::getInstance()->authSuccess()); } -void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() -{ - LLComboBox* ctrl_reflections = getChild("Reflections"); - LLTextBox* reflections_text = getChild("ReflectionsText"); - - // Reflections - BOOL reflections = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps; - ctrl_reflections->setEnabled(reflections); - reflections_text->setEnabled(reflections); - - // Transparent Water - LLCheckBoxCtrl* transparent_water_ctrl = getChild("TransparentWater"); - - // Bump & Shiny - LLCheckBoxCtrl* bumpshiny_ctrl = getChild("BumpShiny"); - bool bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump"); - bumpshiny_ctrl->setEnabled(bumpshiny ? TRUE : FALSE); - - // Avatar Mode - // Enable Avatar Shaders - LLCheckBoxCtrl* ctrl_avatar_vp = getChild("AvatarVertexProgram"); - // Avatar Render Mode - LLCheckBoxCtrl* ctrl_avatar_cloth = getChild("AvatarCloth"); - - bool avatar_vp_enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarVP"); - if (LLViewerShaderMgr::sInitialized) - { - S32 max_avatar_shader = LLViewerShaderMgr::instance()->mMaxAvatarShaderLevel; - avatar_vp_enabled = (max_avatar_shader > 0) ? TRUE : FALSE; - } - - ctrl_avatar_vp->setEnabled(avatar_vp_enabled); - - if (gSavedSettings.getBOOL("RenderAvatarVP") == FALSE) - { - ctrl_avatar_cloth->setEnabled(FALSE); - } - else - { - ctrl_avatar_cloth->setEnabled(TRUE); - } - - // Vertex Shaders, Global Shader Enable - // SL-12594 Basic shaders are always enabled. DJH TODO clean up now-orphaned state handling code - LLSliderCtrl* terrain_detail = getChild("TerrainDetail"); // can be linked with control var - LLTextBox* terrain_text = getChild("TerrainDetailText"); - - terrain_detail->setEnabled(FALSE); - terrain_text->setEnabled(FALSE); - - // WindLight - LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); - LLSliderCtrl* sky = getChild("SkyMeshDetail"); - LLTextBox* sky_text = getChild("SkyMeshDetailText"); - ctrl_wind_light->setEnabled(TRUE); - sky->setEnabled(TRUE); - sky_text->setEnabled(TRUE); - - //Deferred/SSAO/Shadows - LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); - - BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && - ((bumpshiny_ctrl && bumpshiny_ctrl->get()) ? TRUE : FALSE) && - ((transparent_water_ctrl && transparent_water_ctrl->get()) ? TRUE : FALSE) && - gGLManager.mHasFramebufferObject && - gSavedSettings.getBOOL("RenderAvatarVP") && - (ctrl_wind_light->get()) ? TRUE : FALSE; - - ctrl_deferred->setEnabled(enabled); - - LLCheckBoxCtrl* ctrl_ssao = getChild("UseSSAO"); - LLCheckBoxCtrl* ctrl_dof = getChild("UseDoF"); - LLComboBox* ctrl_shadow = getChild("ShadowDetail"); - LLTextBox* shadow_text = getChild("RenderShadowDetailText"); - - // note, okay here to get from ctrl_deferred as it's twin, ctrl_deferred2 will alway match it - enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO") && (ctrl_deferred->get() ? TRUE : FALSE); - - ctrl_deferred->set(gSavedSettings.getBOOL("RenderDeferred")); - - ctrl_ssao->setEnabled(enabled); - ctrl_dof->setEnabled(enabled); - - enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderShadowDetail"); - - ctrl_shadow->setEnabled(enabled); - shadow_text->setEnabled(enabled); - - // Hardware settings - F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple"); - S32Megabytes min_tex_mem = LLViewerTextureList::getMinVideoRamSetting(); - S32Megabytes max_tex_mem = LLViewerTextureList::getMaxVideoRamSetting(false, mem_multiplier); - getChild("GraphicsCardTextureMemory")->setMinValue(min_tex_mem.value()); - getChild("GraphicsCardTextureMemory")->setMaxValue(max_tex_mem.value()); - - if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") || - !gGLManager.mHasVertexBufferObject) - { - getChildView("vbo")->setEnabled(FALSE); - } - - if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderCompressTextures") || - !gGLManager.mHasVertexBufferObject) - { - getChildView("texture compression")->setEnabled(FALSE); - } - - // if no windlight shaders, turn off nighttime brightness, gamma, and fog distance - LLUICtrl* gamma_ctrl = getChild("gamma"); - gamma_ctrl->setEnabled(!gPipeline.canUseWindLightShaders()); - getChildView("(brightness, lower is brighter)")->setEnabled(!gPipeline.canUseWindLightShaders()); - getChildView("fog")->setEnabled(!gPipeline.canUseWindLightShaders()); - getChildView("antialiasing restart")->setVisible(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred")); - - // now turn off any features that are unavailable - disableUnavailableSettings(); -} - // static void LLAvatarComplexityControls::setIndirectControls() { @@ -1376,118 +1227,6 @@ void LLAvatarComplexityControls::setIndirectMaxArc() gSavedSettings.setU32("IndirectMaxComplexity", indirect_max_arc); } -void LLFloaterPreferenceGraphicsAdvanced::disableUnavailableSettings() -{ - LLComboBox* ctrl_reflections = getChild("Reflections"); - LLTextBox* reflections_text = getChild("ReflectionsText"); - LLCheckBoxCtrl* ctrl_avatar_vp = getChild("AvatarVertexProgram"); - LLCheckBoxCtrl* ctrl_avatar_cloth = getChild("AvatarCloth"); - LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); - LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); - LLComboBox* ctrl_shadows = getChild("ShadowDetail"); - LLTextBox* shadows_text = getChild("RenderShadowDetailText"); - LLCheckBoxCtrl* ctrl_ssao = getChild("UseSSAO"); - LLCheckBoxCtrl* ctrl_dof = getChild("UseDoF"); - LLSliderCtrl* sky = getChild("SkyMeshDetail"); - LLTextBox* sky_text = getChild("SkyMeshDetailText"); - - // disabled windlight - if (!LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders")) - { - ctrl_wind_light->setEnabled(FALSE); - ctrl_wind_light->setValue(FALSE); - - sky->setEnabled(FALSE); - sky_text->setEnabled(FALSE); - - //deferred needs windlight, disable deferred - ctrl_shadows->setEnabled(FALSE); - ctrl_shadows->setValue(0); - shadows_text->setEnabled(FALSE); - - ctrl_ssao->setEnabled(FALSE); - ctrl_ssao->setValue(FALSE); - - ctrl_dof->setEnabled(FALSE); - ctrl_dof->setValue(FALSE); - - ctrl_deferred->setEnabled(FALSE); - ctrl_deferred->setValue(FALSE); - } - - // disabled deferred - if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") || - !gGLManager.mHasFramebufferObject) - { - ctrl_shadows->setEnabled(FALSE); - ctrl_shadows->setValue(0); - shadows_text->setEnabled(FALSE); - - ctrl_ssao->setEnabled(FALSE); - ctrl_ssao->setValue(FALSE); - - ctrl_dof->setEnabled(FALSE); - ctrl_dof->setValue(FALSE); - - ctrl_deferred->setEnabled(FALSE); - ctrl_deferred->setValue(FALSE); - } - - // disabled deferred SSAO - if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO")) - { - ctrl_ssao->setEnabled(FALSE); - ctrl_ssao->setValue(FALSE); - } - - // disabled deferred shadows - if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderShadowDetail")) - { - ctrl_shadows->setEnabled(FALSE); - ctrl_shadows->setValue(0); - shadows_text->setEnabled(FALSE); - } - - // disabled reflections - if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderReflectionDetail")) - { - ctrl_reflections->setEnabled(FALSE); - ctrl_reflections->setValue(FALSE); - reflections_text->setEnabled(FALSE); - } - - // disabled av - if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarVP")) - { - ctrl_avatar_vp->setEnabled(FALSE); - ctrl_avatar_vp->setValue(FALSE); - - ctrl_avatar_cloth->setEnabled(FALSE); - ctrl_avatar_cloth->setValue(FALSE); - - //deferred needs AvatarVP, disable deferred - ctrl_shadows->setEnabled(FALSE); - ctrl_shadows->setValue(0); - shadows_text->setEnabled(FALSE); - - ctrl_ssao->setEnabled(FALSE); - ctrl_ssao->setValue(FALSE); - - ctrl_dof->setEnabled(FALSE); - ctrl_dof->setValue(FALSE); - - ctrl_deferred->setEnabled(FALSE); - ctrl_deferred->setValue(FALSE); - } - - // disabled cloth - if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarCloth")) - { - ctrl_avatar_cloth->setEnabled(FALSE); - ctrl_avatar_cloth->setValue(FALSE); - } -} - void LLFloaterPreference::refresh() { LLPanel::refresh(); @@ -1503,32 +1242,6 @@ void LLFloaterPreference::refresh() updateClickActionViews(); } -void LLFloaterPreferenceGraphicsAdvanced::refresh() -{ - getChild("fsaa")->setValue((LLSD::Integer) gSavedSettings.getU32("RenderFSAASamples")); - - // sliders and their text boxes - // mPostProcess = gSavedSettings.getS32("RenderGlowResolutionPow"); - // slider text boxes - updateSliderText(getChild("ObjectMeshDetail", true), getChild("ObjectMeshDetailText", true)); - updateSliderText(getChild("FlexibleMeshDetail", true), getChild("FlexibleMeshDetailText", true)); - updateSliderText(getChild("TreeMeshDetail", true), getChild("TreeMeshDetailText", true)); - updateSliderText(getChild("AvatarMeshDetail", true), getChild("AvatarMeshDetailText", true)); - updateSliderText(getChild("AvatarPhysicsDetail", true), getChild("AvatarPhysicsDetailText", true)); - updateSliderText(getChild("TerrainMeshDetail", true), getChild("TerrainMeshDetailText", true)); - updateSliderText(getChild("RenderPostProcess", true), getChild("PostProcessText", true)); - updateSliderText(getChild("SkyMeshDetail", true), getChild("SkyMeshDetailText", true)); - updateSliderText(getChild("TerrainDetail", true), getChild("TerrainDetailText", true)); - LLAvatarComplexityControls::setIndirectControls(); - setMaxNonImpostorsText( - gSavedSettings.getU32("RenderAvatarMaxNonImpostors"), - getChild("IndirectMaxNonImpostorsText", true)); - LLAvatarComplexityControls::setText( - gSavedSettings.getU32("RenderAvatarMaxComplexity"), - getChild("IndirectMaxComplexityText", true)); - refreshEnabledState(); -} - void LLFloaterPreference::onCommitWindowedMode() { refresh(); @@ -1742,63 +1455,6 @@ void LLFloaterPreference::refreshUI() refresh(); } -void LLFloaterPreferenceGraphicsAdvanced::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box) -{ - if (text_box == NULL || ctrl== NULL) - return; - - // get range and points when text should change - F32 value = (F32)ctrl->getValue().asReal(); - F32 min = ctrl->getMinValue(); - F32 max = ctrl->getMaxValue(); - F32 range = max - min; - llassert(range > 0); - F32 midPoint = min + range / 3.0f; - F32 highPoint = min + (2.0f * range / 3.0f); - - // choose the right text - if (value < midPoint) - { - text_box->setText(LLTrans::getString("GraphicsQualityLow")); - } - else if (value < highPoint) - { - text_box->setText(LLTrans::getString("GraphicsQualityMid")); - } - else - { - text_box->setText(LLTrans::getString("GraphicsQualityHigh")); - } -} - -void LLFloaterPreferenceGraphicsAdvanced::updateMaxNonImpostors() -{ - // Called when the IndirectMaxNonImpostors control changes - // Responsible for fixing the slider label (IndirectMaxNonImpostorsText) and setting RenderAvatarMaxNonImpostors - LLSliderCtrl* ctrl = getChild("IndirectMaxNonImpostors",true); - U32 value = ctrl->getValue().asInteger(); - - if (0 == value || LLVOAvatar::NON_IMPOSTORS_MAX_SLIDER <= value) - { - value=0; - } - gSavedSettings.setU32("RenderAvatarMaxNonImpostors", value); - LLVOAvatar::updateImpostorRendering(value); // make it effective immediately - setMaxNonImpostorsText(value, getChild("IndirectMaxNonImpostorsText")); -} - -void LLFloaterPreferenceGraphicsAdvanced::setMaxNonImpostorsText(U32 value, LLTextBox* text_box) -{ - if (0 == value) - { - text_box->setText(LLTrans::getString("no_limit")); - } - else - { - text_box->setText(llformat("%d", value)); - } -} - void LLAvatarComplexityControls::updateMax(LLSliderCtrl* slider, LLTextBox* value_label) { // Called when the IndirectMaxComplexity control changes @@ -1891,22 +1547,6 @@ bool LLFloaterPreference::loadFromFilename(const std::string& filename, std::map return true; } -void LLFloaterPreferenceGraphicsAdvanced::updateMaxComplexity() -{ - // Called when the IndirectMaxComplexity control changes - LLAvatarComplexityControls::updateMax( - getChild("IndirectMaxComplexity"), - getChild("IndirectMaxComplexityText")); - - LLFloaterPreference* floater_preferences = LLFloaterReg::findTypedInstance("preferences"); - if (floater_preferences) - { - LLAvatarComplexityControls::updateMax( - floater_preferences->getChild("IndirectMaxComplexity"), - floater_preferences->getChild("IndirectMaxComplexityText")); - } -} - void LLFloaterPreference::onChangeMaturity() { U8 sim_access = gSavedSettings.getU32("PreferredMaturity"); @@ -3310,18 +2950,6 @@ void LLPanelPreferenceControls::onCancelKeyBind() pControlsTable->deselectAllItems(); } -LLFloaterPreferenceGraphicsAdvanced::LLFloaterPreferenceGraphicsAdvanced(const LLSD& key) - : LLFloater(key) -{ - mCommitCallbackRegistrar.add("Pref.RenderOptionUpdate", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::onRenderOptionEnable, this)); - mCommitCallbackRegistrar.add("Pref.UpdateIndirectMaxNonImpostors", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::updateMaxNonImpostors,this)); - mCommitCallbackRegistrar.add("Pref.UpdateIndirectMaxComplexity", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::updateMaxComplexity,this)); -} - -LLFloaterPreferenceGraphicsAdvanced::~LLFloaterPreferenceGraphicsAdvanced() -{ -} - LLFloaterPreferenceProxy::LLFloaterPreferenceProxy(const LLSD& key) : LLFloater(key), mSocksSettingsDirty(false) @@ -3331,41 +2959,6 @@ LLFloaterPreferenceProxy::LLFloaterPreferenceProxy(const LLSD& key) mCommitCallbackRegistrar.add("Proxy.Change", boost::bind(&LLFloaterPreferenceProxy::onChangeSocksSettings, this)); } -BOOL LLFloaterPreferenceGraphicsAdvanced::postBuild() -{ - // Don't do this on Mac as their braindead GL versioning - // sets this when 8x and 16x are indeed available - // -#if !LL_DARWIN - if (gGLManager.mIsIntel || gGLManager.mGLVersion < 3.f) - { //remove FSAA settings above "4x" - LLComboBox* combo = getChild("fsaa"); - combo->remove("8x"); - combo->remove("16x"); - } - - LLCheckBoxCtrl *use_HiDPI = getChild("use HiDPI"); - use_HiDPI->setVisible(FALSE); -#endif - - return TRUE; -} - -void LLFloaterPreferenceGraphicsAdvanced::onOpen(const LLSD& key) -{ - refresh(); -} - -void LLFloaterPreferenceGraphicsAdvanced::onClickCloseBtn(bool app_quitting) -{ - LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); - if (instance) - { - instance->cancel(); - } - updateMaxComplexity(); -} - LLFloaterPreferenceProxy::~LLFloaterPreferenceProxy() { } diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 1268935712..f86104ed99 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -109,9 +109,10 @@ public: // updates click/double-click action controls depending on values from settings.xml void updateClickActionViews(); + void onBtnOK(const LLSD& userdata); + void onBtnCancel(const LLSD& userdata); + protected: - void onBtnOK(const LLSD& userdata); - void onBtnCancel(const LLSD& userdata); void onClickClearCache(); // Clear viewer texture cache, vfs, and VO cache on next startup void onClickBrowserClearCache(); // Clear web history and caches as well as viewer caches above @@ -347,32 +348,6 @@ private: S32 mEditingMode; }; -class LLFloaterPreferenceGraphicsAdvanced : public LLFloater -{ - public: - LLFloaterPreferenceGraphicsAdvanced(const LLSD& key); - ~LLFloaterPreferenceGraphicsAdvanced(); - /*virtual*/ BOOL postBuild(); - void onOpen(const LLSD& key); - void onClickCloseBtn(bool app_quitting); - void disableUnavailableSettings(); - void refreshEnabledGraphics(); - void refreshEnabledState(); - void updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box); - void updateMaxNonImpostors(); - void setMaxNonImpostorsText(U32 value, LLTextBox* text_box); - void updateMaxComplexity(); - void setMaxComplexityText(U32 value, LLTextBox* text_box); - static void setIndirectControls(); - static void setIndirectMaxNonImpostors(); - static void setIndirectMaxArc(); - void refresh(); - // callback for when client modifies a render option - void onRenderOptionEnable(); - void onAdvancedAtmosphericsEnable(); - LOG_CLASS(LLFloaterPreferenceGraphicsAdvanced); -}; - class LLAvatarComplexityControls { public: diff --git a/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp new file mode 100644 index 0000000000..404cdf5280 --- /dev/null +++ b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp @@ -0,0 +1,466 @@ +/** + * @file llfloaterpreferencesgraphicsadvanced.cpp + * @brief floater for adjusting camera position + * + * $LicenseInfo:firstyear=2021&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2021, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llfloaterpreferencesgraphicsadvanced.h" + +#include "llcheckboxctrl.h" +#include "llcombobox.h" +#include "llfeaturemanager.h" +#include "llfloaterpreference.h" +#include "llfloaterreg.h" +#include "llsliderctrl.h" +#include "lltextbox.h" +#include "lltrans.h" +#include "llviewershadermgr.h" +#include "llviewertexturelist.h" +#include "llvoavatar.h" +#include "pipeline.h" + + +LLFloaterPreferenceGraphicsAdvanced::LLFloaterPreferenceGraphicsAdvanced(const LLSD& key) + : LLFloater(key) +{ + mCommitCallbackRegistrar.add("Pref.RenderOptionUpdate", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::onRenderOptionEnable, this)); + mCommitCallbackRegistrar.add("Pref.UpdateIndirectMaxNonImpostors", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::updateMaxNonImpostors,this)); + mCommitCallbackRegistrar.add("Pref.UpdateIndirectMaxComplexity", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::updateMaxComplexity,this)); + + mCommitCallbackRegistrar.add("Pref.Cancel", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::onBtnCancel, this, _2)); + mCommitCallbackRegistrar.add("Pref.OK", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::onBtnOK, this, _2)); +} + +LLFloaterPreferenceGraphicsAdvanced::~LLFloaterPreferenceGraphicsAdvanced() +{ +} + +BOOL LLFloaterPreferenceGraphicsAdvanced::postBuild() +{ + // Don't do this on Mac as their braindead GL versioning + // sets this when 8x and 16x are indeed available + // +#if !LL_DARWIN + if (gGLManager.mIsIntel || gGLManager.mGLVersion < 3.f) + { //remove FSAA settings above "4x" + LLComboBox* combo = getChild("fsaa"); + combo->remove("8x"); + combo->remove("16x"); + } + + LLCheckBoxCtrl *use_HiDPI = getChild("use HiDPI"); + use_HiDPI->setVisible(FALSE); +#endif + + return TRUE; +} + +void LLFloaterPreferenceGraphicsAdvanced::onOpen(const LLSD& key) +{ + refresh(); +} + +void LLFloaterPreferenceGraphicsAdvanced::onClickCloseBtn(bool app_quitting) +{ + LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); + if (instance) + { + instance->cancel(); + } + updateMaxComplexity(); +} + +void LLFloaterPreferenceGraphicsAdvanced::onRenderOptionEnable() +{ + LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); + if (instance) + { + instance->refresh(); + } + + refreshEnabledGraphics(); +} + +void LLFloaterPreferenceGraphicsAdvanced::onAdvancedAtmosphericsEnable() +{ + LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); + if (instance) + { + instance->refresh(); + } + + refreshEnabledGraphics(); +} + +void LLFloaterPreferenceGraphicsAdvanced::refresh() +{ + getChild("fsaa")->setValue((LLSD::Integer) gSavedSettings.getU32("RenderFSAASamples")); + + // sliders and their text boxes + // mPostProcess = gSavedSettings.getS32("RenderGlowResolutionPow"); + // slider text boxes + updateSliderText(getChild("ObjectMeshDetail", true), getChild("ObjectMeshDetailText", true)); + updateSliderText(getChild("FlexibleMeshDetail", true), getChild("FlexibleMeshDetailText", true)); + updateSliderText(getChild("TreeMeshDetail", true), getChild("TreeMeshDetailText", true)); + updateSliderText(getChild("AvatarMeshDetail", true), getChild("AvatarMeshDetailText", true)); + updateSliderText(getChild("AvatarPhysicsDetail", true), getChild("AvatarPhysicsDetailText", true)); + updateSliderText(getChild("TerrainMeshDetail", true), getChild("TerrainMeshDetailText", true)); + updateSliderText(getChild("RenderPostProcess", true), getChild("PostProcessText", true)); + updateSliderText(getChild("SkyMeshDetail", true), getChild("SkyMeshDetailText", true)); + updateSliderText(getChild("TerrainDetail", true), getChild("TerrainDetailText", true)); + LLAvatarComplexityControls::setIndirectControls(); + setMaxNonImpostorsText( + gSavedSettings.getU32("RenderAvatarMaxNonImpostors"), + getChild("IndirectMaxNonImpostorsText", true)); + LLAvatarComplexityControls::setText( + gSavedSettings.getU32("RenderAvatarMaxComplexity"), + getChild("IndirectMaxComplexityText", true)); + refreshEnabledState(); +} + +void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledGraphics() +{ + refreshEnabledState(); +} + +void LLFloaterPreferenceGraphicsAdvanced::updateMaxComplexity() +{ + // Called when the IndirectMaxComplexity control changes + LLAvatarComplexityControls::updateMax( + getChild("IndirectMaxComplexity"), + getChild("IndirectMaxComplexityText")); + + LLFloaterPreference* floater_preferences = LLFloaterReg::findTypedInstance("preferences"); + if (floater_preferences) + { + LLAvatarComplexityControls::updateMax( + floater_preferences->getChild("IndirectMaxComplexity"), + floater_preferences->getChild("IndirectMaxComplexityText")); + } +} + +void LLFloaterPreferenceGraphicsAdvanced::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box) +{ + if (text_box == NULL || ctrl== NULL) + return; + + // get range and points when text should change + F32 value = (F32)ctrl->getValue().asReal(); + F32 min = ctrl->getMinValue(); + F32 max = ctrl->getMaxValue(); + F32 range = max - min; + llassert(range > 0); + F32 midPoint = min + range / 3.0f; + F32 highPoint = min + (2.0f * range / 3.0f); + + // choose the right text + if (value < midPoint) + { + text_box->setText(LLTrans::getString("GraphicsQualityLow")); + } + else if (value < highPoint) + { + text_box->setText(LLTrans::getString("GraphicsQualityMid")); + } + else + { + text_box->setText(LLTrans::getString("GraphicsQualityHigh")); + } +} + +void LLFloaterPreferenceGraphicsAdvanced::updateMaxNonImpostors() +{ + // Called when the IndirectMaxNonImpostors control changes + // Responsible for fixing the slider label (IndirectMaxNonImpostorsText) and setting RenderAvatarMaxNonImpostors + LLSliderCtrl* ctrl = getChild("IndirectMaxNonImpostors",true); + U32 value = ctrl->getValue().asInteger(); + + if (0 == value || LLVOAvatar::NON_IMPOSTORS_MAX_SLIDER <= value) + { + value=0; + } + gSavedSettings.setU32("RenderAvatarMaxNonImpostors", value); + LLVOAvatar::updateImpostorRendering(value); // make it effective immediately + setMaxNonImpostorsText(value, getChild("IndirectMaxNonImpostorsText")); +} + +void LLFloaterPreferenceGraphicsAdvanced::setMaxNonImpostorsText(U32 value, LLTextBox* text_box) +{ + if (0 == value) + { + text_box->setText(LLTrans::getString("no_limit")); + } + else + { + text_box->setText(llformat("%d", value)); + } +} + +void LLFloaterPreferenceGraphicsAdvanced::disableUnavailableSettings() +{ + LLComboBox* ctrl_reflections = getChild("Reflections"); + LLTextBox* reflections_text = getChild("ReflectionsText"); + LLCheckBoxCtrl* ctrl_avatar_vp = getChild("AvatarVertexProgram"); + LLCheckBoxCtrl* ctrl_avatar_cloth = getChild("AvatarCloth"); + LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); + LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); + LLComboBox* ctrl_shadows = getChild("ShadowDetail"); + LLTextBox* shadows_text = getChild("RenderShadowDetailText"); + LLCheckBoxCtrl* ctrl_ssao = getChild("UseSSAO"); + LLCheckBoxCtrl* ctrl_dof = getChild("UseDoF"); + LLSliderCtrl* sky = getChild("SkyMeshDetail"); + LLTextBox* sky_text = getChild("SkyMeshDetailText"); + + // disabled windlight + if (!LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders")) + { + ctrl_wind_light->setEnabled(FALSE); + ctrl_wind_light->setValue(FALSE); + + sky->setEnabled(FALSE); + sky_text->setEnabled(FALSE); + + //deferred needs windlight, disable deferred + ctrl_shadows->setEnabled(FALSE); + ctrl_shadows->setValue(0); + shadows_text->setEnabled(FALSE); + + ctrl_ssao->setEnabled(FALSE); + ctrl_ssao->setValue(FALSE); + + ctrl_dof->setEnabled(FALSE); + ctrl_dof->setValue(FALSE); + + ctrl_deferred->setEnabled(FALSE); + ctrl_deferred->setValue(FALSE); + } + + // disabled deferred + if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") || + !gGLManager.mHasFramebufferObject) + { + ctrl_shadows->setEnabled(FALSE); + ctrl_shadows->setValue(0); + shadows_text->setEnabled(FALSE); + + ctrl_ssao->setEnabled(FALSE); + ctrl_ssao->setValue(FALSE); + + ctrl_dof->setEnabled(FALSE); + ctrl_dof->setValue(FALSE); + + ctrl_deferred->setEnabled(FALSE); + ctrl_deferred->setValue(FALSE); + } + + // disabled deferred SSAO + if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO")) + { + ctrl_ssao->setEnabled(FALSE); + ctrl_ssao->setValue(FALSE); + } + + // disabled deferred shadows + if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderShadowDetail")) + { + ctrl_shadows->setEnabled(FALSE); + ctrl_shadows->setValue(0); + shadows_text->setEnabled(FALSE); + } + + // disabled reflections + if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderReflectionDetail")) + { + ctrl_reflections->setEnabled(FALSE); + ctrl_reflections->setValue(FALSE); + reflections_text->setEnabled(FALSE); + } + + // disabled av + if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarVP")) + { + ctrl_avatar_vp->setEnabled(FALSE); + ctrl_avatar_vp->setValue(FALSE); + + ctrl_avatar_cloth->setEnabled(FALSE); + ctrl_avatar_cloth->setValue(FALSE); + + //deferred needs AvatarVP, disable deferred + ctrl_shadows->setEnabled(FALSE); + ctrl_shadows->setValue(0); + shadows_text->setEnabled(FALSE); + + ctrl_ssao->setEnabled(FALSE); + ctrl_ssao->setValue(FALSE); + + ctrl_dof->setEnabled(FALSE); + ctrl_dof->setValue(FALSE); + + ctrl_deferred->setEnabled(FALSE); + ctrl_deferred->setValue(FALSE); + } + + // disabled cloth + if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarCloth")) + { + ctrl_avatar_cloth->setEnabled(FALSE); + ctrl_avatar_cloth->setValue(FALSE); + } +} + +void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() +{ + LLComboBox* ctrl_reflections = getChild("Reflections"); + LLTextBox* reflections_text = getChild("ReflectionsText"); + + // Reflections + BOOL reflections = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps; + ctrl_reflections->setEnabled(reflections); + reflections_text->setEnabled(reflections); + + // Transparent Water + LLCheckBoxCtrl* transparent_water_ctrl = getChild("TransparentWater"); + + // Bump & Shiny + LLCheckBoxCtrl* bumpshiny_ctrl = getChild("BumpShiny"); + bool bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump"); + bumpshiny_ctrl->setEnabled(bumpshiny ? TRUE : FALSE); + + // Avatar Mode + // Enable Avatar Shaders + LLCheckBoxCtrl* ctrl_avatar_vp = getChild("AvatarVertexProgram"); + // Avatar Render Mode + LLCheckBoxCtrl* ctrl_avatar_cloth = getChild("AvatarCloth"); + + bool avatar_vp_enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarVP"); + if (LLViewerShaderMgr::sInitialized) + { + S32 max_avatar_shader = LLViewerShaderMgr::instance()->mMaxAvatarShaderLevel; + avatar_vp_enabled = (max_avatar_shader > 0) ? TRUE : FALSE; + } + + ctrl_avatar_vp->setEnabled(avatar_vp_enabled); + + if (gSavedSettings.getBOOL("RenderAvatarVP") == FALSE) + { + ctrl_avatar_cloth->setEnabled(FALSE); + } + else + { + ctrl_avatar_cloth->setEnabled(TRUE); + } + + // Vertex Shaders, Global Shader Enable + // SL-12594 Basic shaders are always enabled. DJH TODO clean up now-orphaned state handling code + LLSliderCtrl* terrain_detail = getChild("TerrainDetail"); // can be linked with control var + LLTextBox* terrain_text = getChild("TerrainDetailText"); + + terrain_detail->setEnabled(FALSE); + terrain_text->setEnabled(FALSE); + + // WindLight + LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); + LLSliderCtrl* sky = getChild("SkyMeshDetail"); + LLTextBox* sky_text = getChild("SkyMeshDetailText"); + ctrl_wind_light->setEnabled(TRUE); + sky->setEnabled(TRUE); + sky_text->setEnabled(TRUE); + + //Deferred/SSAO/Shadows + LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); + + BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && + ((bumpshiny_ctrl && bumpshiny_ctrl->get()) ? TRUE : FALSE) && + ((transparent_water_ctrl && transparent_water_ctrl->get()) ? TRUE : FALSE) && + gGLManager.mHasFramebufferObject && + gSavedSettings.getBOOL("RenderAvatarVP") && + (ctrl_wind_light->get()) ? TRUE : FALSE; + + ctrl_deferred->setEnabled(enabled); + + LLCheckBoxCtrl* ctrl_ssao = getChild("UseSSAO"); + LLCheckBoxCtrl* ctrl_dof = getChild("UseDoF"); + LLComboBox* ctrl_shadow = getChild("ShadowDetail"); + LLTextBox* shadow_text = getChild("RenderShadowDetailText"); + + // note, okay here to get from ctrl_deferred as it's twin, ctrl_deferred2 will alway match it + enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO") && (ctrl_deferred->get() ? TRUE : FALSE); + + ctrl_deferred->set(gSavedSettings.getBOOL("RenderDeferred")); + + ctrl_ssao->setEnabled(enabled); + ctrl_dof->setEnabled(enabled); + + enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderShadowDetail"); + + ctrl_shadow->setEnabled(enabled); + shadow_text->setEnabled(enabled); + + // Hardware settings + F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple"); + S32Megabytes min_tex_mem = LLViewerTextureList::getMinVideoRamSetting(); + S32Megabytes max_tex_mem = LLViewerTextureList::getMaxVideoRamSetting(false, mem_multiplier); + getChild("GraphicsCardTextureMemory")->setMinValue(min_tex_mem.value()); + getChild("GraphicsCardTextureMemory")->setMaxValue(max_tex_mem.value()); + + if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") || + !gGLManager.mHasVertexBufferObject) + { + getChildView("vbo")->setEnabled(FALSE); + } + + if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderCompressTextures") || + !gGLManager.mHasVertexBufferObject) + { + getChildView("texture compression")->setEnabled(FALSE); + } + + // if no windlight shaders, turn off nighttime brightness, gamma, and fog distance + LLUICtrl* gamma_ctrl = getChild("gamma"); + gamma_ctrl->setEnabled(!gPipeline.canUseWindLightShaders()); + getChildView("(brightness, lower is brighter)")->setEnabled(!gPipeline.canUseWindLightShaders()); + getChildView("fog")->setEnabled(!gPipeline.canUseWindLightShaders()); + getChildView("antialiasing restart")->setVisible(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred")); + + // now turn off any features that are unavailable + disableUnavailableSettings(); +} + +void LLFloaterPreferenceGraphicsAdvanced::onBtnOK(const LLSD& userdata) +{ + LLFloaterPreference* instance = LLFloaterReg::getTypedInstance("preferences"); + if (instance) + { + instance->onBtnOK(userdata); + } +} + +void LLFloaterPreferenceGraphicsAdvanced::onBtnCancel(const LLSD& userdata) +{ + LLFloaterPreference* instance = LLFloaterReg::getTypedInstance("preferences"); + if (instance) + { + instance->onBtnCancel(userdata); + } +} diff --git a/indra/newview/llfloaterpreferencesgraphicsadvanced.h b/indra/newview/llfloaterpreferencesgraphicsadvanced.h new file mode 100644 index 0000000000..3e9046eba9 --- /dev/null +++ b/indra/newview/llfloaterpreferencesgraphicsadvanced.h @@ -0,0 +1,63 @@ +/** + * @file llfloaterpreferencesgraphicsadvanced.h + * + * $LicenseInfo:firstyear=2021&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2021, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LLFLOATERPREFERENCEGRAPHICSADVANCED_H +#define LLFLOATERPREFERENCEGRAPHICSADVANCED_H + +#include "llcontrol.h" +#include "llfloater.h" + +class LLSliderCtrl; +class LLTextBox; + +class LLFloaterPreferenceGraphicsAdvanced : public LLFloater +{ +public: + LLFloaterPreferenceGraphicsAdvanced(const LLSD& key); + ~LLFloaterPreferenceGraphicsAdvanced(); + /*virtual*/ BOOL postBuild(); + void onOpen(const LLSD& key); + void onClickCloseBtn(bool app_quitting); + void disableUnavailableSettings(); + void refreshEnabledGraphics(); + void refreshEnabledState(); + void updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box); + void updateMaxNonImpostors(); + void setMaxNonImpostorsText(U32 value, LLTextBox* text_box); + void updateMaxComplexity(); + void setMaxComplexityText(U32 value, LLTextBox* text_box); + void refresh(); + // callback for when client modifies a render option + void onRenderOptionEnable(); + void onAdvancedAtmosphericsEnable(); + LOG_CLASS(LLFloaterPreferenceGraphicsAdvanced); + +protected: + void onBtnOK(const LLSD& userdata); + void onBtnCancel(const LLSD& userdata); +}; + +#endif //LLFLOATERPREFERENCEGRAPHICSADVANCED_H + diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index eabdb67188..731a7e8ace 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -106,6 +106,7 @@ #include "llfloaterperms.h" #include "llfloaterpostprocess.h" #include "llfloaterpreference.h" +#include "llfloaterpreferencesgraphicsadvanced.h" #include "llfloaterpreferenceviewadvanced.h" #include "llfloaterpreviewtrash.h" #include "llfloaterproperties.h" diff --git a/indra/newview/skins/default/xui/en/panel_performance_nearby.xml b/indra/newview/skins/default/xui/en/panel_performance_nearby.xml index ade5f99451..d71b5334cd 100644 --- a/indra/newview/skins/default/xui/en/panel_performance_nearby.xml +++ b/indra/newview/skins/default/xui/en/panel_performance_nearby.xml @@ -83,9 +83,6 @@ show_text="false" top_pad="10" width="300"> - Date: Thu, 17 Jun 2021 20:37:06 +0300 Subject: SL-15297 WIP Implement performance floater - updated UI --- indra/newview/llavatarrendernotifier.cpp | 16 +- indra/newview/llavatarrendernotifier.h | 26 + indra/newview/llfloaterperformance.cpp | 135 +++- indra/newview/llfloaterperformance.h | 11 +- indra/newview/llvoavatar.cpp | 33 +- indra/newview/llvoavatar.h | 3 +- .../skins/default/textures/icons/green_dot.png | Bin 18614 -> 0 bytes indra/newview/skins/default/textures/textures.xml | 2 - .../skins/default/xui/en/floater_performance.xml | 730 ++++++++++----------- .../xui/en/panel_performance_complexity.xml | 92 +++ .../default/xui/en/panel_performance_huds.xml | 20 +- .../default/xui/en/panel_performance_nearby.xml | 25 +- .../xui/en/panel_performance_preferences.xml | 4 +- .../default/xui/en/panel_performance_scripts.xml | 82 --- .../xui/en/panel_performance_troubleshooting.xml | 4 +- 15 files changed, 661 insertions(+), 522 deletions(-) delete mode 100644 indra/newview/skins/default/textures/icons/green_dot.png create mode 100644 indra/newview/skins/default/xui/en/panel_performance_complexity.xml delete mode 100644 indra/newview/skins/default/xui/en/panel_performance_scripts.xml (limited to 'indra/newview') diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index 4fd57c7341..8b09f7903d 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -235,6 +235,12 @@ void LLAvatarRenderNotifier::updateNotificationAgent(U32 agentComplexity) // save the value for use in following messages mLatestAgentComplexity = agentComplexity; + static LLCachedControl show_my_complexity_changes(gSavedSettings, "ShowMyComplexityChanges", 20); + if (!show_my_complexity_changes) + { + return; + } + if (!isAgentAvatarValid() || !gAgentWearables.areWearablesLoaded()) { // data not ready, nothing to show. @@ -282,7 +288,8 @@ static const char* e_hud_messages[] = }; LLHUDRenderNotifier::LLHUDRenderNotifier() : -mReportedHUDWarning(WARN_NONE) +mReportedHUDWarning(WARN_NONE), +mHUDsCount(0) { } @@ -299,7 +306,14 @@ void LLHUDRenderNotifier::updateNotificationHUD(hud_complexity_list_t complexity } mHUDComplexityList = complexity; + mHUDsCount = mHUDComplexityList.size(); + static LLCachedControl show_my_complexity_changes(gSavedSettings, "ShowMyComplexityChanges", 20); + if (!show_my_complexity_changes) + { + return; + } + // TODO: // Find a way to show message with list of issues, but without making it too large // and intrusive. diff --git a/indra/newview/llavatarrendernotifier.h b/indra/newview/llavatarrendernotifier.h index 3fd7a32d84..37130bfcf6 100644 --- a/indra/newview/llavatarrendernotifier.h +++ b/indra/newview/llavatarrendernotifier.h @@ -63,6 +63,25 @@ struct LLHUDComplexity typedef std::list hud_complexity_list_t; +struct LLObjectComplexity +{ + LLObjectComplexity() + { + reset(); + } + void reset() + { + objectId = LLUUID::null; + objectName = ""; + objectCost = 0; + } + LLUUID objectId; + std::string objectName; + U32 objectCost; +}; + +typedef std::list object_complexity_list_t; + // Class to notify user about drastic changes in agent's render weights or if other agents // reported that user's agent is too 'heavy' for their settings class LLAvatarRenderNotifier : public LLSingleton @@ -77,6 +96,9 @@ public: void updateNotificationState(); void updateNotificationAgent(U32 agentComplexity); + void setObjectComplexityList(object_complexity_list_t object_list) { mObjectComplexityList = object_list; } + object_complexity_list_t getObjectComplexityList() { return mObjectComplexityList; } + private: LLNotificationPtr mNotificationPtr; @@ -109,6 +131,8 @@ private: // Used to detect changes in voavatar's rezzed status. // If value decreases - there were changes in outfit. S32 mLastOutfitRezStatus; + + object_complexity_list_t mObjectComplexityList; }; // Class to notify user about heavy set of HUD @@ -122,6 +146,7 @@ public: bool isNotificationVisible(); hud_complexity_list_t getHUDComplexityList() { return mHUDComplexityList; } + S32 getHUDsCount() { return mHUDsCount; } private: enum EWarnLevel @@ -144,6 +169,7 @@ private: LLHUDComplexity mLatestHUDComplexity; LLFrameTimer mHUDPopUpDelayTimer; hud_complexity_list_t mHUDComplexityList; + S32 mHUDsCount; }; #endif /* ! defined(LL_llavatarrendernotifier_H) */ diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp index a44c3a262d..c96d3dac5e 100644 --- a/indra/newview/llfloaterperformance.cpp +++ b/indra/newview/llfloaterperformance.cpp @@ -37,17 +37,22 @@ #include "lltextbox.h" #include "lltrans.h" #include "llvoavatar.h" +#include "llvoavatarself.h" + +const F32 REFRESH_INTERVAL = 1.0f; +const S32 COMPLEXITY_THRESHOLD_1 = 100000; LLFloaterPerformance::LLFloaterPerformance(const LLSD& key) - : LLFloater(key) +: LLFloater(key), + mUpdateTimer(new LLTimer()) { - } LLFloaterPerformance::~LLFloaterPerformance() { mComplexityChangedSignal.disconnect(); + delete mUpdateTimer; } BOOL LLFloaterPerformance::postBuild() @@ -55,32 +60,34 @@ BOOL LLFloaterPerformance::postBuild() mMainPanel = getChild("panel_performance_main"); mTroubleshootingPanel = getChild("panel_performance_troubleshooting"); mNearbyPanel = getChild("panel_performance_nearby"); - mScriptsPanel = getChild("panel_performance_scripts"); - mPreferencesPanel = getChild("panel_performance_preferences"); + mComplexityPanel = getChild("panel_performance_complexity"); + mSettingsPanel = getChild("panel_performance_preferences"); mHUDsPanel = getChild("panel_performance_huds"); getChild("troubleshooting_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mTroubleshootingPanel)); getChild("nearby_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mNearbyPanel)); - getChild("scripts_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mScriptsPanel)); - getChild("preferences_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mPreferencesPanel)); + getChild("complexity_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mComplexityPanel)); + getChild("settings_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mSettingsPanel)); getChild("huds_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mHUDsPanel)); initBackBtn(mTroubleshootingPanel); initBackBtn(mNearbyPanel); - initBackBtn(mScriptsPanel); - initBackBtn(mPreferencesPanel); + initBackBtn(mComplexityPanel); + initBackBtn(mSettingsPanel); initBackBtn(mHUDsPanel); - - mHUDsPanel->getChild("refresh_list_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::populateHUDList, this)); - mHUDList = mHUDsPanel->getChild("hud_list"); mHUDList->setNameListType(LLNameListCtrl::SPECIAL); mHUDList->setHoverIconName("StopReload_Off"); mHUDList->setIconClickedCallback(boost::bind(&LLFloaterPerformance::detachItem, this, _1)); - mPreferencesPanel->getChild("advanced_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickAdvanced, this)); - mPreferencesPanel->getChild("defaults_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickRecommended, this)); + mObjectList = mComplexityPanel->getChild("obj_list"); + mObjectList->setNameListType(LLNameListCtrl::SPECIAL); + mObjectList->setHoverIconName("StopReload_Off"); + mObjectList->setIconClickedCallback(boost::bind(&LLFloaterPerformance::detachItem, this, _1)); + + mSettingsPanel->getChild("advanced_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickAdvanced, this)); + mSettingsPanel->getChild("defaults_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickRecommended, this)); mNearbyPanel->getChild("exceptions_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickExceptions, this)); mNearbyList = mNearbyPanel->getChild("nearby_list"); @@ -89,6 +96,8 @@ BOOL LLFloaterPerformance::postBuild() mComplexityChangedSignal = gSavedSettings.getControl("IndirectMaxComplexity")->getCommitSignal()->connect(boost::bind(&LLFloaterPerformance::updateComplexityText, this)); mNearbyPanel->getChild("IndirectMaxComplexity")->setCommitCallback(boost::bind(&LLFloaterPerformance::updateMaxComplexity, this)); + LLAvatarComplexityControls::setIndirectMaxArc(); + return TRUE; } @@ -107,13 +116,43 @@ void LLFloaterPerformance::showSelectedPanel(LLPanel* selected_panel) } } +void LLFloaterPerformance::draw() +{ + if (mUpdateTimer->hasExpired()) + { + getChild("fps_value")->setValue((S32)llround(LLTrace::get_frame_recording().getPeriodMeanPerSec(LLStatViewer::FPS))); + if (mMainPanel->getVisible()) + { + mMainPanel->getChild("huds_value")->setValue(LLHUDRenderNotifier::getInstance()->getHUDsCount()); + mMainPanel->getChild("complexity_value")->setValue((S32)gAgentAvatarp->getVisualComplexity()); + updateNearbyComplexityDesc(); + } + else if (mHUDsPanel->getVisible()) + { + populateHUDList(); + } + else if (mNearbyPanel->getVisible()) + { + populateNearbyList(); + updateNearbyComplexityDesc(); + } + else if (mComplexityPanel->getVisible()) + { + populateObjectList(); + } + + mUpdateTimer->setTimerExpirySec(REFRESH_INTERVAL); + } + LLFloater::draw(); +} + void LLFloaterPerformance::showMainPanel() { mTroubleshootingPanel->setVisible(FALSE); mNearbyPanel->setVisible(FALSE); - mScriptsPanel->setVisible(FALSE); + mComplexityPanel->setVisible(FALSE); mHUDsPanel->setVisible(FALSE); - mPreferencesPanel->setVisible(FALSE); + mSettingsPanel->setVisible(FALSE); mMainPanel->setVisible(TRUE); } @@ -165,16 +204,55 @@ void LLFloaterPerformance::populateHUDList() mHUDsPanel->getChild("huds_value")->setValue(std::to_string(complexity_list.size())); } +void LLFloaterPerformance::populateObjectList() +{ + mObjectList->clearRows(); + mObjectList->updateColumns(true); + + object_complexity_list_t complexity_list = LLAvatarRenderNotifier::getInstance()->getObjectComplexityList(); + + object_complexity_list_t::iterator iter = complexity_list.begin(); + object_complexity_list_t::iterator end = complexity_list.end(); + + for (; iter != end; ++iter) + { + LLObjectComplexity object_complexity = *iter; + + LLSD item; + item["special_id"] = object_complexity.objectId; + item["target"] = LLNameListCtrl::SPECIAL; + LLSD& row = item["columns"]; + row[0]["column"] = "complex_visual"; + row[0]["type"] = "text"; + row[0]["value"] = "*"; + + row[1]["column"] = "complex_value"; + row[1]["type"] = "text"; + row[1]["value"] = std::to_string(object_complexity.objectCost); + row[1]["font"]["name"] = "SANSSERIF"; + + row[2]["column"] = "name"; + row[2]["type"] = "text"; + row[2]["value"] = object_complexity.objectName; + row[2]["font"]["name"] = "SANSSERIF"; + + mObjectList->addElement(item); + } + mObjectList->sortByColumnIndex(1, FALSE); +} + void LLFloaterPerformance::populateNearbyList() { mNearbyList->clearRows(); mNearbyList->updateColumns(true); + S32 avatars = 0; + std::vector::iterator char_iter = LLCharacter::sInstances.begin(); while (char_iter != LLCharacter::sInstances.end()) { LLVOAvatar* avatar = dynamic_cast(*char_iter); - if (avatar && !avatar->isDead() && !avatar->isControlAvatar()) + if (avatar && !avatar->isDead() && !avatar->isControlAvatar() && !avatar->isSelf()) { avatar->calculateUpdateRenderComplexity(); @@ -204,17 +282,38 @@ void LLFloaterPerformance::populateNearbyList() name_text->setColor(LLUIColorTable::instance().getColor("ConversationFriendColor")); } } + avatars++; } char_iter++; } - mNearbyList->sortByColumnIndex(1, FALSE); + mNearbyList->sortByColumnIndex(1, FALSE); +} +void LLFloaterPerformance::updateNearbyComplexityDesc() +{ + S32 max_complexity = 0; + std::vector::iterator char_iter = LLCharacter::sInstances.begin(); + while (char_iter != LLCharacter::sInstances.end()) + { + LLVOAvatar* avatar = dynamic_cast(*char_iter); + if (avatar && !avatar->isDead() && !avatar->isControlAvatar() && !avatar->isSelf()) + { + max_complexity = llmax(max_complexity, (S32)avatar->getVisualComplexity()); + } + char_iter++; + } + std::string desc = getString(max_complexity > COMPLEXITY_THRESHOLD_1 ? "very_high" : "medium"); + + if (mMainPanel->getVisible()) + { + mMainPanel->getChild("avatars_nearby_value")->setValue(desc); + } + mNearbyPanel->getChild("av_nearby_value")->setValue(desc); } void LLFloaterPerformance::detachItem(const LLUUID& item_id) { LLAppearanceMgr::instance().removeItemFromAvatar(item_id); - mHUDList->removeNameItem(item_id); } void LLFloaterPerformance::onClickRecommended() diff --git a/indra/newview/llfloaterperformance.h b/indra/newview/llfloaterperformance.h index 0cba07f21e..1facfe9225 100644 --- a/indra/newview/llfloaterperformance.h +++ b/indra/newview/llfloaterperformance.h @@ -37,6 +37,7 @@ public: virtual ~LLFloaterPerformance(); /*virtual*/ BOOL postBuild(); + /*virtual*/ void draw(); void showSelectedPanel(LLPanel* selected_panel); void showMainPanel(); @@ -46,6 +47,7 @@ public: private: void initBackBtn(LLPanel* panel); void populateHUDList(); + void populateObjectList(); void populateNearbyList(); void onClickAdvanced(); @@ -55,15 +57,20 @@ private: void updateMaxComplexity(); void updateComplexityText(); + void updateNearbyComplexityDesc(); + LLPanel* mMainPanel; LLPanel* mTroubleshootingPanel; LLPanel* mNearbyPanel; - LLPanel* mScriptsPanel; + LLPanel* mComplexityPanel; LLPanel* mHUDsPanel; - LLPanel* mPreferencesPanel; + LLPanel* mSettingsPanel; LLNameListCtrl* mHUDList; + LLNameListCtrl* mObjectList; LLNameListCtrl* mNearbyList; + LLTimer* mUpdateTimer; + boost::signals2::connection mComplexityChangedSignal; }; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index f69b9b3861..ab7e5f7f8a 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -10533,7 +10533,8 @@ void LLVOAvatar::accountRenderComplexityForObject( const F32 max_attachment_complexity, LLVOVolume::texture_cost_t& textures, U32& cost, - hud_complexity_list_t& hud_complexity_list) + hud_complexity_list_t& hud_complexity_list, + object_complexity_list_t& object_complexity_list) { if (attached_object && !attached_object->isHUDAttachment()) { @@ -10552,12 +10553,12 @@ void LLVOAvatar::accountRenderComplexityForObject( F32 attachment_volume_cost = 0; F32 attachment_texture_cost = 0; F32 attachment_children_cost = 0; - const F32 animated_object_attachment_surcharge = 1000; + const F32 animated_object_attachment_surcharge = 1000; - if (attached_object->isAnimatedObject()) - { - attachment_volume_cost += animated_object_attachment_surcharge; - } + if (attached_object->isAnimatedObject()) + { + attachment_volume_cost += animated_object_attachment_surcharge; + } attachment_volume_cost += volume->getRenderCost(textures); const_child_list_t children = volume->getChildren(); @@ -10590,6 +10591,15 @@ void LLVOAvatar::accountRenderComplexityForObject( << LL_ENDL; // Limit attachment complexity to avoid signed integer flipping of the wearer's ACI cost += (U32)llclamp(attachment_total_cost, MIN_ATTACHMENT_COMPLEXITY, max_attachment_complexity); + + if (isSelf()) + { + LLObjectComplexity object_complexity; + object_complexity.objectName = attached_object->getAttachmentItemName(); + object_complexity.objectId = attached_object->getAttachmentItemID(); + object_complexity.objectCost = attachment_total_cost; + object_complexity_list.push_back(object_complexity); + } } } } @@ -10676,6 +10686,7 @@ void LLVOAvatar::calculateUpdateRenderComplexity() U32 cost = VISUAL_COMPLEXITY_UNKNOWN; LLVOVolume::texture_cost_t textures; hud_complexity_list_t hud_complexity_list; + object_complexity_list_t object_complexity_list; for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) { @@ -10706,7 +10717,7 @@ void LLVOAvatar::calculateUpdateRenderComplexity() if (volp && !volp->isAttachment()) { accountRenderComplexityForObject(volp, max_attachment_complexity, - textures, cost, hud_complexity_list); + textures, cost, hud_complexity_list, object_complexity_list); } } @@ -10722,7 +10733,7 @@ void LLVOAvatar::calculateUpdateRenderComplexity() { const LLViewerObject* attached_object = attachment_iter->get(); accountRenderComplexityForObject(attached_object, max_attachment_complexity, - textures, cost, hud_complexity_list); + textures, cost, hud_complexity_list, object_complexity_list); } } @@ -10782,13 +10793,13 @@ void LLVOAvatar::calculateUpdateRenderComplexity() mVisualComplexity = cost; mVisualComplexityStale = false; - static LLCachedControl show_my_complexity_changes(gSavedSettings, "ShowMyComplexityChanges", 20); - - if (isSelf() && show_my_complexity_changes) + if (isSelf()) { // Avatar complexity LLAvatarRenderNotifier::getInstance()->updateNotificationAgent(mVisualComplexity); + LLAvatarRenderNotifier::getInstance()->setObjectComplexityList(object_complexity_list); + // HUD complexity LLHUDRenderNotifier::getInstance()->updateNotificationHUD(hud_complexity_list); } diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 74ef589ca4..f83f9d4eaf 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -299,7 +299,8 @@ public: const F32 max_attachment_complexity, LLVOVolume::texture_cost_t& textures, U32& cost, - hud_complexity_list_t& hud_complexity_list); + hud_complexity_list_t& hud_complexity_list, + object_complexity_list_t& object_complexity_list); void calculateUpdateRenderComplexity(); static const U32 VISUAL_COMPLEXITY_UNKNOWN; void updateVisualComplexity(); diff --git a/indra/newview/skins/default/textures/icons/green_dot.png b/indra/newview/skins/default/textures/icons/green_dot.png deleted file mode 100644 index 02c07810c2..0000000000 Binary files a/indra/newview/skins/default/textures/icons/green_dot.png and /dev/null differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 51bb91cbf9..a875c4e848 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -234,8 +234,6 @@ with the same filename but different name - - diff --git a/indra/newview/skins/default/xui/en/floater_performance.xml b/indra/newview/skins/default/xui/en/floater_performance.xml index 42269ba34a..09af364266 100644 --- a/indra/newview/skins/default/xui/en/floater_performance.xml +++ b/indra/newview/skins/default/xui/en/floater_performance.xml @@ -1,409 +1,387 @@ + + - - Current FPS - - - 75.2 - - - - - - - - Client: - - - Network: - - - Server: - - - Normal - - - Normal - - - Normal - - - - General troubleshooting - - - Choose among common problems and see what you can do. - - + top="5"> + + 75 + + + FPS -- 60 or more for the best experience + + - - Avatars nearby: - - - 42 (very high) - - - Click to review avatars and choose a complexity limit. - - - - - - This location is - - - very complex - - - Try changing graphics quality or draw distance. - - - - - + - Your avatar: - - + + Quick settings for common situations + + + Choose settings for parties, exploration, photography, and more. + + + + - 12 scripts - - + + Individual settings + + + More control over quality, visibility distance, and enhancements. + + + + - Removing high-impact attachments may improve graphics speed. - - - - - + + Nearby avatar complexity is + + + very high + + + Choose which avatars are not displayed in detail, to increase FPS. + + + + - Your HUDs: - - + + Your avatar complexity is + + + 275 + + + Reduce the complexity of your avatar if you aren't satisfied with current FPS. + + + + - 7 - - + + Your current HUDs: + + + 7 + + + Removing HUDs you are not using can improve speed. + + + + - Removing HUDs you are not using can improve graphics speed. - - + top_pad="20"> + + General troubleshooting + + + Choose among common problems and see what you can do. + + + - + top="55" /> + top="55" /> + top="55" /> + top="55" /> + top="55" /> diff --git a/indra/newview/skins/default/xui/en/panel_performance_complexity.xml b/indra/newview/skins/default/xui/en/panel_performance_complexity.xml new file mode 100644 index 0000000000..8d4512c4f7 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_performance_complexity.xml @@ -0,0 +1,92 @@ + + + + + Back + + + My avatar complexity + + + Complex attachments require more time and memory to display. + + + While you are in this location, removing the most complex ones may increase speed. + + + + + + + diff --git a/indra/newview/skins/default/xui/en/panel_performance_huds.xml b/indra/newview/skins/default/xui/en/panel_performance_huds.xml index c881fadbe8..96bdf2412f 100644 --- a/indra/newview/skins/default/xui/en/panel_performance_huds.xml +++ b/indra/newview/skins/default/xui/en/panel_performance_huds.xml @@ -15,7 +15,7 @@ mouse_opaque="true" follows="left|top" name="back_btn" - top="10" + top="7" image_selected="Arrow_Left_Off" image_pressed="Arrow_Left_Off" image_unselected="Arrow_Left_Off" @@ -27,7 +27,7 @@ height="20" layout="topleft" left_pad="3" - top="13" + top="10" name="back_lbl" width="40"> Back @@ -35,14 +35,14 @@ - HUDs displayed: + width="135"> + Your current HUDs: - If there are any you don't need, detaching them may improve graphics speed. + Detaching HUDs you aren't using us always a good idea, but especially in a complex location. - - - Back - - - Avatar attachment scripts: - - - 12 - - - These attachments contain scripts (embedded apps) that use memory. - - - If there are any you don't need, detaching them may improve graphics speed. - - diff --git a/indra/newview/skins/default/xui/en/panel_performance_troubleshooting.xml b/indra/newview/skins/default/xui/en/panel_performance_troubleshooting.xml index d942580880..0a14eeb1c0 100644 --- a/indra/newview/skins/default/xui/en/panel_performance_troubleshooting.xml +++ b/indra/newview/skins/default/xui/en/panel_performance_troubleshooting.xml @@ -15,7 +15,7 @@ mouse_opaque="true" follows="left|top" name="back_btn" - top="10" + top="7" image_selected="Arrow_Left_Off" image_pressed="Arrow_Left_Off" image_unselected="Arrow_Left_Off" @@ -27,7 +27,7 @@ height="20" layout="topleft" left_pad="3" - top="13" + top="10" name="back_lbl" width="40"> Back -- cgit v1.2.3 From 3fe7715197c1e9a4ae781201df7a9ec24354f15e Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 18 Jun 2021 18:36:15 +0300 Subject: SL-15297 WIP Implement performance floater - Quick and Individual settings panels --- indra/newview/llfloaterperformance.cpp | 45 +++- indra/newview/llfloaterperformance.h | 3 +- .../skins/default/xui/en/floater_performance.xml | 10 +- .../default/xui/en/panel_performance_nearby.xml | 2 +- .../xui/en/panel_performance_preferences.xml | 255 ++++++++++++++++----- .../default/xui/en/panel_performance_presets.xml | 223 ++++++++++++++++++ 6 files changed, 461 insertions(+), 77 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/panel_performance_presets.xml (limited to 'indra/newview') diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp index c96d3dac5e..424ca04b1f 100644 --- a/indra/newview/llfloaterperformance.cpp +++ b/indra/newview/llfloaterperformance.cpp @@ -63,18 +63,21 @@ BOOL LLFloaterPerformance::postBuild() mComplexityPanel = getChild("panel_performance_complexity"); mSettingsPanel = getChild("panel_performance_preferences"); mHUDsPanel = getChild("panel_performance_huds"); + mPresetsPanel = getChild("panel_performance_presets"); getChild("troubleshooting_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mTroubleshootingPanel)); getChild("nearby_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mNearbyPanel)); getChild("complexity_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mComplexityPanel)); getChild("settings_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mSettingsPanel)); getChild("huds_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mHUDsPanel)); + getChild("presets_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mPresetsPanel)); initBackBtn(mTroubleshootingPanel); initBackBtn(mNearbyPanel); initBackBtn(mComplexityPanel); initBackBtn(mSettingsPanel); initBackBtn(mHUDsPanel); + initBackBtn(mPresetsPanel); mHUDList = mHUDsPanel->getChild("hud_list"); mHUDList->setNameListType(LLNameListCtrl::SPECIAL); @@ -87,11 +90,13 @@ BOOL LLFloaterPerformance::postBuild() mObjectList->setIconClickedCallback(boost::bind(&LLFloaterPerformance::detachItem, this, _1)); mSettingsPanel->getChild("advanced_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickAdvanced, this)); - mSettingsPanel->getChild("defaults_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickRecommended, this)); mNearbyPanel->getChild("exceptions_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickExceptions, this)); mNearbyList = mNearbyPanel->getChild("nearby_list"); + mPresetsPanel->getChild("avatars_nearby_link")->setURLClickedCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mNearbyPanel)); + mPresetsPanel->getChild("settings_link")->setURLClickedCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mSettingsPanel)); + updateComplexityText(); mComplexityChangedSignal = gSavedSettings.getControl("IndirectMaxComplexity")->getCommitSignal()->connect(boost::bind(&LLFloaterPerformance::updateComplexityText, this)); mNearbyPanel->getChild("IndirectMaxComplexity")->setCommitCallback(boost::bind(&LLFloaterPerformance::updateMaxComplexity, this)); @@ -103,8 +108,9 @@ BOOL LLFloaterPerformance::postBuild() void LLFloaterPerformance::showSelectedPanel(LLPanel* selected_panel) { - selected_panel->setVisible(TRUE); + hidePanels(); mMainPanel->setVisible(FALSE); + selected_panel->setVisible(TRUE); if (mHUDsPanel == selected_panel) { @@ -147,13 +153,19 @@ void LLFloaterPerformance::draw() } void LLFloaterPerformance::showMainPanel() +{ + hidePanels(); + mMainPanel->setVisible(TRUE); +} + +void LLFloaterPerformance::hidePanels() { mTroubleshootingPanel->setVisible(FALSE); mNearbyPanel->setVisible(FALSE); mComplexityPanel->setVisible(FALSE); mHUDsPanel->setVisible(FALSE); mSettingsPanel->setVisible(FALSE); - mMainPanel->setVisible(TRUE); + mPresetsPanel->setVisible(FALSE); } void LLFloaterPerformance::initBackBtn(LLPanel* panel) @@ -247,6 +259,7 @@ void LLFloaterPerformance::populateNearbyList() mNearbyList->updateColumns(true); S32 avatars = 0; + static LLCachedControl max_render_cost(gSavedSettings, "RenderAvatarMaxComplexity", 0); std::vector::iterator char_iter = LLCharacter::sInstances.begin(); while (char_iter != LLCharacter::sInstances.end()) @@ -274,12 +287,21 @@ void LLFloaterPerformance::populateNearbyList() row[2]["font"]["name"] = "SANSSERIF"; LLScrollListItem* av_item = mNearbyList->addElement(item); - if(av_item && LLAvatarActions::isFriend(avatar->getID())) + if(av_item) { LLScrollListText* name_text = dynamic_cast(av_item->getColumn(2)); if (name_text) { - name_text->setColor(LLUIColorTable::instance().getColor("ConversationFriendColor")); + std::string color = "white"; + if (avatar->getVisualComplexity() > max_render_cost) + { + color = "LabelDisabledColor"; + } + else if (LLAvatarActions::isFriend(avatar->getID())) + { + color = "ConversationFriendColor"; + } + name_text->setColor(LLUIColorTable::instance().getColor(color)); } } avatars++; @@ -291,6 +313,7 @@ void LLFloaterPerformance::populateNearbyList() void LLFloaterPerformance::updateNearbyComplexityDesc() { + static LLCachedControl max_render_cost(gSavedSettings, "RenderAvatarMaxComplexity", 0); S32 max_complexity = 0; std::vector::iterator char_iter = LLCharacter::sInstances.begin(); while (char_iter != LLCharacter::sInstances.end()) @@ -302,7 +325,7 @@ void LLFloaterPerformance::updateNearbyComplexityDesc() } char_iter++; } - std::string desc = getString(max_complexity > COMPLEXITY_THRESHOLD_1 ? "very_high" : "medium"); + std::string desc = getString(max_complexity > llmin((S32)max_render_cost, COMPLEXITY_THRESHOLD_1) ? "very_high" : "medium"); if (mMainPanel->getVisible()) { @@ -316,13 +339,13 @@ void LLFloaterPerformance::detachItem(const LLUUID& item_id) LLAppearanceMgr::instance().removeItemFromAvatar(item_id); } -void LLFloaterPerformance::onClickRecommended() -{ - LLFeatureManager::getInstance()->applyRecommendedSettings(); -} - void LLFloaterPerformance::onClickAdvanced() { + LLFloaterPreference* instance = LLFloaterReg::getTypedInstance("preferences"); + if (instance) + { + instance->saveSettings(); + } LLFloaterReg::showInstance("prefs_graphics_advanced"); } diff --git a/indra/newview/llfloaterperformance.h b/indra/newview/llfloaterperformance.h index 1facfe9225..7aec7c3f6c 100644 --- a/indra/newview/llfloaterperformance.h +++ b/indra/newview/llfloaterperformance.h @@ -41,6 +41,7 @@ public: void showSelectedPanel(LLPanel* selected_panel); void showMainPanel(); + void hidePanels(); void detachItem(const LLUUID& item_id); @@ -51,7 +52,6 @@ private: void populateNearbyList(); void onClickAdvanced(); - void onClickRecommended(); void onClickExceptions(); void updateMaxComplexity(); @@ -65,6 +65,7 @@ private: LLPanel* mComplexityPanel; LLPanel* mHUDsPanel; LLPanel* mSettingsPanel; + LLPanel* mPresetsPanel; LLNameListCtrl* mHUDList; LLNameListCtrl* mObjectList; LLNameListCtrl* mNearbyList; diff --git a/indra/newview/skins/default/xui/en/floater_performance.xml b/indra/newview/skins/default/xui/en/floater_performance.xml index 09af364266..e415ac5be0 100644 --- a/indra/newview/skins/default/xui/en/floater_performance.xml +++ b/indra/newview/skins/default/xui/en/floater_performance.xml @@ -194,7 +194,7 @@ text_color="PerformanceMid" height="20" layout="topleft" - left_pad="5" + left_pad="2" name="avatars_nearby_value" width="100"> very high @@ -382,6 +382,14 @@ right="-20"/> + - This location is very complex + Individual settings + - While you are here, you may want to reduce graphics quality or draw distance. - - - Graphics quality +shortcuts - Enhancements + top_pad="15" + left="160" + name="quality_desc" + width="380"> + Choosing a shortcut will reset all manual changes you have made. - - - - + name="border2" + top_pad="15" + left="20" + width="540"/> - Draw distance + Visibility distance - Regions are 256 m x 256 m. + width="350"> + To zoom out and see long distances, increase the distance. - To zoom out and see long distances, increase the draw distance. + width="350"> + If you are indoors, decrease the distance to improve speed. + + Enhancements + + - If you are socializing in a small area, decrease the draw distance. + name="enhancements_desc" + width="350"> + Each enhancement improves realism but can reduce speed. - + width="540"/> + + Back + + + Quick settings + + + Note: Quick settings will reset all manual changes you have made. + + + + + Tuned for many avatars in a room. + + + Nearby avatar complexity is high. + + + [secondlife:/// Choose avatars to show and hide] + + + + + Fewer avatars, higher visibility distance. + + + + + Good for zooming your camera far out and viewing large land areas. + + + + + Maximum quality, minimum visibility distance. + + + + For more control, try + + + [secondlife:/// Idividual Settings] + + + -- cgit v1.2.3 From f33605f8b113f1fed84564c7618630acd5c9427a Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 24 Jun 2021 16:17:04 +0300 Subject: SL-15297 WIP Implement performance floater - implement complexity bars --- indra/newview/llfloaterperformance.cpp | 118 ++++++++++++++++----- indra/newview/llfloaterperformance.h | 4 + .../skins/default/xui/en/floater_performance.xml | 3 + 3 files changed, 101 insertions(+), 24 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp index 424ca04b1f..beeebcb202 100644 --- a/indra/newview/llfloaterperformance.cpp +++ b/indra/newview/llfloaterperformance.cpp @@ -26,13 +26,15 @@ #include "llviewerprecompiledheaders.h" #include "llfloaterperformance.h" +#include "llagent.h" +#include "llagentcamera.h" #include "llappearancemgr.h" #include "llavataractions.h" #include "llavatarrendernotifier.h" #include "llfeaturemanager.h" +#include "llfloaterpreference.h" // LLAvatarComplexityControls #include "llfloaterreg.h" #include "llnamelistctrl.h" -#include "llfloaterpreference.h" // LLAvatarComplexityControls #include "llsliderctrl.h" #include "lltextbox.h" #include "lltrans.h" @@ -40,12 +42,16 @@ #include "llvoavatarself.h" const F32 REFRESH_INTERVAL = 1.0f; -const S32 COMPLEXITY_THRESHOLD_1 = 100000; - +const S32 COMPLEXITY_THRESHOLD_HIGH = 100000; +const S32 COMPLEXITY_THRESHOLD_MEDIUM = 30000; +const S32 BAR_LEFT_PAD = 2; +const S32 BAR_RIGHT_PAD = 5; +const S32 BAR_BOTTOM_PAD = 9; LLFloaterPerformance::LLFloaterPerformance(const LLSD& key) : LLFloater(key), - mUpdateTimer(new LLTimer()) + mUpdateTimer(new LLTimer()), + mNearbyMaxComplexity(0) { } @@ -120,6 +126,10 @@ void LLFloaterPerformance::showSelectedPanel(LLPanel* selected_panel) { populateNearbyList(); } + else if (mComplexityPanel == selected_panel) + { + populateObjectList(); + } } void LLFloaterPerformance::draw() @@ -179,6 +189,7 @@ void LLFloaterPerformance::initBackBtn(LLPanel* panel) void LLFloaterPerformance::populateHUDList() { + S32 prev_pos = mHUDList->getScrollPos(); mHUDList->clearRows(); mHUDList->updateColumns(true); @@ -186,8 +197,14 @@ void LLFloaterPerformance::populateHUDList() hud_complexity_list_t::iterator iter = complexity_list.begin(); hud_complexity_list_t::iterator end = complexity_list.end(); - + + U32 max_complexity = 0; for (; iter != end; ++iter) + { + max_complexity = llmax(max_complexity, (*iter).objectsCost); + } + + for (iter = complexity_list.begin(); iter != end; ++iter) { LLHUDComplexity hud_object_complexity = *iter; @@ -196,8 +213,12 @@ void LLFloaterPerformance::populateHUDList() item["target"] = LLNameListCtrl::SPECIAL; LLSD& row = item["columns"]; row[0]["column"] = "complex_visual"; - row[0]["type"] = "text"; - row[0]["value"] = "*"; + row[0]["type"] = "image"; + LLSD& value = row[0]["value"]; + value["ratio"] = (F32)hud_object_complexity.objectsCost / max_complexity; + value["bottom"] = BAR_BOTTOM_PAD; + value["left_pad"] = BAR_LEFT_PAD; + value["right_pad"] = BAR_RIGHT_PAD; row[1]["column"] = "complex_value"; row[1]["type"] = "text"; @@ -212,12 +233,14 @@ void LLFloaterPerformance::populateHUDList() mHUDList->addElement(item); } mHUDList->sortByColumnIndex(1, FALSE); + mHUDList->setScrollPos(prev_pos); mHUDsPanel->getChild("huds_value")->setValue(std::to_string(complexity_list.size())); } void LLFloaterPerformance::populateObjectList() { + S32 prev_pos = mObjectList->getScrollPos(); mObjectList->clearRows(); mObjectList->updateColumns(true); @@ -226,7 +249,13 @@ void LLFloaterPerformance::populateObjectList() object_complexity_list_t::iterator iter = complexity_list.begin(); object_complexity_list_t::iterator end = complexity_list.end(); + U32 max_complexity = 0; for (; iter != end; ++iter) + { + max_complexity = llmax(max_complexity, (*iter).objectCost); + } + + for (iter = complexity_list.begin(); iter != end; ++iter) { LLObjectComplexity object_complexity = *iter; @@ -235,8 +264,12 @@ void LLFloaterPerformance::populateObjectList() item["target"] = LLNameListCtrl::SPECIAL; LLSD& row = item["columns"]; row[0]["column"] = "complex_visual"; - row[0]["type"] = "text"; - row[0]["value"] = "*"; + row[0]["type"] = "image"; + LLSD& value = row[0]["value"]; + value["ratio"] = (F32)object_complexity.objectCost / max_complexity; + value["bottom"] = BAR_BOTTOM_PAD; + value["left_pad"] = BAR_LEFT_PAD; + value["right_pad"] = BAR_RIGHT_PAD; row[1]["column"] = "complex_value"; row[1]["type"] = "text"; @@ -251,30 +284,35 @@ void LLFloaterPerformance::populateObjectList() mObjectList->addElement(item); } mObjectList->sortByColumnIndex(1, FALSE); + mObjectList->setScrollPos(prev_pos); } void LLFloaterPerformance::populateNearbyList() { + S32 prev_pos = mNearbyList->getScrollPos(); mNearbyList->clearRows(); mNearbyList->updateColumns(true); - S32 avatars = 0; static LLCachedControl max_render_cost(gSavedSettings, "RenderAvatarMaxComplexity", 0); + std::vector valid_nearby_avs; + getNearbyAvatars(valid_nearby_avs); - std::vector::iterator char_iter = LLCharacter::sInstances.begin(); - while (char_iter != LLCharacter::sInstances.end()) + std::vector::iterator char_iter = valid_nearby_avs.begin(); + while (char_iter != valid_nearby_avs.end()) { LLVOAvatar* avatar = dynamic_cast(*char_iter); - if (avatar && !avatar->isDead() && !avatar->isControlAvatar() && !avatar->isSelf()) + if (avatar) { - avatar->calculateUpdateRenderComplexity(); - LLSD item; item["id"] = avatar->getID(); LLSD& row = item["columns"]; row[0]["column"] = "complex_visual"; - row[0]["type"] = "text"; - row[0]["value"] = "*"; + row[0]["type"] = "image"; + LLSD& value = row[0]["value"]; + value["ratio"] = (F32)avatar->getVisualComplexity() / mNearbyMaxComplexity; + value["bottom"] = BAR_BOTTOM_PAD; + value["left_pad"] = BAR_LEFT_PAD; + value["right_pad"] = BAR_RIGHT_PAD; row[1]["column"] = "complex_value"; row[1]["type"] = "text"; @@ -296,6 +334,11 @@ void LLFloaterPerformance::populateNearbyList() if (avatar->getVisualComplexity() > max_render_cost) { color = "LabelDisabledColor"; + LLScrollListBar* bar = dynamic_cast(av_item->getColumn(0)); + if (bar) + { + bar->setColor(LLUIColorTable::instance().getColor(color)); + } } else if (LLAvatarActions::isFriend(avatar->getID())) { @@ -304,28 +347,55 @@ void LLFloaterPerformance::populateNearbyList() name_text->setColor(LLUIColorTable::instance().getColor(color)); } } - avatars++; } char_iter++; } - mNearbyList->sortByColumnIndex(1, FALSE); + mNearbyList->sortByColumnIndex(1, FALSE); + mNearbyList->setScrollPos(prev_pos); } -void LLFloaterPerformance::updateNearbyComplexityDesc() +void LLFloaterPerformance::getNearbyAvatars(std::vector &valid_nearby_avs) { - static LLCachedControl max_render_cost(gSavedSettings, "RenderAvatarMaxComplexity", 0); - S32 max_complexity = 0; + static LLCachedControl render_far_clip(gSavedSettings, "RenderFarClip", 64); + F32 radius = render_far_clip * render_far_clip; std::vector::iterator char_iter = LLCharacter::sInstances.begin(); while (char_iter != LLCharacter::sInstances.end()) { LLVOAvatar* avatar = dynamic_cast(*char_iter); if (avatar && !avatar->isDead() && !avatar->isControlAvatar() && !avatar->isSelf()) { - max_complexity = llmax(max_complexity, (S32)avatar->getVisualComplexity()); + if ((dist_vec_squared(avatar->getPositionGlobal(), gAgent.getPositionGlobal()) > radius) && + (dist_vec_squared(avatar->getPositionGlobal(), gAgentCamera.getCameraPositionGlobal()) > radius)) + { + char_iter++; + continue; + } + avatar->calculateUpdateRenderComplexity(); + mNearbyMaxComplexity = llmax(mNearbyMaxComplexity, (S32)avatar->getVisualComplexity()); + valid_nearby_avs.push_back(*char_iter); } char_iter++; } - std::string desc = getString(max_complexity > llmin((S32)max_render_cost, COMPLEXITY_THRESHOLD_1) ? "very_high" : "medium"); +} + +void LLFloaterPerformance::updateNearbyComplexityDesc() +{ + std::string desc = getString("low"); + + static LLCachedControl max_render_cost(gSavedSettings, "RenderAvatarMaxComplexity", 0); + if (mMainPanel->getVisible()) + { + std::vector valid_nearby_avs; + getNearbyAvatars(valid_nearby_avs); + } + if (mNearbyMaxComplexity > COMPLEXITY_THRESHOLD_HIGH) + { + desc = getString("very_high"); + } + else if (mNearbyMaxComplexity > COMPLEXITY_THRESHOLD_MEDIUM) + { + desc = getString("medium"); + } if (mMainPanel->getVisible()) { diff --git a/indra/newview/llfloaterperformance.h b/indra/newview/llfloaterperformance.h index 7aec7c3f6c..ea15873b95 100644 --- a/indra/newview/llfloaterperformance.h +++ b/indra/newview/llfloaterperformance.h @@ -28,6 +28,7 @@ #include "llfloater.h" +class LLCharacter; class LLNameListCtrl; class LLFloaterPerformance : public LLFloater @@ -57,6 +58,7 @@ private: void updateMaxComplexity(); void updateComplexityText(); + void getNearbyAvatars(std::vector &valid_nearby_avs); void updateNearbyComplexityDesc(); LLPanel* mMainPanel; @@ -72,6 +74,8 @@ private: LLTimer* mUpdateTimer; + S32 mNearbyMaxComplexity; + boost::signals2::connection mComplexityChangedSignal; }; diff --git a/indra/newview/skins/default/xui/en/floater_performance.xml b/indra/newview/skins/default/xui/en/floater_performance.xml index e415ac5be0..4cd3c7a603 100644 --- a/indra/newview/skins/default/xui/en/floater_performance.xml +++ b/indra/newview/skins/default/xui/en/floater_performance.xml @@ -12,6 +12,9 @@ + Date: Fri, 25 Jun 2021 20:05:07 +0300 Subject: SL-15297 WIP restore selection after updating the list & don't show avatars in the list as disabled when complexity is not limited --- indra/newview/llfloaterperformance.cpp | 14 +++++++---- indra/newview/llnamelistctrl.cpp | 28 ++++++++++++++++++++++ indra/newview/llnamelistctrl.h | 3 +++ indra/newview/skins/default/colors.xml | 5 +--- .../default/xui/en/floater_add_payment_method.xml | 2 +- .../skins/default/xui/en/floater_performance.xml | 12 +++++----- 6 files changed, 49 insertions(+), 15 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp index beeebcb202..b8adf7fedc 100644 --- a/indra/newview/llfloaterperformance.cpp +++ b/indra/newview/llfloaterperformance.cpp @@ -190,6 +190,7 @@ void LLFloaterPerformance::initBackBtn(LLPanel* panel) void LLFloaterPerformance::populateHUDList() { S32 prev_pos = mHUDList->getScrollPos(); + LLUUID prev_selected_id = mHUDList->getSelectedSpecialId(); mHUDList->clearRows(); mHUDList->updateColumns(true); @@ -213,7 +214,7 @@ void LLFloaterPerformance::populateHUDList() item["target"] = LLNameListCtrl::SPECIAL; LLSD& row = item["columns"]; row[0]["column"] = "complex_visual"; - row[0]["type"] = "image"; + row[0]["type"] = "bar"; LLSD& value = row[0]["value"]; value["ratio"] = (F32)hud_object_complexity.objectsCost / max_complexity; value["bottom"] = BAR_BOTTOM_PAD; @@ -234,6 +235,7 @@ void LLFloaterPerformance::populateHUDList() } mHUDList->sortByColumnIndex(1, FALSE); mHUDList->setScrollPos(prev_pos); + mHUDList->selectItemBySpecialId(prev_selected_id); mHUDsPanel->getChild("huds_value")->setValue(std::to_string(complexity_list.size())); } @@ -241,6 +243,7 @@ void LLFloaterPerformance::populateHUDList() void LLFloaterPerformance::populateObjectList() { S32 prev_pos = mObjectList->getScrollPos(); + LLUUID prev_selected_id = mObjectList->getSelectedSpecialId(); mObjectList->clearRows(); mObjectList->updateColumns(true); @@ -264,7 +267,7 @@ void LLFloaterPerformance::populateObjectList() item["target"] = LLNameListCtrl::SPECIAL; LLSD& row = item["columns"]; row[0]["column"] = "complex_visual"; - row[0]["type"] = "image"; + row[0]["type"] = "bar"; LLSD& value = row[0]["value"]; value["ratio"] = (F32)object_complexity.objectCost / max_complexity; value["bottom"] = BAR_BOTTOM_PAD; @@ -285,11 +288,13 @@ void LLFloaterPerformance::populateObjectList() } mObjectList->sortByColumnIndex(1, FALSE); mObjectList->setScrollPos(prev_pos); + mObjectList->selectItemBySpecialId(prev_selected_id); } void LLFloaterPerformance::populateNearbyList() { S32 prev_pos = mNearbyList->getScrollPos(); + LLUUID prev_selected_id = mNearbyList->getStringUUIDSelectedItem(); mNearbyList->clearRows(); mNearbyList->updateColumns(true); @@ -307,7 +312,7 @@ void LLFloaterPerformance::populateNearbyList() item["id"] = avatar->getID(); LLSD& row = item["columns"]; row[0]["column"] = "complex_visual"; - row[0]["type"] = "image"; + row[0]["type"] = "bar"; LLSD& value = row[0]["value"]; value["ratio"] = (F32)avatar->getVisualComplexity() / mNearbyMaxComplexity; value["bottom"] = BAR_BOTTOM_PAD; @@ -331,7 +336,7 @@ void LLFloaterPerformance::populateNearbyList() if (name_text) { std::string color = "white"; - if (avatar->getVisualComplexity() > max_render_cost) + if ((max_render_cost != 0) && (avatar->getVisualComplexity() > max_render_cost)) { color = "LabelDisabledColor"; LLScrollListBar* bar = dynamic_cast(av_item->getColumn(0)); @@ -352,6 +357,7 @@ void LLFloaterPerformance::populateNearbyList() } mNearbyList->sortByColumnIndex(1, FALSE); mNearbyList->setScrollPos(prev_pos); + mNearbyList->selectByID(prev_selected_id); } void LLFloaterPerformance::getNearbyAvatars(std::vector &valid_nearby_avs) diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index e1bf9b1a17..92805e03f0 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -464,6 +464,34 @@ LLScrollListItem* LLNameListCtrl::getNameItemByAgentId(const LLUUID& agent_id) return NULL; } +void LLNameListCtrl::selectItemBySpecialId(const LLUUID& special_id) +{ + if (special_id.isNull()) + { + return; + } + + for (item_list::iterator it = getItemList().begin(); it != getItemList().end(); it++) + { + LLNameListItem* item = dynamic_cast(*it); + if (item && item->getSpecialID() == special_id) + { + item->setSelected(TRUE); + break; + } + } +} + +LLUUID LLNameListCtrl::getSelectedSpecialId() +{ + LLNameListItem* item = dynamic_cast(getFirstSelected()); + if(item) + { + return item->getSpecialID(); + } + return LLUUID(); +} + void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name, std::string suffix, diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index 1a31b1cc10..d7e991c94d 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -162,6 +162,9 @@ public: LLScrollListItem* getNameItemByAgentId(const LLUUID& agent_id); + void selectItemBySpecialId(const LLUUID& special_id); + LLUUID getSelectedSpecialId(); + // LLView interface /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index 9fcb6edca4..e8d3c12d39 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -967,10 +967,7 @@ name="OutfitGalleryItemUnselected" value="0.4 0.4 0.4 1" /> - Date: Tue, 29 Jun 2021 18:34:18 +0300 Subject: SL-15297 WIP update Individual settings panel & correctly show avatar state in the list --- indra/newview/llfloaterperformance.cpp | 8 +- .../xui/en/panel_performance_preferences.xml | 144 ++++++++++++++++++--- 2 files changed, 131 insertions(+), 21 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp index b8adf7fedc..16afeb6e52 100644 --- a/indra/newview/llfloaterperformance.cpp +++ b/indra/newview/llfloaterperformance.cpp @@ -306,7 +306,7 @@ void LLFloaterPerformance::populateNearbyList() while (char_iter != valid_nearby_avs.end()) { LLVOAvatar* avatar = dynamic_cast(*char_iter); - if (avatar) + if (avatar && (LLVOAvatar::AOA_INVISIBLE != avatar->getOverallAppearance())) { LLSD item; item["id"] = avatar->getID(); @@ -336,7 +336,7 @@ void LLFloaterPerformance::populateNearbyList() if (name_text) { std::string color = "white"; - if ((max_render_cost != 0) && (avatar->getVisualComplexity() > max_render_cost)) + if (LLVOAvatar::AOA_JELLYDOLL == avatar->getOverallAppearance()) { color = "LabelDisabledColor"; LLScrollListBar* bar = dynamic_cast(av_item->getColumn(0)); @@ -345,9 +345,9 @@ void LLFloaterPerformance::populateNearbyList() bar->setColor(LLUIColorTable::instance().getColor(color)); } } - else if (LLAvatarActions::isFriend(avatar->getID())) + else if (LLVOAvatar::AOA_NORMAL == avatar->getOverallAppearance()) { - color = "ConversationFriendColor"; + color = LLAvatarActions::isFriend(avatar->getID()) ? "ConversationFriendColor" : "white"; } name_text->setColor(LLUIColorTable::instance().getColor(color)); } diff --git a/indra/newview/skins/default/xui/en/panel_performance_preferences.xml b/indra/newview/skins/default/xui/en/panel_performance_preferences.xml index ec1b624f13..b5cc2a29ed 100644 --- a/indra/newview/skins/default/xui/en/panel_performance_preferences.xml +++ b/indra/newview/skins/default/xui/en/panel_performance_preferences.xml @@ -2,7 +2,7 @@ Graphics quality @@ -74,21 +74,60 @@ shortcuts width="40"> Fastest - - + + + + + + + + + + + 1 + + + 2 + + + 3 + + + 4 + + + 5 + + + 6 + + + 7 + -- cgit v1.2.3 From 77aac9579170369a11f0884e16bd730f8cbb8bdb Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 14 Jul 2021 14:49:43 +0300 Subject: SL-15297 performance floater ui update --- indra/newview/llfloateravatarrendersettings.cpp | 37 +--- indra/newview/llfloateravatarrendersettings.h | 4 - indra/newview/llfloaterperformance.cpp | 178 +++++++++++----- indra/newview/llfloaterperformance.h | 12 +- .../xui/en/floater_avatar_render_settings.xml | 66 +++--- .../skins/default/xui/en/floater_performance.xml | 217 ++++---------------- .../xui/en/menu_avatar_rendering_settings.xml | 25 +-- .../xui/en/menu_avatar_rendering_settings_add.xml | 4 +- .../xui/en/panel_performance_complexity.xml | 6 +- .../default/xui/en/panel_performance_huds.xml | 17 +- .../default/xui/en/panel_performance_nearby.xml | 18 +- .../xui/en/panel_performance_preferences.xml | 186 +++++++++++------ .../default/xui/en/panel_performance_presets.xml | 223 --------------------- .../xui/en/panel_performance_troubleshooting.xml | 190 ------------------ 14 files changed, 372 insertions(+), 811 deletions(-) delete mode 100644 indra/newview/skins/default/xui/en/panel_performance_presets.xml delete mode 100644 indra/newview/skins/default/xui/en/panel_performance_troubleshooting.xml (limited to 'indra/newview') diff --git a/indra/newview/llfloateravatarrendersettings.cpp b/indra/newview/llfloateravatarrendersettings.cpp index b8f854feb3..7d098e6c88 100644 --- a/indra/newview/llfloateravatarrendersettings.cpp +++ b/indra/newview/llfloateravatarrendersettings.cpp @@ -89,7 +89,6 @@ BOOL LLFloaterAvatarRenderSettings::postBuild() LLFloater::postBuild(); mAvatarSettingsList = getChild("render_settings_list"); mAvatarSettingsList->setRightMouseDownCallback(boost::bind(&LLFloaterAvatarRenderSettings::onAvatarListRightClick, this, _1, _2, _3)); - getChild("people_filter_input")->setCommitCallback(boost::bind(&LLFloaterAvatarRenderSettings::onFilterEdit, this, _2)); return TRUE; } @@ -133,37 +132,13 @@ void LLFloaterAvatarRenderSettings::updateList() { item_params.value = iter->first; LLAvatarNameCache::get(iter->first, &av_name); - if(!isHiddenRow(av_name.getCompleteName())) - { - item_params.columns.add().value(av_name.getCompleteName()).column("name"); - std::string setting = getString(iter->second == 1 ? "av_never_render" : "av_always_render"); - item_params.columns.add().value(setting).column("setting"); - std::string timestamp = createTimestamp(LLRenderMuteList::getInstance()->getVisualMuteDate(iter->first)); - item_params.columns.add().value(timestamp).column("timestamp"); - mAvatarSettingsList->addNameItemRow(item_params); - } + item_params.columns.add().value(av_name.getCompleteName()).column("name"); + std::string setting = getString(iter->second == 1 ? "av_never_render" : "av_always_render"); + item_params.columns.add().value(setting).column("setting"); + mAvatarSettingsList->addNameItemRow(item_params); } } -void LLFloaterAvatarRenderSettings::onFilterEdit(const std::string& search_string) -{ - std::string filter_upper = search_string; - LLStringUtil::toUpper(filter_upper); - if (mNameFilter != filter_upper) - { - mNameFilter = filter_upper; - mNeedsUpdate = true; - } -} - -bool LLFloaterAvatarRenderSettings::isHiddenRow(const std::string& av_name) -{ - if (mNameFilter.empty()) return false; - std::string upper_name = av_name; - LLStringUtil::toUpper(upper_name); - return std::string::npos == upper_name.find(mNameFilter); -} - static LLVOAvatar* find_avatar(const LLUUID& id) { LLViewerObject *obj = gObjectList.findObject(id); @@ -214,6 +189,10 @@ bool LLFloaterAvatarRenderSettings::isActionChecked(const LLSD& userdata, const { return (visual_setting == S32(LLVOAvatar::AV_RENDER_NORMALLY)); } + else if ("non_default" == command_name) + { + return (visual_setting != S32(LLVOAvatar::AV_RENDER_NORMALLY)); + } else if ("never" == command_name) { return (visual_setting == S32(LLVOAvatar::AV_DO_NOT_RENDER)); diff --git a/indra/newview/llfloateravatarrendersettings.h b/indra/newview/llfloateravatarrendersettings.h index 00ee074f17..2e0a844afd 100644 --- a/indra/newview/llfloateravatarrendersettings.h +++ b/indra/newview/llfloateravatarrendersettings.h @@ -48,7 +48,6 @@ public: void onAvatarListRightClick(LLUICtrl* ctrl, S32 x, S32 y); void updateList(); - void onFilterEdit(const std::string& search_string); void onCustomAction (const LLSD& userdata, const LLUUID& av_id); bool isActionChecked(const LLSD& userdata, const LLUUID& av_id); void onClickAdd(const LLSD& userdata); @@ -59,15 +58,12 @@ public: static void setNeedsUpdate(); private: - bool isHiddenRow(const std::string& av_name); void callbackAvatarPicked(const uuid_vec_t& ids, S32 visual_setting); void removePicker(); bool mNeedsUpdate; LLListContextMenu* mContextMenu; LLNameListCtrl* mAvatarSettingsList; - - std::string mNameFilter; }; diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp index 16afeb6e52..a2fb8c130d 100644 --- a/indra/newview/llfloaterperformance.cpp +++ b/indra/newview/llfloaterperformance.cpp @@ -31,6 +31,7 @@ #include "llappearancemgr.h" #include "llavataractions.h" #include "llavatarrendernotifier.h" +#include "llcheckboxctrl.h" #include "llfeaturemanager.h" #include "llfloaterpreference.h" // LLAvatarComplexityControls #include "llfloaterreg.h" @@ -38,52 +39,69 @@ #include "llsliderctrl.h" #include "lltextbox.h" #include "lltrans.h" +#include "llviewerobjectlist.h" #include "llvoavatar.h" #include "llvoavatarself.h" +#include "pipeline.h" const F32 REFRESH_INTERVAL = 1.0f; -const S32 COMPLEXITY_THRESHOLD_HIGH = 100000; -const S32 COMPLEXITY_THRESHOLD_MEDIUM = 30000; const S32 BAR_LEFT_PAD = 2; const S32 BAR_RIGHT_PAD = 5; const S32 BAR_BOTTOM_PAD = 9; +class LLExceptionsContextMenu : public LLListContextMenu +{ +public: + LLExceptionsContextMenu(LLFloaterPerformance* floater_settings) + : mFloaterPerformance(floater_settings) + {} +protected: + LLContextMenu* createMenu() + { + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; + LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; + registrar.add("Settings.SetRendering", boost::bind(&LLFloaterPerformance::onCustomAction, mFloaterPerformance, _2, mUUIDs.front())); + enable_registrar.add("Settings.IsSelected", boost::bind(&LLFloaterPerformance::isActionChecked, mFloaterPerformance, _2, mUUIDs.front())); + LLContextMenu* menu = createFromFile("menu_avatar_rendering_settings.xml"); + + return menu; + } + + LLFloaterPerformance* mFloaterPerformance; +}; + LLFloaterPerformance::LLFloaterPerformance(const LLSD& key) : LLFloater(key), mUpdateTimer(new LLTimer()), mNearbyMaxComplexity(0) { + mContextMenu = new LLExceptionsContextMenu(this); } LLFloaterPerformance::~LLFloaterPerformance() { mComplexityChangedSignal.disconnect(); + delete mContextMenu; delete mUpdateTimer; } BOOL LLFloaterPerformance::postBuild() { mMainPanel = getChild("panel_performance_main"); - mTroubleshootingPanel = getChild("panel_performance_troubleshooting"); mNearbyPanel = getChild("panel_performance_nearby"); mComplexityPanel = getChild("panel_performance_complexity"); mSettingsPanel = getChild("panel_performance_preferences"); mHUDsPanel = getChild("panel_performance_huds"); - mPresetsPanel = getChild("panel_performance_presets"); - getChild("troubleshooting_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mTroubleshootingPanel)); getChild("nearby_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mNearbyPanel)); getChild("complexity_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mComplexityPanel)); getChild("settings_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mSettingsPanel)); getChild("huds_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mHUDsPanel)); - getChild("presets_subpanel")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mPresetsPanel)); - initBackBtn(mTroubleshootingPanel); initBackBtn(mNearbyPanel); initBackBtn(mComplexityPanel); initBackBtn(mSettingsPanel); initBackBtn(mHUDsPanel); - initBackBtn(mPresetsPanel); mHUDList = mHUDsPanel->getChild("hud_list"); mHUDList->setNameListType(LLNameListCtrl::SPECIAL); @@ -96,12 +114,12 @@ BOOL LLFloaterPerformance::postBuild() mObjectList->setIconClickedCallback(boost::bind(&LLFloaterPerformance::detachItem, this, _1)); mSettingsPanel->getChild("advanced_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickAdvanced, this)); + mSettingsPanel->getChild("hide_avatars")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickHideAvatars, this)); + mSettingsPanel->getChild("hide_avatars")->set(!LLPipeline::hasRenderTypeControl(LLPipeline::RENDER_TYPE_AVATAR)); mNearbyPanel->getChild("exceptions_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickExceptions, this)); mNearbyList = mNearbyPanel->getChild("nearby_list"); - - mPresetsPanel->getChild("avatars_nearby_link")->setURLClickedCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mNearbyPanel)); - mPresetsPanel->getChild("settings_link")->setURLClickedCallback(boost::bind(&LLFloaterPerformance::showSelectedPanel, this, mSettingsPanel)); + mNearbyList->setRightMouseDownCallback(boost::bind(&LLFloaterPerformance::onAvatarListRightClick, this, _1, _2, _3)); updateComplexityText(); mComplexityChangedSignal = gSavedSettings.getControl("IndirectMaxComplexity")->getCommitSignal()->connect(boost::bind(&LLFloaterPerformance::updateComplexityText, this)); @@ -134,28 +152,27 @@ void LLFloaterPerformance::showSelectedPanel(LLPanel* selected_panel) void LLFloaterPerformance::draw() { + const S32 NUM_PERIODS = 50; + if (mUpdateTimer->hasExpired()) { - getChild("fps_value")->setValue((S32)llround(LLTrace::get_frame_recording().getPeriodMeanPerSec(LLStatViewer::FPS))); - if (mMainPanel->getVisible()) - { - mMainPanel->getChild("huds_value")->setValue(LLHUDRenderNotifier::getInstance()->getHUDsCount()); - mMainPanel->getChild("complexity_value")->setValue((S32)gAgentAvatarp->getVisualComplexity()); - updateNearbyComplexityDesc(); - } - else if (mHUDsPanel->getVisible()) + getChild("fps_value")->setValue((S32)llround(LLTrace::get_frame_recording().getPeriodMeanPerSec(LLStatViewer::FPS, NUM_PERIODS))); + if (mHUDsPanel->getVisible()) { populateHUDList(); } else if (mNearbyPanel->getVisible()) { populateNearbyList(); - updateNearbyComplexityDesc(); } else if (mComplexityPanel->getVisible()) { populateObjectList(); } + else if (mSettingsPanel->getVisible()) + { + mSettingsPanel->getChild("hide_avatars")->set(!LLPipeline::hasRenderTypeControl(LLPipeline::RENDER_TYPE_AVATAR)); + } mUpdateTimer->setTimerExpirySec(REFRESH_INTERVAL); } @@ -170,12 +187,10 @@ void LLFloaterPerformance::showMainPanel() void LLFloaterPerformance::hidePanels() { - mTroubleshootingPanel->setVisible(FALSE); mNearbyPanel->setVisible(FALSE); mComplexityPanel->setVisible(FALSE); mHUDsPanel->setVisible(FALSE); mSettingsPanel->setVisible(FALSE); - mPresetsPanel->setVisible(FALSE); } void LLFloaterPerformance::initBackBtn(LLPanel* panel) @@ -236,8 +251,6 @@ void LLFloaterPerformance::populateHUDList() mHUDList->sortByColumnIndex(1, FALSE); mHUDList->setScrollPos(prev_pos); mHUDList->selectItemBySpecialId(prev_selected_id); - - mHUDsPanel->getChild("huds_value")->setValue(std::to_string(complexity_list.size())); } void LLFloaterPerformance::populateObjectList() @@ -384,32 +397,6 @@ void LLFloaterPerformance::getNearbyAvatars(std::vector &valid_nea } } -void LLFloaterPerformance::updateNearbyComplexityDesc() -{ - std::string desc = getString("low"); - - static LLCachedControl max_render_cost(gSavedSettings, "RenderAvatarMaxComplexity", 0); - if (mMainPanel->getVisible()) - { - std::vector valid_nearby_avs; - getNearbyAvatars(valid_nearby_avs); - } - if (mNearbyMaxComplexity > COMPLEXITY_THRESHOLD_HIGH) - { - desc = getString("very_high"); - } - else if (mNearbyMaxComplexity > COMPLEXITY_THRESHOLD_MEDIUM) - { - desc = getString("medium"); - } - - if (mMainPanel->getVisible()) - { - mMainPanel->getChild("avatars_nearby_value")->setValue(desc); - } - mNearbyPanel->getChild("av_nearby_value")->setValue(desc); -} - void LLFloaterPerformance::detachItem(const LLUUID& item_id) { LLAppearanceMgr::instance().removeItemFromAvatar(item_id); @@ -425,6 +412,11 @@ void LLFloaterPerformance::onClickAdvanced() LLFloaterReg::showInstance("prefs_graphics_advanced"); } +void LLFloaterPerformance::onClickHideAvatars() +{ + LLPipeline::toggleRenderTypeControl(LLPipeline::RENDER_TYPE_AVATAR); +} + void LLFloaterPerformance::onClickExceptions() { LLFloaterReg::showInstance("avatar_render_settings"); @@ -443,4 +435,90 @@ void LLFloaterPerformance::updateComplexityText() mNearbyPanel->getChild("IndirectMaxComplexityText", true)); } +static LLVOAvatar* find_avatar(const LLUUID& id) +{ + LLViewerObject *obj = gObjectList.findObject(id); + while (obj && obj->isAttachment()) + { + obj = (LLViewerObject *)obj->getParent(); + } + + if (obj && obj->isAvatar()) + { + return (LLVOAvatar*)obj; + } + else + { + return NULL; + } +} + +void LLFloaterPerformance::onCustomAction(const LLSD& userdata, const LLUUID& av_id) +{ + const std::string command_name = userdata.asString(); + + S32 new_setting = 0; + if ("default" == command_name) + { + new_setting = S32(LLVOAvatar::AV_RENDER_NORMALLY); + } + else if ("never" == command_name) + { + new_setting = S32(LLVOAvatar::AV_DO_NOT_RENDER); + } + else if ("always" == command_name) + { + new_setting = S32(LLVOAvatar::AV_ALWAYS_RENDER); + } + + LLVOAvatar *avatarp = find_avatar(av_id); + if (avatarp) + { + avatarp->setVisualMuteSettings(LLVOAvatar::VisualMuteSettings(new_setting)); + } + else + { + LLRenderMuteList::getInstance()->saveVisualMuteSetting(av_id, new_setting); + } +} + + +bool LLFloaterPerformance::isActionChecked(const LLSD& userdata, const LLUUID& av_id) +{ + const std::string command_name = userdata.asString(); + + S32 visual_setting = LLRenderMuteList::getInstance()->getSavedVisualMuteSetting(av_id); + if ("default" == command_name) + { + return (visual_setting == S32(LLVOAvatar::AV_RENDER_NORMALLY)); + } + else if ("non_default" == command_name) + { + return (visual_setting != S32(LLVOAvatar::AV_RENDER_NORMALLY)); + } + else if ("never" == command_name) + { + return (visual_setting == S32(LLVOAvatar::AV_DO_NOT_RENDER)); + } + else if ("always" == command_name) + { + return (visual_setting == S32(LLVOAvatar::AV_ALWAYS_RENDER)); + } + return false; +} + +void LLFloaterPerformance::onAvatarListRightClick(LLUICtrl* ctrl, S32 x, S32 y) +{ + LLNameListCtrl* list = dynamic_cast(ctrl); + if (!list) return; + list->selectItemAt(x, y, MASK_NONE); + uuid_vec_t selected_uuids; + + if(list->getCurrentID().notNull()) + { + selected_uuids.push_back(list->getCurrentID()); + mContextMenu->show(ctrl, selected_uuids, x, y); + } +} + // EOF diff --git a/indra/newview/llfloaterperformance.h b/indra/newview/llfloaterperformance.h index ea15873b95..58f9447d4c 100644 --- a/indra/newview/llfloaterperformance.h +++ b/indra/newview/llfloaterperformance.h @@ -27,6 +27,7 @@ #define LL_LLFLOATERPERFORMANCE_H #include "llfloater.h" +#include "lllistcontextmenu.h" class LLCharacter; class LLNameListCtrl; @@ -46,6 +47,11 @@ public: void detachItem(const LLUUID& item_id); + void onAvatarListRightClick(LLUICtrl* ctrl, S32 x, S32 y); + + void onCustomAction (const LLSD& userdata, const LLUUID& av_id); + bool isActionChecked(const LLSD& userdata, const LLUUID& av_id); + private: void initBackBtn(LLPanel* panel); void populateHUDList(); @@ -53,25 +59,25 @@ private: void populateNearbyList(); void onClickAdvanced(); + void onClickHideAvatars(); void onClickExceptions(); void updateMaxComplexity(); void updateComplexityText(); void getNearbyAvatars(std::vector &valid_nearby_avs); - void updateNearbyComplexityDesc(); LLPanel* mMainPanel; - LLPanel* mTroubleshootingPanel; LLPanel* mNearbyPanel; LLPanel* mComplexityPanel; LLPanel* mHUDsPanel; LLPanel* mSettingsPanel; - LLPanel* mPresetsPanel; LLNameListCtrl* mHUDList; LLNameListCtrl* mObjectList; LLNameListCtrl* mNearbyList; + LLListContextMenu* mContextMenu; + LLTimer* mUpdateTimer; S32 mNearbyMaxComplexity; diff --git a/indra/newview/skins/default/xui/en/floater_avatar_render_settings.xml b/indra/newview/skins/default/xui/en/floater_avatar_render_settings.xml index e088d4d2a1..d222dca98b 100644 --- a/indra/newview/skins/default/xui/en/floater_avatar_render_settings.xml +++ b/indra/newview/skins/default/xui/en/floater_avatar_render_settings.xml @@ -10,7 +10,7 @@ save_rect="true" single_instance="true" reuse_instance="true" - title="AVATAR RENDER SETTINGS" + title="AVATAR DISPLAY EXCEPTIONS" width="300"> - - + top="0"> + relative_width="0.65" /> - + relative_width="0.35" /> + + + diff --git a/indra/newview/skins/default/xui/en/floater_performance.xml b/indra/newview/skins/default/xui/en/floater_performance.xml index 039421d589..210b2f8792 100644 --- a/indra/newview/skins/default/xui/en/floater_performance.xml +++ b/indra/newview/skins/default/xui/en/floater_performance.xml @@ -1,20 +1,11 @@ - - - - FPS -- 60 or more for the best experience - - - - - + frames per second + - Quick settings for common situations + left="395" + top="7" + name="fps_desc1_lbl" + width="150"> + Allow 5-10 seconds for - Choose settings for parties, exploration, photography, and more. + top_pad="-3" + name="fps_desc2_lbl" + width="150"> + changes to take full effect. - + + + left="10" + top="5"> - Individual settings + Graphics settings - More control over quality, visibility distance, and enhancements. + Choose settings for distance, water, lighting and more. - Nearby avatar complexity is - - - very high + Avatars nearby - Choose which avatars are not displayed in detail, to increase FPS. + Manage which nearby avatars are fully displayed. - Your avatar complexity is - - - 275 + Your avatar complexity Reduce the complexity of your avatar if you aren't satisfied with current FPS. @@ -278,7 +222,7 @@ mouse_opaque="true" name="icon_arrow4" follows="right|top" - top="24" + top="29" right="-20"/> - Your current HUDs: - - - 7 + Your active HUDs Removing HUDs you are not using can improve speed. @@ -335,72 +268,10 @@ mouse_opaque="true" name="icon_arrow4" follows="right|top" - top="24" - right="-20"/> - - - - General troubleshooting - - - Choose among common problems and see what you can do. - - - - - - - - - + - - + + + + + + + diff --git a/indra/newview/skins/default/xui/en/menu_avatar_rendering_settings_add.xml b/indra/newview/skins/default/xui/en/menu_avatar_rendering_settings_add.xml index c64b24ed70..6e09eb5981 100644 --- a/indra/newview/skins/default/xui/en/menu_avatar_rendering_settings_add.xml +++ b/indra/newview/skins/default/xui/en/menu_avatar_rendering_settings_add.xml @@ -4,13 +4,13 @@ left="0" bottom="0" visible="false" mouse_opaque="false"> diff --git a/indra/newview/skins/default/xui/en/panel_performance_complexity.xml b/indra/newview/skins/default/xui/en/panel_performance_complexity.xml index 8d4512c4f7..b2f65f9488 100644 --- a/indra/newview/skins/default/xui/en/panel_performance_complexity.xml +++ b/indra/newview/skins/default/xui/en/panel_performance_complexity.xml @@ -42,7 +42,7 @@ top_pad="10" name="attachments_title" width="195"> - My avatar complexity + Your avatar complexity - Complex attachments require more time and memory to display. + If your avatar is very complex, some other people may not see you in full detail and - While you are in this location, removing the most complex ones may increase speed. + your own graphics speed may be reduced. - Your current HUDs: - - - 7 + Your active HUDs - Detaching HUDs you aren't using us always a good idea, but especially in a complex location. + Detaching HUDs you aren't using saves memory and can make Second Life run faster. - Note: Using a HUD's minimize button does not save memory. + Note: Using a HUD's minimize button does not detach it. - Nearby avatar complexity is - - - very high + Avatars nearby - Some avatars nearby are slow to display. Choosing a complexity limit may help graphics speed. + Avatars more complex than your chosen limit will be shown in silhouette. - Individual settings + Graphics settings - Graphics quality -shortcuts + Shortcuts - To zoom out and see long distances, increase the distance. - - - If you are indoors, decrease the distance to improve speed. + To see more land when you zoom out, increase the distance. - Enhancements + Environment - + + + Shadows: + + + + + + + + + Water + + + Reducing or turning off water effects can greatly improve frame rate. + - - Shadows: - - + - - - - + top_pad="20" + left="20" + name="photo_lbl" + width="100"> + Photography + - [secondlife:/// What do these settings mean?] + Maximum detail is good for photos, but can slow frame rate. + + + + (Enter value between 0.0 and 4.0) + + diff --git a/indra/newview/skins/default/xui/en/panel_performance_presets.xml b/indra/newview/skins/default/xui/en/panel_performance_presets.xml deleted file mode 100644 index 51516020a2..0000000000 --- a/indra/newview/skins/default/xui/en/panel_performance_presets.xml +++ /dev/null @@ -1,223 +0,0 @@ - - - - - Back - - - Quick settings - - - Note: Quick settings will reset all manual changes you have made. - - - - - Tuned for many avatars in a room. - - - Nearby avatar complexity is high. - - - [secondlife:/// Choose avatars to show and hide] - - - - - Fewer avatars, higher visibility distance. - - - - - Good for zooming your camera far out and viewing large land areas. - - - - - Maximum quality, minimum visibility distance. - - - - For more control, try - - - [secondlife:/// Idividual Settings] - - - diff --git a/indra/newview/skins/default/xui/en/panel_performance_troubleshooting.xml b/indra/newview/skins/default/xui/en/panel_performance_troubleshooting.xml deleted file mode 100644 index 0a14eeb1c0..0000000000 --- a/indra/newview/skins/default/xui/en/panel_performance_troubleshooting.xml +++ /dev/null @@ -1,190 +0,0 @@ - - - - - Back - - - Fixes for common problems - - - Some problems result from the complexity of the location where you are. All you can do is leave. - - - Rubberbanding - - - When you walk, your avatar may be pulled backward again and again. - - - Fix: XXXXXXX - - - Texture thrashing - - - On objects near you, you may see their surfaces get blurry, then sharp, then blurry again. - - - Fix: XXXXXXX - - - Avatars are not moving smoothly - - - Lorem ipsum dolor sit amet. - - - Fix: XXXXXXX - - - Will a better graphics card or new computer help? - - - Lorem ipsum dolor sit amet. - - - Fix: XXXXXXX - - -- cgit v1.2.3 From 84ae60a3b34d92930a74e9207bf39e6335e307a0 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 16 Jul 2021 16:32:12 +0300 Subject: SL-15581 Add the function to get median FPS --- indra/newview/llfloaterperformance.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp index a2fb8c130d..879a8f8718 100644 --- a/indra/newview/llfloaterperformance.cpp +++ b/indra/newview/llfloaterperformance.cpp @@ -156,7 +156,7 @@ void LLFloaterPerformance::draw() if (mUpdateTimer->hasExpired()) { - getChild("fps_value")->setValue((S32)llround(LLTrace::get_frame_recording().getPeriodMeanPerSec(LLStatViewer::FPS, NUM_PERIODS))); + getChild("fps_value")->setValue((S32)llround(LLTrace::get_frame_recording().getPeriodMedianPerSec(LLStatViewer::FPS, NUM_PERIODS))); if (mHUDsPanel->getVisible()) { populateHUDList(); -- cgit v1.2.3 From 928191f525cf8a02816718eefd9a65097d8ecb8b Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 19 Jul 2021 20:07:03 +0300 Subject: SL-15297 performance floater UI update #2 --- indra/newview/llfloaterperformance.cpp | 89 ++++++++++++++-------- indra/newview/llfloaterpreference.cpp | 9 ++- indra/newview/llfloaterpreference.h | 4 +- indra/newview/llnamelistctrl.cpp | 2 +- indra/newview/llviewermenu.cpp | 2 + .../skins/default/xui/en/floater_performance.xml | 42 +++++----- .../skins/default/xui/en/menu_attachment_other.xml | 28 +++---- .../skins/default/xui/en/menu_avatar_other.xml | 64 ++++++++-------- indra/newview/skins/default/xui/en/menu_viewer.xml | 15 ++-- .../xui/en/panel_performance_complexity.xml | 20 ++++- .../default/xui/en/panel_performance_huds.xml | 4 +- .../default/xui/en/panel_performance_nearby.xml | 75 ++++++++++++++++-- .../xui/en/panel_performance_preferences.xml | 47 ++++-------- indra/newview/skins/default/xui/en/strings.xml | 2 +- 14 files changed, 247 insertions(+), 156 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp index 879a8f8718..d7c0527b5c 100644 --- a/indra/newview/llfloaterperformance.cpp +++ b/indra/newview/llfloaterperformance.cpp @@ -114,10 +114,10 @@ BOOL LLFloaterPerformance::postBuild() mObjectList->setIconClickedCallback(boost::bind(&LLFloaterPerformance::detachItem, this, _1)); mSettingsPanel->getChild("advanced_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickAdvanced, this)); - mSettingsPanel->getChild("hide_avatars")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickHideAvatars, this)); - mSettingsPanel->getChild("hide_avatars")->set(!LLPipeline::hasRenderTypeControl(LLPipeline::RENDER_TYPE_AVATAR)); mNearbyPanel->getChild("exceptions_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickExceptions, this)); + mNearbyPanel->getChild("hide_avatars")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickHideAvatars, this)); + mNearbyPanel->getChild("hide_avatars")->set(!LLPipeline::hasRenderTypeControl(LLPipeline::RENDER_TYPE_AVATAR)); mNearbyList = mNearbyPanel->getChild("nearby_list"); mNearbyList->setRightMouseDownCallback(boost::bind(&LLFloaterPerformance::onAvatarListRightClick, this, _1, _2, _3)); @@ -164,15 +164,12 @@ void LLFloaterPerformance::draw() else if (mNearbyPanel->getVisible()) { populateNearbyList(); + mNearbyPanel->getChild("hide_avatars")->set(!LLPipeline::hasRenderTypeControl(LLPipeline::RENDER_TYPE_AVATAR)); } else if (mComplexityPanel->getVisible()) { populateObjectList(); } - else if (mSettingsPanel->getVisible()) - { - mSettingsPanel->getChild("hide_avatars")->set(!LLPipeline::hasRenderTypeControl(LLPipeline::RENDER_TYPE_AVATAR)); - } mUpdateTimer->setTimerExpirySec(REFRESH_INTERVAL); } @@ -223,7 +220,7 @@ void LLFloaterPerformance::populateHUDList() for (iter = complexity_list.begin(); iter != end; ++iter) { LLHUDComplexity hud_object_complexity = *iter; - + S32 obj_cost_short = hud_object_complexity.objectsCost / 1000; LLSD item; item["special_id"] = hud_object_complexity.objectId; item["target"] = LLNameListCtrl::SPECIAL; @@ -231,14 +228,14 @@ void LLFloaterPerformance::populateHUDList() row[0]["column"] = "complex_visual"; row[0]["type"] = "bar"; LLSD& value = row[0]["value"]; - value["ratio"] = (F32)hud_object_complexity.objectsCost / max_complexity; + value["ratio"] = (F32)obj_cost_short / max_complexity * 1000; value["bottom"] = BAR_BOTTOM_PAD; value["left_pad"] = BAR_LEFT_PAD; value["right_pad"] = BAR_RIGHT_PAD; row[1]["column"] = "complex_value"; row[1]["type"] = "text"; - row[1]["value"] = std::to_string(hud_object_complexity.objectsCost); + row[1]["value"] = std::to_string(obj_cost_short); row[1]["font"]["name"] = "SANSSERIF"; row[2]["column"] = "name"; @@ -246,7 +243,15 @@ void LLFloaterPerformance::populateHUDList() row[2]["value"] = hud_object_complexity.objectName; row[2]["font"]["name"] = "SANSSERIF"; - mHUDList->addElement(item); + LLScrollListItem* obj = mHUDList->addElement(item); + if (obj) + { + LLScrollListText* value_text = dynamic_cast(obj->getColumn(1)); + if (value_text) + { + value_text->setAlignment(LLFontGL::HCENTER); + } + } } mHUDList->sortByColumnIndex(1, FALSE); mHUDList->setScrollPos(prev_pos); @@ -274,7 +279,7 @@ void LLFloaterPerformance::populateObjectList() for (iter = complexity_list.begin(); iter != end; ++iter) { LLObjectComplexity object_complexity = *iter; - + S32 obj_cost_short = object_complexity.objectCost / 1000; LLSD item; item["special_id"] = object_complexity.objectId; item["target"] = LLNameListCtrl::SPECIAL; @@ -282,14 +287,14 @@ void LLFloaterPerformance::populateObjectList() row[0]["column"] = "complex_visual"; row[0]["type"] = "bar"; LLSD& value = row[0]["value"]; - value["ratio"] = (F32)object_complexity.objectCost / max_complexity; + value["ratio"] = (F32)obj_cost_short / max_complexity * 1000; value["bottom"] = BAR_BOTTOM_PAD; value["left_pad"] = BAR_LEFT_PAD; value["right_pad"] = BAR_RIGHT_PAD; row[1]["column"] = "complex_value"; row[1]["type"] = "text"; - row[1]["value"] = std::to_string(object_complexity.objectCost); + row[1]["value"] = std::to_string(obj_cost_short); row[1]["font"]["name"] = "SANSSERIF"; row[2]["column"] = "name"; @@ -297,7 +302,15 @@ void LLFloaterPerformance::populateObjectList() row[2]["value"] = object_complexity.objectName; row[2]["font"]["name"] = "SANSSERIF"; - mObjectList->addElement(item); + LLScrollListItem* obj = mObjectList->addElement(item); + if (obj) + { + LLScrollListText* value_text = dynamic_cast(obj->getColumn(1)); + if (value_text) + { + value_text->setAlignment(LLFontGL::HCENTER); + } + } } mObjectList->sortByColumnIndex(1, FALSE); mObjectList->setScrollPos(prev_pos); @@ -321,20 +334,21 @@ void LLFloaterPerformance::populateNearbyList() LLVOAvatar* avatar = dynamic_cast(*char_iter); if (avatar && (LLVOAvatar::AOA_INVISIBLE != avatar->getOverallAppearance())) { + S32 complexity_short = avatar->getVisualComplexity() / 1000; LLSD item; item["id"] = avatar->getID(); LLSD& row = item["columns"]; row[0]["column"] = "complex_visual"; row[0]["type"] = "bar"; LLSD& value = row[0]["value"]; - value["ratio"] = (F32)avatar->getVisualComplexity() / mNearbyMaxComplexity; + value["ratio"] = (F32)complexity_short / mNearbyMaxComplexity * 1000; value["bottom"] = BAR_BOTTOM_PAD; value["left_pad"] = BAR_LEFT_PAD; value["right_pad"] = BAR_RIGHT_PAD; row[1]["column"] = "complex_value"; row[1]["type"] = "text"; - row[1]["value"] = std::to_string( avatar->getVisualComplexity()); + row[1]["value"] = std::to_string(complexity_short); row[1]["font"]["name"] = "SANSSERIF"; row[2]["column"] = "name"; @@ -345,24 +359,36 @@ void LLFloaterPerformance::populateNearbyList() LLScrollListItem* av_item = mNearbyList->addElement(item); if(av_item) { + LLScrollListText* value_text = dynamic_cast(av_item->getColumn(1)); + if (value_text) + { + value_text->setAlignment(LLFontGL::HCENTER); + } LLScrollListText* name_text = dynamic_cast(av_item->getColumn(2)); if (name_text) { - std::string color = "white"; - if (LLVOAvatar::AOA_JELLYDOLL == avatar->getOverallAppearance()) + if (avatar->isSelf()) { - color = "LabelDisabledColor"; - LLScrollListBar* bar = dynamic_cast(av_item->getColumn(0)); - if (bar) - { - bar->setColor(LLUIColorTable::instance().getColor(color)); - } + name_text->setColor(LLUIColorTable::instance().getColor("DrYellow")); } - else if (LLVOAvatar::AOA_NORMAL == avatar->getOverallAppearance()) + else { - color = LLAvatarActions::isFriend(avatar->getID()) ? "ConversationFriendColor" : "white"; + std::string color = "white"; + if (LLVOAvatar::AOA_JELLYDOLL == avatar->getOverallAppearance()) + { + color = "LabelDisabledColor"; + LLScrollListBar* bar = dynamic_cast(av_item->getColumn(0)); + if (bar) + { + bar->setColor(LLUIColorTable::instance().getColor(color)); + } + } + else if (LLVOAvatar::AOA_NORMAL == avatar->getOverallAppearance()) + { + color = LLAvatarActions::isFriend(avatar->getID()) ? "ConversationFriendColor" : "white"; + } + name_text->setColor(LLUIColorTable::instance().getColor(color)); } - name_text->setColor(LLUIColorTable::instance().getColor(color)); } } } @@ -376,12 +402,13 @@ void LLFloaterPerformance::populateNearbyList() void LLFloaterPerformance::getNearbyAvatars(std::vector &valid_nearby_avs) { static LLCachedControl render_far_clip(gSavedSettings, "RenderFarClip", 64); + mNearbyMaxComplexity = 0; F32 radius = render_far_clip * render_far_clip; std::vector::iterator char_iter = LLCharacter::sInstances.begin(); while (char_iter != LLCharacter::sInstances.end()) { LLVOAvatar* avatar = dynamic_cast(*char_iter); - if (avatar && !avatar->isDead() && !avatar->isControlAvatar() && !avatar->isSelf()) + if (avatar && !avatar->isDead() && !avatar->isControlAvatar()) { if ((dist_vec_squared(avatar->getPositionGlobal(), gAgent.getPositionGlobal()) > radius) && (dist_vec_squared(avatar->getPositionGlobal(), gAgentCamera.getCameraPositionGlobal()) > radius)) @@ -426,13 +453,15 @@ void LLFloaterPerformance::updateMaxComplexity() { LLAvatarComplexityControls::updateMax( mNearbyPanel->getChild("IndirectMaxComplexity"), - mNearbyPanel->getChild("IndirectMaxComplexityText")); + mNearbyPanel->getChild("IndirectMaxComplexityText"), + true); } void LLFloaterPerformance::updateComplexityText() { LLAvatarComplexityControls::setText(gSavedSettings.getU32("RenderAvatarMaxComplexity"), - mNearbyPanel->getChild("IndirectMaxComplexityText", true)); + mNearbyPanel->getChild("IndirectMaxComplexityText", true), + true); } static LLVOAvatar* find_avatar(const LLUUID& id) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 1ab6621c4c..a0a0b3c874 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1455,7 +1455,7 @@ void LLFloaterPreference::refreshUI() refresh(); } -void LLAvatarComplexityControls::updateMax(LLSliderCtrl* slider, LLTextBox* value_label) +void LLAvatarComplexityControls::updateMax(LLSliderCtrl* slider, LLTextBox* value_label, bool short_val) { // Called when the IndirectMaxComplexity control changes // Responsible for fixing the slider label (IndirectMaxComplexityText) and setting RenderAvatarMaxComplexity @@ -1477,10 +1477,10 @@ void LLAvatarComplexityControls::updateMax(LLSliderCtrl* slider, LLTextBox* valu } gSavedSettings.setU32("RenderAvatarMaxComplexity", (U32)max_arc); - setText(max_arc, value_label); + setText(max_arc, value_label, short_val); } -void LLAvatarComplexityControls::setText(U32 value, LLTextBox* text_box) +void LLAvatarComplexityControls::setText(U32 value, LLTextBox* text_box, bool short_val) { if (0 == value) { @@ -1488,7 +1488,8 @@ void LLAvatarComplexityControls::setText(U32 value, LLTextBox* text_box) } else { - text_box->setText(llformat("%d", value)); + std::string text_value = short_val ? llformat("%d", value / 1000) : llformat("%d", value); + text_box->setText(text_value); } } diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index f86104ed99..23d3f73d70 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -351,8 +351,8 @@ private: class LLAvatarComplexityControls { public: - static void updateMax(LLSliderCtrl* slider, LLTextBox* value_label); - static void setText(U32 value, LLTextBox* text_box); + static void updateMax(LLSliderCtrl* slider, LLTextBox* value_label, bool short_val = false); + static void setText(U32 value, LLTextBox* text_box, bool short_val = false); static void setIndirectControls(); static void setIndirectMaxNonImpostors(); static void setIndirectMaxArc(); diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index 92805e03f0..c24c74393d 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -363,7 +363,7 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow( else if (LLAvatarNameCache::get(id, &av_name)) { if (mShortNames) - fullname = av_name.getDisplayName(); + fullname = av_name.getDisplayName(true); else fullname = av_name.getCompleteName(); } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index ad81cb07c1..fa2ada32b3 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3149,6 +3149,8 @@ class LLAvatarCheckImpostorMode : public view_listener_t return (avatar->getVisualMuteSettings() == LLVOAvatar::AV_DO_NOT_RENDER); case 2: return (avatar->getVisualMuteSettings() == LLVOAvatar::AV_ALWAYS_RENDER); + case 4: + return (avatar->getVisualMuteSettings() != LLVOAvatar::AV_RENDER_NORMALLY); default: return false; } diff --git a/indra/newview/skins/default/xui/en/floater_performance.xml b/indra/newview/skins/default/xui/en/floater_performance.xml index 210b2f8792..c47b8100c2 100644 --- a/indra/newview/skins/default/xui/en/floater_performance.xml +++ b/indra/newview/skins/default/xui/en/floater_performance.xml @@ -1,6 +1,6 @@ @@ -93,7 +93,7 @@ border="true" bevel_style="none" follows="left|top" - height="70" + height="50" width="560" name="settings_subpanel" layout="topleft" @@ -107,7 +107,7 @@ layout="topleft" left="10" name="settings_lbl" - top="12" + top="7" width="180"> Graphics settings @@ -119,7 +119,7 @@ layout="topleft" left="10" name="settings_desc" - top_pad="10" + top_pad="0" width="395"> Choose settings for distance, water, lighting and more. @@ -130,7 +130,7 @@ mouse_opaque="true" name="icon_arrow3" follows="right|top" - top="29" + top="19" right="-20"/> + top_pad="10"> Avatars nearby @@ -165,7 +165,7 @@ layout="topleft" left="10" name="avatars_nearby_desc" - top_pad="10" + top_pad="0" width="395"> Manage which nearby avatars are fully displayed. @@ -176,7 +176,7 @@ mouse_opaque="true" name="icon_arrow2" follows="right|top" - top="29" + top="19" right="-20"/> + top_pad="10"> Your avatar complexity @@ -211,7 +211,7 @@ layout="topleft" left="10" name="complexity_info" - top_pad="10" + top_pad="0" width="455"> Reduce the complexity of your avatar if you aren't satisfied with current FPS. @@ -222,7 +222,7 @@ mouse_opaque="true" name="icon_arrow4" follows="right|top" - top="29" + top="19" right="-20"/> + top_pad="10"> Your active HUDs @@ -257,7 +257,7 @@ layout="topleft" left="10" name="huds_desc" - top_pad="10" + top_pad="0" width="395"> Removing HUDs you are not using can improve speed. @@ -268,7 +268,7 @@ mouse_opaque="true" name="icon_arrow4" follows="right|top" - top="29" + top="19" right="-20"/> diff --git a/indra/newview/skins/default/xui/en/menu_attachment_other.xml b/indra/newview/skins/default/xui/en/menu_attachment_other.xml index 7ad692038e..22006c287f 100644 --- a/indra/newview/skins/default/xui/en/menu_attachment_other.xml +++ b/indra/newview/skins/default/xui/en/menu_attachment_other.xml @@ -131,22 +131,12 @@ - - - - + name="Render Avatar"> + label="Always full detail"> @@ -156,7 +146,7 @@ + label="Never full detail"> @@ -164,6 +154,16 @@ function="Avatar.SetImpostorMode" parameter="1" /> + + + + - - - - - - - - - - - - + name="Render Avatar"> + + + + + + + + + + + + - - - - + + +