summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-06-10 17:24:19 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-06-10 17:24:19 -0400
commit730d94779c0e798ec91b269b530a08f0eebaa13d (patch)
treed4821d194caef6e71f3e31b578fde635a38bdb3b /indra/newview/llviewermenu.cpp
parentd317454c82e016a02c8a708a0118f3ff29aa8e82 (diff)
parent9f97ff7286aceef5be4e7589ca4af911edf30f12 (diff)
Merge release/materials_featurette to main on promotion of secondlife/viewer #648: Release/materials featurette
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r--indra/newview/llviewermenu.cpp70
1 files changed, 68 insertions, 2 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index f7f8db6841..4dcfb18b30 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -141,6 +141,7 @@
#include <boost/algorithm/string.hpp>
#include "llcleanup.h"
#include "llviewershadermgr.h"
+#include "gltfscenemanager.h"
using namespace LLAvatarAppearanceDefines;
@@ -528,10 +529,8 @@ void init_menus()
LLGridManager::getInstance()->isInProductionGrid());
// *TODO:Also fix cost in llfolderview.cpp for Inventory menus
- const std::string texture_upload_cost_str = std::to_string(LLAgentBenefitsMgr::current().getTextureUploadCost());
const std::string sound_upload_cost_str = std::to_string(LLAgentBenefitsMgr::current().getSoundUploadCost());
const std::string animation_upload_cost_str = std::to_string(LLAgentBenefitsMgr::current().getAnimationUploadCost());
- gMenuHolder->childSetLabelArg("Upload Image", "[COST]", texture_upload_cost_str);
gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", sound_upload_cost_str);
gMenuHolder->childSetLabelArg("Upload Animation", "[COST]", animation_upload_cost_str);
@@ -742,10 +741,30 @@ U32 render_type_from_string(std::string render_type)
{
return LLPipeline::RENDER_TYPE_SIMPLE;
}
+ if ("materials" == render_type)
+ {
+ return LLPipeline::RENDER_TYPE_MATERIALS;
+ }
else if ("alpha" == render_type)
{
return LLPipeline::RENDER_TYPE_ALPHA;
}
+ else if ("alpha_mask" == render_type)
+ {
+ return LLPipeline::RENDER_TYPE_ALPHA_MASK;
+ }
+ else if ("fullbright_alpha_mask" == render_type)
+ {
+ return LLPipeline::RENDER_TYPE_FULLBRIGHT_ALPHA_MASK;
+ }
+ else if ("fullbright" == render_type)
+ {
+ return LLPipeline::RENDER_TYPE_FULLBRIGHT;
+ }
+ else if ("glow" == render_type)
+ {
+ return LLPipeline::RENDER_TYPE_GLOW;
+ }
else if ("tree" == render_type)
{
return LLPipeline::RENDER_TYPE_TREE;
@@ -998,6 +1017,10 @@ U64 info_display_from_string(std::string info_display)
{
return LLPipeline::RENDER_DEBUG_OCTREE;
}
+ else if ("nodes" == info_display)
+ {
+ return LLPipeline::RENDER_DEBUG_NODES;
+ }
else if ("shadow frusta" == info_display)
{
return LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA;
@@ -2174,6 +2197,20 @@ class LLAdvancedPurgeShaderCache : public view_listener_t
}
};
+/////////////////////
+// REBUILD TERRAIN //
+/////////////////////
+
+
+class LLAdvancedRebuildTerrain : public view_listener_t
+{
+ bool handleEvent(const LLSD& userdata)
+ {
+ gPipeline.rebuildTerrain();
+ return true;
+ }
+};
+
////////////////////
// EVENT Recorder //
///////////////////
@@ -7962,6 +7999,30 @@ class LLAdvancedClickRenderBenchmark: public view_listener_t
}
};
+void hdri_preview();
+
+class LLAdvancedClickHDRIPreview: public view_listener_t
+{
+ bool handleEvent(const LLSD& userdata)
+ {
+ // open personal lighting floater when previewing an HDRI (keeps HDRI from implicitly unloading when opening build tools)
+ LLFloaterReg::showInstance("env_adjust_snapshot");
+ hdri_preview();
+ return true;
+ }
+};
+
+
+class LLAdvancedClickGLTFScenePreview : public view_listener_t
+{
+ bool handleEvent(const LLSD& userdata)
+ {
+ // open personal lighting floater when previewing an HDRI (keeps HDRI from implicitly unloading when opening build tools)
+ LL::GLTFSceneManager::instance().load();
+ return true;
+ }
+};
+
// these are used in the gl menus to set control values that require shader recompilation
class LLToggleShaderControl : public view_listener_t
{
@@ -9309,6 +9370,8 @@ void LLUploadCostCalculator::calculateCost(const std::string& asset_type_str)
if (asset_type_str == "texture")
{
+ // This use minimal texture cost to allow bulk and
+ // texture upload menu options to be visible
upload_cost = LLAgentBenefitsMgr::current().getTextureUploadCost();
}
else if (asset_type_str == "animation")
@@ -9606,7 +9669,10 @@ void initialize_menus()
view_listener_t::addMenu(new LLAdvancedClickRenderShadowOption(), "Advanced.ClickRenderShadowOption");
view_listener_t::addMenu(new LLAdvancedClickRenderProfile(), "Advanced.ClickRenderProfile");
view_listener_t::addMenu(new LLAdvancedClickRenderBenchmark(), "Advanced.ClickRenderBenchmark");
+ view_listener_t::addMenu(new LLAdvancedClickHDRIPreview(), "Advanced.ClickHDRIPreview");
+ view_listener_t::addMenu(new LLAdvancedClickGLTFScenePreview(), "Advanced.ClickGLTFScenePreview");
view_listener_t::addMenu(new LLAdvancedPurgeShaderCache(), "Advanced.ClearShaderCache");
+ view_listener_t::addMenu(new LLAdvancedRebuildTerrain(), "Advanced.RebuildTerrain");
#ifdef TOGGLE_HACKED_GODLIKE_VIEWER
view_listener_t::addMenu(new LLAdvancedHandleToggleHackedGodmode(), "Advanced.HandleToggleHackedGodmode");