summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2009-11-13 16:21:11 -0500
committerLoren Shih <seraph@lindenlab.com>2009-11-13 16:21:11 -0500
commit7a1e7dd69d8c3c5f302c95ee083155fe0863a0be (patch)
treebfd26599f4c25af43c0a8d6c8050d203f4a41c2d /indra/newview/llvoavatar.cpp
parentf0cd44a6a2c4001111e82425cf2bd4fee63fad27 (diff)
parent2aa9f1bcbe0c51f9de24d52a08726dc13038f5b8 (diff)
merge
--HG-- branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r--indra/newview/llvoavatar.cpp121
1 files changed, 11 insertions, 110 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 62ac8adad0..b6c1ee2f11 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -624,7 +624,6 @@ F32 LLVOAvatar::sGreyUpdateTime = 0.f;
// Helper functions
//-----------------------------------------------------------------------------
static F32 calc_bouncy_animation(F32 x);
-static U32 calc_shame(const LLVOVolume* volume, std::set<LLUUID> &textures);
//-----------------------------------------------------------------------------
// LLVOAvatar()
@@ -7637,9 +7636,17 @@ void LLVOAvatar::idleUpdateRenderCost()
return;
}
- U32 shame = 1;
+ U32 shame = 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))
+ {
+ shame +=20;
+ }
+ }
for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end();
@@ -7660,15 +7667,13 @@ void LLVOAvatar::idleUpdateRenderCost()
const LLVOVolume* volume = drawable->getVOVolume();
if (volume)
{
- shame += calc_shame(volume, textures);
+ shame += volume->getRenderCost();
}
}
}
}
}
- shame += textures.size() * 5;
-
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);
@@ -7713,110 +7718,6 @@ const std::string LLVOAvatar::getBakedStatusForPrintout() const
}
-U32 calc_shame(const LLVOVolume* volume, std::set<LLUUID> &textures)
-{
- if (!volume)
- {
- return 0;
- }
-
- U32 shame = 0;
-
- U32 invisi = 0;
- U32 shiny = 0;
- U32 glow = 0;
- U32 alpha = 0;
- U32 flexi = 0;
- U32 animtex = 0;
- U32 particles = 0;
- U32 scale = 0;
- U32 bump = 0;
- U32 planar = 0;
-
- if (volume->isFlexible())
- {
- flexi = 1;
- }
- if (volume->isParticleSource())
- {
- particles = 1;
- }
-
- const LLVector3& sc = volume->getScale();
- scale += (U32) sc.mV[0] + (U32) sc.mV[1] + (U32) sc.mV[2];
-
- const LLDrawable* drawablep = volume->mDrawable;
-
- if (volume->isSculpted())
- {
- const LLSculptParams *sculpt_params = (LLSculptParams *) volume->getParameterEntry(LLNetworkData::PARAMS_SCULPT);
- LLUUID sculpt_id = sculpt_params->getSculptTexture();
- textures.insert(sculpt_id);
- }
-
- for (S32 i = 0; i < drawablep->getNumFaces(); ++i)
- {
- const LLFace* face = drawablep->getFace(i);
- const LLTextureEntry* te = face->getTextureEntry();
- const LLViewerTexture* img = face->getTexture();
-
- textures.insert(img->getID());
-
- if (face->getPoolType() == LLDrawPool::POOL_ALPHA)
- {
- alpha++;
- }
- else if (img->getPrimaryFormat() == GL_ALPHA)
- {
- invisi = 1;
- }
-
- if (te)
- {
- if (te->getBumpmap())
- {
- bump = 1;
- }
- if (te->getShiny())
- {
- shiny = 1;
- }
- if (te->getGlow() > 0.f)
- {
- glow = 1;
- }
- if (face->mTextureMatrix != NULL)
- {
- animtex++;
- }
- if (te->getTexGen())
- {
- planar++;
- }
- }
- }
-
- shame += invisi + shiny + glow + alpha*4 + flexi*8 + animtex*4 + particles*16+bump*4+scale+planar;
-
- LLViewerObject::const_child_list_t& child_list = volume->getChildren();
- for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
- iter != child_list.end();
- ++iter)
- {
- const LLViewerObject* child_objectp = *iter;
- const LLDrawable* child_drawablep = child_objectp->mDrawable;
- if (child_drawablep)
- {
- const LLVOVolume* child_volumep = child_drawablep->getVOVolume();
- if (child_volumep)
- {
- shame += calc_shame(child_volumep, textures);
- }
- }
- }
-
- return shame;
-}
//virtual
S32 LLVOAvatar::getTexImageSize() const