diff options
author | Nyx (Neal Orman) <nyx@lindenlab.com> | 2009-11-23 15:12:48 -0500 |
---|---|---|
committer | Nyx (Neal Orman) <nyx@lindenlab.com> | 2009-11-23 15:12:48 -0500 |
commit | ca5e49d5fab171bc455c58b8f745d7f00d46bb41 (patch) | |
tree | 186f433496b419d7c6b561d53c4d37929db0319c /indra/newview/llvoavatar.cpp | |
parent | 24dbd81763254178bfcdb15d1ee3e4be48032b4b (diff) |
EXT-2718 EXT-2434 avatar render cost changes
Fixing a but in new ARC function where textures added 5 to the ARC for each
use. Expected (and previous) behavior restored, where 5 is added to ARC for each
unique texture, regardless of how many faces it is used on.
Confirmed new ARC is 99 points higher than previous (20 for each body part), or
119 if avatar is wearing a skirt.
Will be post-reviewed before pushing
--HG--
branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r-- | indra/newview/llvoavatar.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 75e35e5221..9e75d7853d 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7636,15 +7636,19 @@ void LLVOAvatar::idleUpdateRenderCost() return; } - U32 shame = 0; + U32 cost = 0; + std::set<LLUUID> textures; for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) { const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index); ETextureIndex tex_index = baked_dict->mTextureIndex; - if (isTextureVisible(tex_index)) + if ((tex_index != TEX_SKIRT_BAKED) || (isWearingWearableType(WT_SKIRT))) { - shame +=20; + if (isTextureVisible(tex_index)) + { + cost +=20; + } } } @@ -7663,20 +7667,22 @@ void LLVOAvatar::idleUpdateRenderCost() const LLDrawable* drawable = attached_object->mDrawable; if (drawable) { - shame += 10; + cost += 10; const LLVOVolume* volume = drawable->getVOVolume(); if (volume) { - shame += volume->getRenderCost(); + cost += volume->getRenderCost(textures); } } } } } - setDebugText(llformat("%d", shame)); - F32 green = 1.f-llclamp(((F32) shame-1024.f)/1024.f, 0.f, 1.f); - F32 red = llmin((F32) shame/1024.f, 1.f); + cost += textures.size() * 5; + + setDebugText(llformat("%d", cost)); + F32 green = 1.f-llclamp(((F32) cost-1024.f)/1024.f, 0.f, 1.f); + F32 red = llmin((F32) cost/1024.f, 1.f); mText->setColor(LLColor4(red,green,0,1)); } |