summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@geenzo.com>2026-05-14 22:36:43 -0400
committerJonathan "Geenz" Goodman <geenz@geenzo.com>2026-05-14 22:36:43 -0400
commit97f8dfaca2a60e228b84aedbf71620f0c000412c (patch)
treeacc778797233fae9f97d48367baa434ba3fea085 /indra
parent82db4943e011fc65e9a0b87990abb49b898a7782 (diff)
Add a background discard offset.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/app_settings/settings.xml12
-rw-r--r--indra/newview/llviewertexture.cpp11
2 files changed, 22 insertions, 1 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 0f1b704dc9..e9d91b7add 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -11909,6 +11909,18 @@
<key>Value</key>
<real>0.011</real>
</map>
+ <key>TextureBackgroundDiscardOffset</key>
+ <map>
+ <key>Comment</key>
+ <string>Backgrounded textures will only discard up to (dim_max - offset). e.g. a 2048 texture (dim_max 11) with offset 2 caps the background floor at discard 9. 0 disables the cap (background can drive to max discard).</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>S32</string>
+ <key>Value</key>
+ <integer>2</integer>
+ </map>
+
<key>TextureDistanceDiscardPower</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 79439b4d58..1e8951926e 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -3204,7 +3204,16 @@ void LLViewerLODTexture::processTextureStats()
combined = llmax(combined, mStalenessFactor);
if (!isAgentAvatarBoost(mBoostLevel))
{
- combined = llmax(combined, sBackgroundFactor);
+ // Background floor capped at (dim_max - offset) so we can
+ // keep some baseline quality while backgrounded.
+ static LLCachedControl<S32> bg_offset(gSavedSettings, "TextureBackgroundDiscardOffset", 2);
+ F32 bg = sBackgroundFactor;
+ if ((S32)bg_offset > 0 && dim_max_for_image > 0.f)
+ {
+ F32 cap = llmax(dim_max_for_image - (F32)(S32)bg_offset, 0.f) / dim_max_for_image;
+ bg = llmin(bg, cap);
+ }
+ combined = llmax(combined, bg);
}
// VRAM pressure: pow(combined, 1 - factor) bends the curve