summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2024-12-04 10:33:04 -0800
committerGitHub <noreply@github.com>2024-12-04 12:33:04 -0600
commit4b5d4be5a86af035ec756bcbdb3aeafbf90f5d10 (patch)
tree60e991593b96e12b17374f650a3d93559d9c6742
parent27fb297b6f5ac1e5b5e28c012a63f845eb81ab68 (diff)
#3106 Lower maximum texture bias back to 4, reintroduce camera importance texture scaling (#3207)
-rw-r--r--indra/newview/app_settings/settings.xml19
-rw-r--r--indra/newview/llviewertexture.cpp2
-rw-r--r--indra/newview/llviewertexturelist.cpp16
3 files changed, 17 insertions, 20 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 65235b47af..1ea08498c5 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -11433,30 +11433,17 @@
<key>Value</key>
<real>20.0</real>
</map>
- <key>TextureBiasDistanceScale</key>
+ <key>TextureCameraBoost</key>
<map>
<key>Comment</key>
- <string>When biasing textures to lower resolution due to lack of vram, weight to put on distance factor.</string>
+ <string>Amount to boost resolution of textures that are important to the camera.</string>
<key>Persist</key>
- <integer>1</integer>
+ <integer>0</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>8.0</real>
</map>
- <key>TextureBiasUnimportantFactor</key>
- <map>
- <key>Comment</key>
- <string>When biasing textures to lower resolution due to lack of vram, the importance threshold below which is considered unimportant and getting an extra bias.</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>F32</string>
- <key>Value</key>
- <real>0.25</real>
- <key>Backup</key>
- <integer>0</integer>
- </map>
<key>TextureDecodeDisabled</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 36cc9bf88f..e14ddc4360 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -621,7 +621,7 @@ void LLViewerTexture::updateClass()
}
}
- sDesiredDiscardBias = llclamp(sDesiredDiscardBias, 1.f, 5.f);
+ sDesiredDiscardBias = llclamp(sDesiredDiscardBias, 1.f, 4.f);
LLViewerTexture::sFreezeImageUpdates = false;
}
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index 2dc0458d99..b44bedea50 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -891,7 +891,6 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag
if (imagep->getBoostLevel() < LLViewerFetchedTexture::BOOST_HIGH) // don't bother checking face list for boosted textures
{
- static LLCachedControl<F32> bias_distance_scale(gSavedSettings, "TextureBiasDistanceScale", 1.f);
static LLCachedControl<F32> texture_scale_min(gSavedSettings, "TextureScaleMinAreaFactor", 0.04f);
static LLCachedControl<F32> texture_scale_max(gSavedSettings, "TextureScaleMaxAreaFactor", 25.f);
@@ -900,7 +899,12 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag
U32 face_count = 0;
- F32 bias = (F32) llroundf(powf(4, LLViewerTexture::sDesiredDiscardBias - 1.f));
+ // get adjusted bias based on image resolution
+ F32 max_discard = F32(imagep->getMaxDiscardLevel());
+ F32 bias = llclamp(max_discard - 2.f, 1.f, LLViewerTexture::sDesiredDiscardBias);
+
+ // convert bias into a vsize scaler
+ bias = (F32) llroundf(powf(4, bias - 1.f));
LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;
for (U32 i = 0; i < LLRender::NUM_TEXTURE_CHANNELS; ++i)
@@ -914,7 +918,6 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag
++face_count;
F32 radius;
F32 cos_angle_to_view_dir;
- static LLCachedControl<F32> bias_unimportant_threshold(gSavedSettings, "TextureBiasUnimportantFactor", 0.25f);
if ((gFrameCount - face->mLastTextureUpdate) > 10)
{ // only call calcPixelArea at most once every 10 frames for a given face
@@ -948,6 +951,13 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag
vsize /= bias;
}
+ // boost resolution of textures that are important to the camera
+ if (face->mInFrustum)
+ {
+ static LLCachedControl<F32> texture_camera_boost(gSavedSettings, "TextureCameraBoost", 8.f);
+ vsize *= llmax(face->mImportanceToCamera*texture_camera_boost, 1.f);
+ }
+
max_vsize = llmax(max_vsize, vsize);
}
}