diff options
author | Nyx (Neal Orman) <nyx@lindenlab.com> | 2009-12-11 12:07:35 -0500 |
---|---|---|
committer | Nyx (Neal Orman) <nyx@lindenlab.com> | 2009-12-11 12:07:35 -0500 |
commit | 3089e1a17a1f5bac1487fa56796f2b52244886e9 (patch) | |
tree | 20c7dee84998422e040d144e68f40206283cc5f9 /indra/newview/llvoavatar.cpp | |
parent | 6374834355a8125412527a27804992b6b8732dfa (diff) |
EXT-2718 avatar render cost higher in 2.0 than in 1.23
previous fix fixed the double-counting of texture costs. resulting ARC
was ~99 points higher for most avatars. This patch makes the cost shoot
up again, as ARC was improperly computed in 1.23 and before.
This makes the cost for an avatar increase 10 points per prim instead of
per-attachment, which is how we have documented it. Also used constants to
eliminate magic numbers and increased ARC limit from 1024 to 2048.
Will request feedback on change from BSI:STU
Code reviewed by Bigpapi
--HG--
branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r-- | indra/newview/llvoavatar.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 03910b0534..226d85ec99 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7651,6 +7651,9 @@ void LLVOAvatar::getImpostorValues(LLVector3* extents, LLVector3& angle, F32& di void LLVOAvatar::idleUpdateRenderCost() { + static const U32 ARC_BODY_PART_COST = 20; + static const U32 ARC_LIMIT = 2048; + if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHAME)) { return; @@ -7667,7 +7670,7 @@ void LLVOAvatar::idleUpdateRenderCost() { if (isTextureVisible(tex_index)) { - cost +=20; + cost +=ARC_BODY_PART_COST; } } } @@ -7687,7 +7690,6 @@ void LLVOAvatar::idleUpdateRenderCost() const LLDrawable* drawable = attached_object->mDrawable; if (drawable) { - cost += 10; const LLVOVolume* volume = drawable->getVOVolume(); if (volume) { @@ -7698,11 +7700,11 @@ void LLVOAvatar::idleUpdateRenderCost() } } - cost += textures.size() * 5; + cost += textures.size() * LLVOVolume::ARC_TEXTURE_COST; 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); + F32 green = 1.f-llclamp(((F32) cost-(F32)ARC_LIMIT)/(F32)ARC_LIMIT, 0.f, 1.f); + F32 red = llmin((F32) cost/(F32)ARC_LIMIT, 1.f); mText->setColor(LLColor4(red,green,0,1)); } |