summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@geenzo.com>2026-07-06 19:11:59 -0400
committerJonathan "Geenz" Goodman <geenz@geenzo.com>2026-07-06 19:11:59 -0400
commitd6154bdfc43e48bbb1549ab228aa27b528e60c3a (patch)
tree9c83ae280ce1fdedb61fb9f5e613687928906ac8 /indra
parent845fe1f83c4967fe1d49715d5f17b61a4adc68ee (diff)
Give avatars (and attachments) a bonus so they appear crisp more often.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/llviewertexturelist.cpp33
2 files changed, 44 insertions, 0 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 2fec0b53d4..c1a2ca2745 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -12124,6 +12124,17 @@
<key>Value</key>
<string />
</map>
+ <key>TextureAvatarBoost</key>
+ <map>
+ <key>Comment</key>
+ <string>Coverage multiplier for avatar textures: worn attachments (rigged extents make their measurement unreliable) and baked system-avatar textures. 4.0 = one mip finer than measured. A bonus, not a pin - nearby avatars gain headroom while distant avatars still downrez with their measured coverage. 1.0 disables.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>4.0</real>
+ </map>
<key>TextureDownrezCoverageBias</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index e503bbc466..70bca3854d 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -1154,6 +1154,20 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag
F32 crop = llmin(repeats, 1.f);
F32 vsize = llmin(face_px / tiling, LLViewerTexture::sWindowPixelArea) / crop;
+ // Avatar bonus: worn attachments get a coverage
+ // multiplier - avatars are what people look at, and
+ // rigged extents make attachment coverage measurement
+ // unreliable anyway. Multiplicative, not a slam: a
+ // nearby avatar gains ~a mip of headroom while a distant
+ // one still downrezzes naturally with its coverage.
+ // (System-avatar bakes get the same bonus in the
+ // no-faces branch below.)
+ if (objp->isAttachment())
+ {
+ static LLCachedControl<F32> avatar_boost(gSavedSettings, "TextureAvatarBoost", 4.f);
+ vsize *= llmax((F32)avatar_boost, 1.f);
+ }
+
if (bucket >= 0 && bucket < 4)
{
channel_coverage[bucket] = llmax(channel_coverage[bucket], vsize);
@@ -1181,6 +1195,25 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag
channel_coverage_min[1] = cov;
max_coverage = cov;
}
+ // Baked avatar textures render on system-avatar body meshes whose
+ // joint meshes never register faces with the texture list
+ // (LLAvatarJointMesh::setTexture just stores the pointer).
+ // LLVOAvatar::updateTextures feeds their on-screen pixel area through
+ // addTextureStats every frame - use that as BaseColor coverage, with
+ // the same avatar bonus attachments get above.
+ else if (face_count == 0
+ && (imagep->getFTType() == FTT_SERVER_BAKE || imagep->getFTType() == FTT_HOST_BAKE))
+ {
+ static LLCachedControl<F32> avatar_boost(gSavedSettings, "TextureAvatarBoost", 4.f);
+ F32 cov = llmin(imagep->getMaxVirtualSize(), LLViewerTexture::sWindowPixelArea)
+ * llmax((F32)avatar_boost, 1.f);
+ if (cov > 0.f)
+ {
+ channel_coverage[1] = cov;
+ channel_coverage_min[1] = cov;
+ max_coverage = cov;
+ }
+ }
// Light projector textures register as LIGHT_TEX volumes, not faces.
// mSpotLightPriority (refreshed above) is already a screen-pixel-area