diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/app_settings/settings.xml | 22 | ||||
-rw-r--r-- | indra/newview/llviewertexturelist.cpp | 11 |
2 files changed, 31 insertions, 2 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 1bd24128e3..d41a2c101c 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13054,6 +13054,28 @@ <key>Value</key> <string /> </map> + <key>TextureScaleMinAreaFactor</key> + <map> + <key>Comment</key> + <string>Limits how texture scale affects area calculation.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>0.04</real> + </map> + <key>TextureScaleMaxAreaFactor</key> + <map> + <key>Comment</key> + <string>Limits how texture scale affects area calculation.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>25.0</real> + </map> <key>ThreadPoolSizes</key> <map> <key>Comment</key> diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 0e7c19c5e1..a6eebb7d76 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -886,6 +886,8 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag llassert(!gCubeSnapshot); 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); LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE { @@ -899,10 +901,15 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag { F32 vsize = face->getPixelArea(); - // scale desired texture resolution higher or lower depending on texture scale + // Scale desired texture resolution higher or lower depending on texture scale + // + // Minimum usage examples: a 1024x1024 texture with aplhabet, runing string + // shows one letter at a time + // + // Maximum usage examples: huge chunk of terrain repeats texture const LLTextureEntry* te = face->getTextureEntry(); F32 min_scale = te ? llmin(fabsf(te->getScaleS()), fabsf(te->getScaleT())) : 1.f; - min_scale = llclamp(min_scale*min_scale, 0.1f, 25.f); + min_scale = llclamp(min_scale*min_scale, texture_scale_min(), texture_scale_max()); vsize /= min_scale; vsize /= LLViewerTexture::sDesiredDiscardBias; |