From 82db4943e011fc65e9a0b87990abb49b898a7782 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Tue, 12 May 2026 20:23:44 -0400 Subject: Rework texture streaming and tracking. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a big one: - Reworks the discard signal almost entirely. Now has a normalized 0..1 discard signal: distance x size x channel exponent, floored by staleness and background app state. Shaped by VRAM pressure. - Textures can now scale down to the smallest GPU mip (1×1), independent of the codec's encoded mip count. - Terrain texture LOD now works. Useful for 2K textures and PBR on terrain. Based upon camera distance to nearest terrain patch. - New texture quality setting. Low/Medium/High/Ultra - Caps texture resolution on Low to 1024, and otherwise shifts the discard signal around. Makes distance based texture LOD work a lot more predictably. - We now track last bind state for textures, and discard accordingly. We progressively discard based upon last bind time. - Avatar textures get a residency boost to stay loaded in VRAM longer under pressure. --- indra/newview/llviewercontrol.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'indra/newview/llviewercontrol.cpp') diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index d4d07f24ea..3a6e4e2e2d 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -114,32 +114,37 @@ static bool handleRenderAvatarMouselookChanged(const LLSD& newvalue) static bool handleRenderTextureQualityChanged(const LLSD& newvalue) { - // 0=Low, 1=Medium, 2=High, 3=Ultra. Drives max-resolution and per-channel - // streaming aggressiveness. Channel order is X=normals, Y=diffuse, - // Z=specular/metallic, W=emissive (matches TextureChannelPriority). + // 0=Low, 1=Medium, 2=High, 3=Ultra. Drives max-resolution and the + // per-channel TextureChannelPriority + TextureDistanceDiscardPower + // exponents. Channel order: X=normals, Y=diffuse, Z=spec, W=emissive. U32 quality = (U32)newvalue.asInteger(); U32 max_res = 2048; - LLVector4 channel_priority(5.f, 7.5f, 20.f, 7.5f); + LLVector4 channel_priority(1.f, 0.75f, 0.5f, 0.75f); + F32 distance_power = 0.5f; switch (quality) { case 0: // Low max_res = 1024; - channel_priority.setVec(20.f, 30.f, 80.f, 30.f); + channel_priority.setVec(0.5f, 0.75f, 0.1f, 0.5f); + distance_power = 0.15f; break; case 1: // Medium - channel_priority.setVec(10.f, 15.f, 40.f, 15.f); + channel_priority.setVec(0.75f, 0.75f, 0.3f, 0.75f); + distance_power = 0.25f; break; case 2: // High - // defaults above + // channel defaults above (1, 0.75, 0.5, 0.75) + distance_power = 0.35f; break; case 3: // Ultra default: - if (quality > 3) quality = 3; channel_priority.setVec(1.f, 1.f, 1.f, 1.f); + distance_power = 0.5f; break; } gSavedSettings.setU32("RenderMaxTextureResolution", max_res); gSavedSettings.setVector4("TextureChannelPriority", channel_priority); + gSavedSettings.setF32("TextureDistanceDiscardPower", distance_power); return true; } -- cgit v1.3