SL-19560 Better fix for blurry BoM textures.

master
RunitaiLinden 2023-05-23 10:55:50 -05:00
parent 13b746401e
commit 0c7205e5f1
6 changed files with 5 additions and 53 deletions

View File

@ -27,25 +27,6 @@
#include "llgltexture.h"
// static
S32 LLGLTexture::getTotalNumOfCategories()
{
return MAX_GL_IMAGE_CATEGORY - (BOOST_HIGH - BOOST_SCULPTED) + 2 ;
}
// static
//index starts from zero.
S32 LLGLTexture::getIndexFromCategory(S32 category)
{
return (category < BOOST_HIGH) ? category : category - (BOOST_HIGH - BOOST_SCULPTED) + 1 ;
}
//static
S32 LLGLTexture::getCategoryFromIndex(S32 index)
{
return (index < BOOST_HIGH) ? index : index + (BOOST_HIGH - BOOST_SCULPTED) - 1 ;
}
LLGLTexture::LLGLTexture(BOOL usemipmaps)
{
init();

View File

@ -49,8 +49,8 @@ public:
enum EBoostLevel
{
BOOST_NONE = 0,
BOOST_AVATAR_BAKED ,
BOOST_AVATAR ,
BOOST_AVATAR_BAKED ,
BOOST_SCULPTED ,
BOOST_HIGH = 10,
@ -87,10 +87,6 @@ public:
NO_DELETE = 99 //stay in memory, can not be removed.
} LLGLTextureState;
static S32 getTotalNumOfCategories() ;
static S32 getIndexFromCategory(S32 category) ;
static S32 getCategoryFromIndex(S32 index) ;
protected:
virtual ~LLGLTexture();
LOG_CLASS(LLGLTexture);

View File

@ -3115,7 +3115,8 @@ void LLViewerLODTexture::processTextureStats()
//
S32 current_discard = getDiscardLevel();
if (mBoostLevel < LLGLTexture::BOOST_SCULPTED && current_discard >= 0)
if (mBoostLevel < LLGLTexture::BOOST_AVATAR_BAKED &&
current_discard >= 0)
{
if (current_discard < (mDesiredDiscardLevel-1) && !mForceToSaveRawImage)
{ // should scale down

View File

@ -1013,33 +1013,6 @@ void LLViewerTextureList::setDebugFetching(LLViewerFetchedTexture* tex, S32 debu
addImageToList(tex);
}
/*
static U8 get_image_type(LLViewerFetchedTexture* imagep, LLHost target_host)
{
// Having a target host implies this is a baked image. I don't
// believe that boost level has been set at this point. JC
U8 type_from_host = (target_host.isOk()
? LLImageBase::TYPE_AVATAR_BAKE
: LLImageBase::TYPE_NORMAL);
S32 boost_level = imagep->getBoostLevel();
U8 type_from_boost = ( (boost_level == LLViewerFetchedTexture::BOOST_AVATAR_BAKED
|| boost_level == LLViewerFetchedTexture::BOOST_AVATAR_BAKED_SELF)
? LLImageBase::TYPE_AVATAR_BAKE
: LLImageBase::TYPE_NORMAL);
if (type_from_host == LLImageBase::TYPE_NORMAL
&& type_from_boost == LLImageBase::TYPE_AVATAR_BAKE)
{
LL_WARNS() << "TAT: get_image_type() type_from_host doesn't match type_from_boost"
<< " host " << target_host
<< " boost " << imagep->getBoostLevel()
<< " imageid " << imagep->getID()
<< LL_ENDL;
imagep->dump();
}
return type_from_host;
}
*/
F32 LLViewerTextureList::updateImagesCreateTextures(F32 max_time)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;

View File

@ -7073,6 +7073,7 @@ void LLVOAvatar::setPixelAreaAndAngle(LLAgent &agent)
size.mul(0.5f);
mImpostorPixelArea = LLPipeline::calcPixelArea(center, size, *LLViewerCamera::getInstance());
mPixelArea = mImpostorPixelArea;
F32 range = mDrawable->mDistanceWRTCamera;

View File

@ -684,7 +684,7 @@ private:
//--------------------------------------------------------------------
public:
virtual LLViewerTexture::EBoostLevel getAvatarBoostLevel() const { return LLGLTexture::BOOST_AVATAR; }
virtual LLViewerTexture::EBoostLevel getAvatarBakedBoostLevel() const { return LLGLTexture::BOOST_AVATAR_BAKED_SELF; }
virtual LLViewerTexture::EBoostLevel getAvatarBakedBoostLevel() const { return LLGLTexture::BOOST_AVATAR_BAKED; }
virtual S32 getTexImageSize() const;
/*virtual*/ S32 getTexImageArea() const { return getTexImageSize()*getTexImageSize(); }