summaryrefslogtreecommitdiff
path: root/indra/newview/llviewercontrol.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewercontrol.cpp')
-rw-r--r--indra/newview/llviewercontrol.cpp81
1 files changed, 67 insertions, 14 deletions
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index 7738cb904e..5a2c74e86a 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -54,6 +54,7 @@
#include "llvotree.h"
#include "llvovolume.h"
#include "llworld.h"
+#include "llvlcomposition.h"
#include "pipeline.h"
#include "llviewerjoystick.h"
#include "llviewerobjectlist.h"
@@ -80,7 +81,7 @@
#include <boost/algorithm/string.hpp>
#ifdef TOGGLE_HACKED_GODLIKE_VIEWER
-BOOL gHackGodmode = FALSE;
+bool gHackGodmode = false;
#endif
// Should you contemplate changing the name "Global", please first grep for
@@ -93,9 +94,9 @@ LLControlGroup gWarningSettings("Warnings"); // persists ignored dialogs/warning
std::string gLastRunVersion;
-extern BOOL gResizeScreenTexture;
-extern BOOL gResizeShadowTexture;
-extern BOOL gDebugGL;
+extern bool gResizeScreenTexture;
+extern bool gResizeShadowTexture;
+extern bool gDebugGL;
////////////////////////////////////////////////////////////////////////////
// Listeners
@@ -117,12 +118,25 @@ static bool handleRenderFarClipChanged(const LLSD& newvalue)
return false;
}
-static bool handleTerrainDetailChanged(const LLSD& newvalue)
+static bool handleTerrainScaleChanged(const LLSD& newvalue)
{
- LLDrawPoolTerrain::sDetailMode = newvalue.asInteger();
+ F64 scale = newvalue.asReal();
+ if (scale != 0.0)
+ {
+ LLDrawPoolTerrain::sDetailScale = F32(1.0 / scale);
+ }
return true;
}
+static bool handlePBRTerrainScaleChanged(const LLSD& newvalue)
+{
+ F64 scale = newvalue.asReal();
+ if (scale != 0.0)
+ {
+ LLDrawPoolTerrain::sPBRDetailScale = F32(1.0 / scale);
+ }
+ return true;
+}
static bool handleDebugAvatarJointsChanged(const LLSD& newvalue)
{
@@ -370,7 +384,7 @@ static void handleAudioVolumeChanged(const LLSD& newvalue)
static bool handleJoystickChanged(const LLSD& newvalue)
{
- LLViewerJoystick::getInstance()->setCameraNeedsUpdate(TRUE);
+ LLViewerJoystick::getInstance()->setCameraNeedsUpdate(true);
return true;
}
@@ -423,6 +437,19 @@ static bool handleReflectionProbeDetailChanged(const LLSD& newvalue)
gPipeline.createGLBuffers();
LLViewerShaderMgr::instance()->setShaders();
gPipeline.mReflectionMapManager.reset();
+ gPipeline.mHeroProbeManager.reset();
+ }
+ return true;
+}
+
+static bool handleHeroProbeResolutionChanged(const LLSD &newvalue)
+{
+ if (gPipeline.isInit())
+ {
+ LLPipeline::refreshCachedSettings();
+ gPipeline.mHeroProbeManager.reset();
+ gPipeline.releaseGLBuffers();
+ gPipeline.createGLBuffers();
}
return true;
}
@@ -435,7 +462,7 @@ static bool handleRenderDebugPipelineChanged(const LLSD& newvalue)
static bool handleRenderResolutionDivisorChanged(const LLSD&)
{
- gResizeScreenTexture = TRUE;
+ gResizeScreenTexture = true;
return true;
}
@@ -450,6 +477,7 @@ static bool handleLogFileChanged(const LLSD& newvalue)
std::string log_filename = newvalue.asString();
LLFile::remove(log_filename);
LLError::logToFile(log_filename);
+ LL_INFOS() << "Logging switched to " << log_filename << LL_ENDL;
return true;
}
@@ -470,7 +498,7 @@ bool handleHighResSnapshotChanged(const LLSD& newvalue)
// High Res Snapshot active, must uncheck RenderUIInSnapshot
if (newvalue.asBoolean())
{
- gSavedSettings.setBOOL( "RenderUIInSnapshot", FALSE );
+ gSavedSettings.setBOOL( "RenderUIInSnapshot", false);
}
return true;
}
@@ -637,8 +665,13 @@ void handlePerformanceStatsEnabledChanged(const LLSD& newValue)
}
void handleUserImpostorByDistEnabledChanged(const LLSD& newValue)
{
- const auto newval = gSavedSettings.getBOOL("AutoTuneImpostorByDistEnabled");
- LLPerfStats::tunables.userImpostorDistanceTuningEnabled = newval;
+ bool auto_tune_newval = false;
+ S32 mode = gSavedSettings.getS32("RenderAvatarComplexityMode");
+ if (mode != LLVOAvatar::AV_RENDER_ONLY_SHOW_FRIENDS)
+ {
+ auto_tune_newval = gSavedSettings.getBOOL("AutoTuneImpostorByDistEnabled");
+ }
+ LLPerfStats::tunables.userImpostorDistanceTuningEnabled = auto_tune_newval;
}
void handleUserImpostorDistanceChanged(const LLSD& newValue)
{
@@ -650,6 +683,16 @@ void handleFPSTuningStrategyChanged(const LLSD& newValue)
const auto newval = gSavedSettings.getU32("TuningFPSStrategy");
LLPerfStats::tunables.userFPSTuningStrategy = newval;
}
+
+void handleLocalTerrainChanged(const LLSD& newValue)
+{
+ for (U32 i = 0; i < LLTerrainMaterials::ASSET_COUNT; ++i)
+ {
+ const auto setting = gSavedSettings.getString(std::string("LocalTerrainAsset") + std::to_string(i + 1));
+ const LLUUID materialID(setting);
+ gLocalTerrainMaterials.setDetailAssetID(i, materialID);
+ }
+}
////////////////////////////////////////////////////////////////////////////
LLPointer<LLControlVariable> setting_get_control(LLControlGroup& group, const std::string& setting)
@@ -684,7 +727,11 @@ void settings_setup_listeners()
{
setting_setup_signal_listener(gSavedSettings, "FirstPersonAvatarVisible", handleRenderAvatarMouselookChanged);
setting_setup_signal_listener(gSavedSettings, "RenderFarClip", handleRenderFarClipChanged);
- setting_setup_signal_listener(gSavedSettings, "RenderTerrainDetail", handleTerrainDetailChanged);
+ setting_setup_signal_listener(gSavedSettings, "RenderTerrainScale", handleTerrainScaleChanged);
+ setting_setup_signal_listener(gSavedSettings, "RenderTerrainPBRScale", handlePBRTerrainScaleChanged);
+ setting_setup_signal_listener(gSavedSettings, "RenderTerrainPBRDetail", handleSetShaderChanged);
+ setting_setup_signal_listener(gSavedSettings, "RenderTerrainPBRPlanarSampleCount", handleSetShaderChanged);
+ setting_setup_signal_listener(gSavedSettings, "RenderTerrainPBRTriplanarBlendFactor", handleSetShaderChanged);
setting_setup_signal_listener(gSavedSettings, "OctreeStaticObjectSizeFactor", handleRepartition);
setting_setup_signal_listener(gSavedSettings, "OctreeDistanceFactor", handleRepartition);
setting_setup_signal_listener(gSavedSettings, "OctreeMaxNodeCapacity", handleRepartition);
@@ -707,6 +754,7 @@ void settings_setup_listeners()
setting_setup_signal_listener(gSavedSettings, "RenderGlowNoise", handleSetShaderChanged);
setting_setup_signal_listener(gSavedSettings, "RenderGammaFull", handleSetShaderChanged);
setting_setup_signal_listener(gSavedSettings, "RenderVolumeLODFactor", handleVolumeLODChanged);
+ setting_setup_signal_listener(gSavedSettings, "RenderAvatarComplexityMode", handleUserImpostorByDistEnabledChanged);
setting_setup_signal_listener(gSavedSettings, "RenderAvatarLODFactor", handleAvatarLODChanged);
setting_setup_signal_listener(gSavedSettings, "RenderAvatarPhysicsLODFactor", handleAvatarPhysicsLODChanged);
setting_setup_signal_listener(gSavedSettings, "RenderTerrainLODFactor", handleTerrainLODChanged);
@@ -724,6 +772,7 @@ void settings_setup_listeners()
setting_setup_signal_listener(gSavedSettings, "RenderReflectionProbeDetail", handleReflectionProbeDetailChanged);
setting_setup_signal_listener(gSavedSettings, "RenderReflectionsEnabled", handleReflectionProbeDetailChanged);
setting_setup_signal_listener(gSavedSettings, "RenderScreenSpaceReflections", handleReflectionProbeDetailChanged);
+ setting_setup_signal_listener(gSavedSettings, "RenderHeroProbeResolution", handleHeroProbeResolutionChanged);
setting_setup_signal_listener(gSavedSettings, "RenderShadowDetail", handleSetShaderChanged);
setting_setup_signal_listener(gSavedSettings, "RenderDeferredSSAO", handleSetShaderChanged);
setting_setup_signal_listener(gSavedSettings, "RenderPerformanceTest", handleRenderPerfTestChanged);
@@ -830,6 +879,10 @@ void settings_setup_listeners()
setting_setup_signal_listener(gSavedSettings, "AutoTuneImpostorFarAwayDistance", handleUserImpostorDistanceChanged);
setting_setup_signal_listener(gSavedSettings, "AutoTuneImpostorByDistEnabled", handleUserImpostorByDistEnabledChanged);
setting_setup_signal_listener(gSavedSettings, "TuningFPSStrategy", handleFPSTuningStrategyChanged);
+ setting_setup_signal_listener(gSavedSettings, "LocalTerrainAsset1", handleLocalTerrainChanged);
+ setting_setup_signal_listener(gSavedSettings, "LocalTerrainAsset2", handleLocalTerrainChanged);
+ setting_setup_signal_listener(gSavedSettings, "LocalTerrainAsset3", handleLocalTerrainChanged);
+ setting_setup_signal_listener(gSavedSettings, "LocalTerrainAsset4", handleLocalTerrainChanged);
setting_setup_signal_listener(gSavedPerAccountSettings, "AvatarHoverOffsetZ", handleAvatarHoverOffsetChanged);
}
@@ -841,7 +894,7 @@ DECL_LLCC(U32, (U32)666);
DECL_LLCC(S32, (S32)-666);
DECL_LLCC(F32, (F32)-666.666);
DECL_LLCC(bool, true);
-DECL_LLCC(BOOL, FALSE);
+DECL_LLCC(bool, false);
static LLCachedControl<std::string> mySetting_string("TestCachedControlstring", "Default String Value");
DECL_LLCC(LLVector3, LLVector3(1.0f, 2.0f, 3.0f));
DECL_LLCC(LLVector3d, LLVector3d(6.0f, 5.0f, 4.0f));
@@ -862,7 +915,7 @@ void test_cached_control()
TEST_LLCC(S32, (S32)-666);
TEST_LLCC(F32, (F32)-666.666);
TEST_LLCC(bool, true);
- TEST_LLCC(BOOL, FALSE);
+ TEST_LLCC(bool, false);
if((std::string)mySetting_string != "Default String Value") LL_ERRS() << "Fail string" << LL_ENDL;
TEST_LLCC(LLVector3, LLVector3(1.0f, 2.0f, 3.0f));
TEST_LLCC(LLVector3d, LLVector3d(6.0f, 5.0f, 4.0f));