summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2014-11-13 12:37:46 -0500
committerOz Linden <oz@lindenlab.com>2014-11-13 12:37:46 -0500
commit0858ba2d0a7253e7f9f4db84560da6f829f7270c (patch)
treeb250696436972ee99dc29ce14c0839d8840ac6bf /indra/newview
parent2301cf800f40101baed7a5936683d0b1e4968be1 (diff)
clean up showing avatar draw costs
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llviewermenu.cpp9
-rwxr-xr-xindra/newview/llvoavatar.cpp77
-rwxr-xr-xindra/newview/pipeline.h2
-rwxr-xr-xindra/newview/skins/default/xui/en/menu_viewer.xml8
4 files changed, 59 insertions, 37 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 3abeba4b43..79c353f30c 100755
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -978,10 +978,6 @@ U32 info_display_from_string(std::string info_display)
{
return LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY;
}
- else if ("shame" == info_display)
- {
- return LLPipeline::RENDER_DEBUG_SHAME;
- }
else if ("texture area" == info_display)
{
return LLPipeline::RENDER_DEBUG_TEXTURE_AREA;
@@ -1010,9 +1006,9 @@ U32 info_display_from_string(std::string info_display)
{
return LLPipeline::RENDER_DEBUG_COMPOSITION;
}
- else if ("attachment bytes" == info_display)
+ else if ("avatardrawinfo" == info_display)
{
- return LLPipeline::RENDER_DEBUG_ATTACHMENT_BYTES;
+ return (LLPipeline::RENDER_DEBUG_AVATAR_DRAW_INFO);
}
else if ("glow" == info_display)
{
@@ -1048,6 +1044,7 @@ U32 info_display_from_string(std::string info_display)
}
else
{
+ LL_WARNS() << "unrecognized feature name '" << info_display << "'" << LL_ENDL;
return 0;
}
};
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 22b979aa09..d5d93e82a8 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -3089,9 +3089,6 @@ bool LLVOAvatar::isVisuallyMuted()
if (!isSelf())
{
- static LLCachedControl<U32> render_auto_mute_functions(gSavedSettings, "RenderAutoMuteFunctions", 0);
- if (render_auto_mute_functions) // Hacky debug switch for developing feature
- {
// Priority order (highest priority first)
// * own avatar is never visually muted
// * if on the "always draw normally" list, draw them normally
@@ -3124,7 +3121,7 @@ bool LLVOAvatar::isVisuallyMuted()
else
{ // Determine if visually muted or not
- U32 max_cost = (U32) (max_render_cost*(LLVOAvatar::sLODFactor+0.5));
+ U32 max_cost = (U32) (max_render_cost);
muted = LLMuteList::getInstance()->isMuted(getID()) ||
(mAttachmentGeometryBytes > max_attachment_bytes && max_attachment_bytes > 0) ||
@@ -3140,8 +3137,7 @@ bool LLVOAvatar::isVisuallyMuted()
}
// Always draw friends or those in IMs. Needs UI?
- if ((render_auto_mute_functions & 0x02) &&
- (muted || sMaxVisible == 0)) // Don't mute friends or IMs
+ if (muted || sMaxVisible == 0) // Don't mute friends or IMs
{
muted = !(LLAvatarTracker::instance().isBuddy(getID()));
if (muted)
@@ -3158,7 +3154,6 @@ bool LLVOAvatar::isVisuallyMuted()
mCachedVisualMute = muted;
}
}
- }
}
return muted;
@@ -7956,28 +7951,58 @@ void LLVOAvatar::getImpostorValues(LLVector4a* extents, LLVector3& angle, F32& d
void LLVOAvatar::idleUpdateRenderCost()
{
- static LLCachedControl<U32> max_render_cost(gSavedSettings, "RenderAutoMuteRenderWeightLimit", 0);
- static const U32 ARC_LIMIT = 20000;
+ if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_AVATAR_DRAW_INFO))
+ {
+ std::string render_info_text;
+ F32 worst_ratio = 0.f;
+ F32 red_level, green_level;
+
+ static LLCachedControl<U32> max_attachment_bytes(gSavedSettings, "RenderAutoMuteByteLimit", 0);
+ render_info_text.append(llformat("%.1f KB%s", mAttachmentGeometryBytes/1024.f,
+ (max_attachment_bytes > 0 && mAttachmentGeometryBytes > max_attachment_bytes) ? "!" : ""));
- if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_ATTACHMENT_BYTES))
- { //set debug text to attachment geometry bytes here so render cost will override
- setDebugText(llformat("%.1f KB, %.2f m^2", mAttachmentGeometryBytes/1024.f, mAttachmentSurfaceArea));
- }
+ if (max_attachment_bytes != 0) // zero means don't care, so don't bother coloring based on this
+ {
+ if ((mAttachmentGeometryBytes/(F32)max_attachment_bytes) > worst_ratio)
+ {
+ worst_ratio = mAttachmentGeometryBytes/(F32)max_attachment_bytes;
+ green_level = 1.f-llclamp(((F32) mAttachmentGeometryBytes-(F32)max_attachment_bytes)/(F32)max_attachment_bytes, 0.f, 1.f);
+ red_level = llmin((F32) mAttachmentGeometryBytes/(F32)max_attachment_bytes, 1.f);
+ }
+ }
+
+ static LLCachedControl<F32> max_attachment_area(gSavedSettings, "RenderAutoMuteSurfaceAreaLimit", 0);
+ render_info_text.append(llformat(" %.2f m^2%s", mAttachmentSurfaceArea,
+ (max_attachment_area > 0 && mAttachmentSurfaceArea > max_attachment_area) ? "!" : ""));
- if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHAME) && max_render_cost == 0)
- {
- return;
- }
+ if (max_attachment_area != 0) // zero means don't care, so don't bother coloring based on this
+ {
+ if ((mAttachmentSurfaceArea/max_attachment_area) > worst_ratio)
+ {
+ worst_ratio = mAttachmentSurfaceArea/max_attachment_area;
+ green_level = 1.f-llclamp((mAttachmentSurfaceArea-max_attachment_area)/max_attachment_area, 0.f, 1.f);
+ red_level = llmin(mAttachmentSurfaceArea/max_attachment_area, 1.f);
+ }
+ }
- calculateUpdateRenderCost(); // Update mVisualComplexity if needed
-
- if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHAME))
- {
- std::string viz_string = LLVOAvatar::rezStatusToString(getRezzedStatus());
- setDebugText(llformat("%s %d", viz_string.c_str(), mVisualComplexity));
- F32 green = 1.f-llclamp(((F32) mVisualComplexity-(F32)ARC_LIMIT)/(F32)ARC_LIMIT, 0.f, 1.f);
- F32 red = llmin((F32) mVisualComplexity/(F32)ARC_LIMIT, 1.f);
- mText->setColor(LLColor4(red,green,0,1));
+ calculateUpdateRenderCost(); // Update mVisualComplexity if needed
+
+ static LLCachedControl<U32> max_render_cost(gSavedSettings, "RenderAutoMuteRenderWeightLimit", 0);
+ render_info_text.append(llformat(" %d%s", mVisualComplexity,
+ (max_render_cost > 0 && mVisualComplexity > max_render_cost) ? "!" : ""));
+
+ if (max_render_cost != 0) // zero means don't care, so don't bother coloring based on this
+ {
+ if (((F32)mVisualComplexity/(F32)max_render_cost) > worst_ratio)
+ {
+ worst_ratio = (F32)mVisualComplexity/(F32)max_render_cost;
+ green_level = 1.f-llclamp(((F32) mVisualComplexity-(F32)max_render_cost)/(F32)max_render_cost, 0.f, 1.f);
+ red_level = llmin((F32) mVisualComplexity/(F32)max_render_cost, 1.f);
+ }
+ }
+
+ setDebugText(render_info_text);
+ mText->setColor(worst_ratio != 0.f ? LLColor4(red_level,green_level,0,1) : LLColor4::green);
}
}
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index ce2f4b17b1..869fe6ffae 100755
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -518,7 +518,7 @@ public:
RENDER_DEBUG_BATCH_SIZE = 0x00004000,
RENDER_DEBUG_ALPHA_BINS = 0x00008000,
RENDER_DEBUG_RAYCAST = 0x00010000,
- RENDER_DEBUG_SHAME = 0x00020000,
+ RENDER_DEBUG_AVATAR_DRAW_INFO = 0x00020000,
RENDER_DEBUG_SHADOW_FRUSTA = 0x00040000,
RENDER_DEBUG_SCULPTED = 0x00080000,
RENDER_DEBUG_AVATAR_VOLUME = 0x00100000,
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index de441983d0..21e15ba270 100755
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -1533,14 +1533,14 @@
parameter="scene_load_stats" />
</menu_item_call>
<menu_item_check
- label="Show Draw Weight for Avatars"
- name="Avatar Rendering Cost">
+ label="Show Draw Information for Avatars"
+ name="Avatar Draw Info">
<menu_item_check.on_check
function="Advanced.CheckInfoDisplay"
- parameter="shame" />
+ parameter="avatardrawinfo" />
<menu_item_check.on_click
function="Advanced.ToggleInfoDisplay"
- parameter="shame" />
+ parameter="avatardrawinfo" />
</menu_item_check>
</menu>
<menu