diff options
Diffstat (limited to 'indra/newview/llviewertexturelist.cpp')
-rw-r--r-- | indra/newview/llviewertexturelist.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
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); } } |