SL-3278 Compensate for randomly-switching textures
parent
76ee89fb50
commit
dceab3c78b
|
|
@ -3972,7 +3972,25 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
|
|||
{
|
||||
if (textures.find(img->getID()) == textures.end())
|
||||
{
|
||||
S32 texture_cost = 256 + (S32)(ARC_TEXTURE_COST * (img->getFullHeight() / 128.f + img->getFullWidth() / 128.f));
|
||||
S32 texture_cost = 0;
|
||||
S8 type = img->getType();
|
||||
if (type == LLViewerTexture::FETCHED_TEXTURE || type == LLViewerTexture::LOD_TEXTURE)
|
||||
{
|
||||
const LLViewerFetchedTexture* fetched_texturep = dynamic_cast<const LLViewerFetchedTexture*>(img);
|
||||
if (fetched_texturep
|
||||
&& fetched_texturep->getFTType() == FTT_LOCAL_FILE
|
||||
&& (img->getID() == IMG_ALPHA_GRAD_2D || img->getID() == IMG_ALPHA_GRAD)
|
||||
)
|
||||
{
|
||||
// These two textures appear to switch between each other, but are of different sizes (4x256 and 256x256).
|
||||
// Hardcode cost from larger one to not cause random complexity changes
|
||||
texture_cost = 320;
|
||||
}
|
||||
}
|
||||
if (texture_cost == 0)
|
||||
{
|
||||
texture_cost = 256 + (S32)(ARC_TEXTURE_COST * (img->getFullHeight() / 128.f + img->getFullWidth() / 128.f));
|
||||
}
|
||||
textures.insert(texture_cost_t::value_type(img->getID(), texture_cost));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue