SL-731 - render metadata includes triangle count, triangle and vertex count included with debug text for control avatar
parent
912c8faf55
commit
a571707243
|
|
@ -1,5 +1,4 @@
|
|||
/**
|
||||
|
||||
* @file llvolume.cpp
|
||||
*
|
||||
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
|
||||
|
|
|
|||
|
|
@ -214,11 +214,14 @@ void LLControlAvatar::updateDebugText()
|
|||
std::string active_string;
|
||||
std::string lod_string;
|
||||
S32 total_tris = 0;
|
||||
S32 total_verts = 0;
|
||||
for (std::vector<LLVOVolume*>::iterator it = volumes.begin();
|
||||
it != volumes.end(); ++it)
|
||||
{
|
||||
LLVOVolume *volp = *it;
|
||||
total_tris += volp->getTriangleCount();
|
||||
S32 verts = 0;
|
||||
total_tris += volp->getTriangleCount(&verts);
|
||||
total_verts += verts;
|
||||
lod_string += llformat("%d",volp->getLOD());
|
||||
if (volp && volp->mDrawable)
|
||||
{
|
||||
|
|
@ -253,7 +256,7 @@ void LLControlAvatar::updateDebugText()
|
|||
#endif
|
||||
|
||||
addDebugText(llformat("lod %s",lod_string.c_str()));
|
||||
addDebugText(llformat("tris %d", total_tris));
|
||||
addDebugText(llformat("tris %d verts %d", total_tris, total_verts));
|
||||
//addDebugText(llformat("anim time %.1f (step %f factor %f)",
|
||||
// mMotionController.getAnimTime(),
|
||||
// mMotionController.getTimeStep(),
|
||||
|
|
|
|||
|
|
@ -1076,6 +1076,10 @@ U32 info_display_from_string(std::string info_display)
|
|||
{
|
||||
return LLPipeline::RENDER_DEBUG_TEXEL_DENSITY;
|
||||
}
|
||||
else if ("triangle count" == info_display)
|
||||
{
|
||||
return LLPipeline::RENDER_DEBUG_TRIANGLE_COUNT;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "unrecognized feature name '" << info_display << "'" << LL_ENDL;
|
||||
|
|
|
|||
|
|
@ -1295,14 +1295,35 @@ BOOL LLVOVolume::calcLOD()
|
|||
distance *= F_PI/3.f;
|
||||
|
||||
cur_detail = computeLODDetail(ll_round(distance, 0.01f),
|
||||
ll_round(radius, 0.01f));
|
||||
ll_round(radius, 0.01f));
|
||||
|
||||
|
||||
if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TRIANGLE_COUNT) && mDrawable->getFace(0))
|
||||
{
|
||||
if (isRootEdit() && getChildren().size()>0)
|
||||
{
|
||||
S32 total_tris = getTriangleCount();
|
||||
LLViewerObject::const_child_list_t& child_list = getChildren();
|
||||
for (LLViewerObject::const_child_list_t::const_iterator iter = child_list.begin();
|
||||
iter != child_list.end(); ++iter)
|
||||
{
|
||||
LLViewerObject* childp = *iter;
|
||||
LLVOVolume *child_volp = dynamic_cast<LLVOVolume*>(childp);
|
||||
total_tris += child_volp->getTriangleCount();
|
||||
}
|
||||
setDebugText(llformat("TRIS %d TOTAL %d", getTriangleCount(), total_tris));
|
||||
}
|
||||
else
|
||||
{
|
||||
setDebugText(llformat("TRIS %d", getTriangleCount()));
|
||||
}
|
||||
|
||||
}
|
||||
if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_LOD_INFO) &&
|
||||
mDrawable->getFace(0))
|
||||
{
|
||||
// This is a display for LODs. If you need the texture index, put it somewhere else!
|
||||
setDebugText(llformat("lod %d", cur_detail));
|
||||
// This is a debug display for LODs. Please don't put the texture index here.
|
||||
setDebugText(llformat("%d", cur_detail));
|
||||
}
|
||||
|
||||
if (cur_detail != mLOD)
|
||||
|
|
|
|||
|
|
@ -513,11 +513,11 @@ public:
|
|||
RENDER_DEBUG_TEXTURE_AREA = 0x00000100,
|
||||
RENDER_DEBUG_FACE_AREA = 0x00000200,
|
||||
RENDER_DEBUG_PARTICLES = 0x00000400,
|
||||
RENDER_DEBUG_GLOW = 0x00000800,
|
||||
RENDER_DEBUG_GLOW = 0x00000800, // not used
|
||||
RENDER_DEBUG_TEXTURE_ANIM = 0x00001000,
|
||||
RENDER_DEBUG_LIGHTS = 0x00002000,
|
||||
RENDER_DEBUG_BATCH_SIZE = 0x00004000,
|
||||
RENDER_DEBUG_ALPHA_BINS = 0x00008000,
|
||||
RENDER_DEBUG_ALPHA_BINS = 0x00008000, // not used
|
||||
RENDER_DEBUG_RAYCAST = 0x00010000,
|
||||
RENDER_DEBUG_AVATAR_DRAW_INFO = 0x00020000,
|
||||
RENDER_DEBUG_SHADOW_FRUSTA = 0x00040000,
|
||||
|
|
@ -531,8 +531,9 @@ public:
|
|||
RENDER_DEBUG_NORMALS = 0x04000000,
|
||||
RENDER_DEBUG_LOD_INFO = 0x08000000,
|
||||
RENDER_DEBUG_RENDER_COMPLEXITY = 0x10000000,
|
||||
RENDER_DEBUG_ATTACHMENT_BYTES = 0x20000000,
|
||||
RENDER_DEBUG_TEXEL_DENSITY = 0x40000000
|
||||
RENDER_DEBUG_ATTACHMENT_BYTES = 0x20000000, // not used
|
||||
RENDER_DEBUG_TEXEL_DENSITY = 0x40000000,
|
||||
RENDER_DEBUG_TRIANGLE_COUNT = 0x80000000
|
||||
};
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -2653,6 +2653,16 @@
|
|||
function="Advanced.ToggleInfoDisplay"
|
||||
parameter="lod info" />
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="Triangle Count"
|
||||
name="Triangle Count">
|
||||
<menu_item_check.on_check
|
||||
function="Advanced.CheckInfoDisplay"
|
||||
parameter="triangle count" />
|
||||
<menu_item_check.on_click
|
||||
function="Advanced.ToggleInfoDisplay"
|
||||
parameter="triangle count" />
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="Build Queue"
|
||||
name="Build Queue">
|
||||
|
|
|
|||
Loading…
Reference in New Issue