From ca5e49d5fab171bc455c58b8f745d7f00d46bb41 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Mon, 23 Nov 2009 15:12:48 -0500 Subject: 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 --- indra/newview/llvoavatar.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') 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 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)); } -- cgit v1.2.3 From 52a21a301b3fef1401ee333a77f1d53310737717 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Tue, 24 Nov 2009 18:25:20 -0500 Subject: EXT-2818 not using IMG_INVISIBLE in baked textures this patch allows IMG_INVISIBLE in an alpha mask to set the baked texture to also be IMG_INVISIBLE for the appropriate baked texture. Will be post-reviewed with other alpha mask fixes. --HG-- branch : avatar-pipeline --- indra/newview/llvoavatar.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9e75d7853d..3bf8038a66 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3832,7 +3832,7 @@ U32 LLVOAvatar::renderTransparent(BOOL first_pass) } // Can't test for baked hair being defined, since that won't always be the case (not all viewers send baked hair) // TODO: 1.25 will be able to switch this logic back to calling isTextureVisible(); - if (getImage(TEX_HAIR_BAKED, 0)->getID() != IMG_INVISIBLE || LLDrawPoolAlpha::sShowDebugAlpha) + if ((getImage(TEX_HAIR_ALPHA, 0)->getID() != IMG_INVISIBLE && getImage(TEX_HAIR_BAKED, 0)->getID() != IMG_INVISIBLE) || LLDrawPoolAlpha::sShowDebugAlpha) { num_indices += mMeshLOD[MESH_ID_HAIR]->render(mAdjustedPixelArea, first_pass, mIsDummy); first_pass = FALSE; @@ -3868,7 +3868,7 @@ U32 LLVOAvatar::renderRigid() return 0; } - if (isTextureVisible(TEX_EYES_BAKED) || mIsDummy) + if ((isTextureVisible(TEX_EYES_ALPHA) && isTextureVisible(TEX_EYES_BAKED)) || mIsDummy) { num_indices += mMeshLOD[MESH_ID_EYEBALL_LEFT]->render(mAdjustedPixelArea, TRUE, mIsDummy); num_indices += mMeshLOD[MESH_ID_EYEBALL_RIGHT]->render(mAdjustedPixelArea, TRUE, mIsDummy); @@ -3898,7 +3898,7 @@ U32 LLVOAvatar::renderFootShadows() // Don't render foot shadows if your lower body is completely invisible. // (non-humanoid avatars rule!) - if (!isTextureVisible(TEX_LOWER_BAKED)) + if (!isTextureVisible(TEX_LOWER_BAKED) || ! isTextureVisible(TEX_LOWER_ALPHA)) { return 0; } -- cgit v1.2.3 From 6da470f189ed9f92a7e04529496e95e92d34abcb Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Tue, 24 Nov 2009 19:47:56 -0500 Subject: EXT-2818 no way to get IMG_INVISIBLE as a baked texture reverting unnecessary changes based on code review of previous checkin. Code for both patches reviewed by Seraph. --HG-- branch : avatar-pipeline --- indra/newview/llvoavatar.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 3bf8038a66..9882dcd6af 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3832,7 +3832,7 @@ U32 LLVOAvatar::renderTransparent(BOOL first_pass) } // Can't test for baked hair being defined, since that won't always be the case (not all viewers send baked hair) // TODO: 1.25 will be able to switch this logic back to calling isTextureVisible(); - if ((getImage(TEX_HAIR_ALPHA, 0)->getID() != IMG_INVISIBLE && getImage(TEX_HAIR_BAKED, 0)->getID() != IMG_INVISIBLE) || LLDrawPoolAlpha::sShowDebugAlpha) + if (getImage(TEX_HAIR_BAKED, 0)->getID() != IMG_INVISIBLE || LLDrawPoolAlpha::sShowDebugAlpha) { num_indices += mMeshLOD[MESH_ID_HAIR]->render(mAdjustedPixelArea, first_pass, mIsDummy); first_pass = FALSE; @@ -3868,7 +3868,7 @@ U32 LLVOAvatar::renderRigid() return 0; } - if ((isTextureVisible(TEX_EYES_ALPHA) && isTextureVisible(TEX_EYES_BAKED)) || mIsDummy) + if (isTextureVisible(TEX_EYES_BAKED) || mIsDummy) { num_indices += mMeshLOD[MESH_ID_EYEBALL_LEFT]->render(mAdjustedPixelArea, TRUE, mIsDummy); num_indices += mMeshLOD[MESH_ID_EYEBALL_RIGHT]->render(mAdjustedPixelArea, TRUE, mIsDummy); @@ -3898,7 +3898,7 @@ U32 LLVOAvatar::renderFootShadows() // Don't render foot shadows if your lower body is completely invisible. // (non-humanoid avatars rule!) - if (!isTextureVisible(TEX_LOWER_BAKED) || ! isTextureVisible(TEX_LOWER_ALPHA)) + if (!isTextureVisible(TEX_LOWER_BAKED)) { return 0; } -- cgit v1.2.3