diff options
-rw-r--r-- | indra/llmath/llvolume.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llcontrolavatar.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llvovolume.cpp | 27 | ||||
-rw-r--r-- | indra/newview/pipeline.h | 9 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_viewer.xml | 10 |
6 files changed, 48 insertions, 10 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 7a54d83b3f..8c27ef9961 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -1,5 +1,4 @@ /** - * @file llvolume.cpp * * $LicenseInfo:firstyear=2002&license=viewerlgpl$ diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index fb61328a1b..d458e2951b 100644 --- a/indra/newview/llcontrolavatar.cpp +++ b/indra/newview/llcontrolavatar.cpp @@ -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(), diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index eddbe16482..f01c67e499 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -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; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index c0814c5695..04e2827182 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -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) diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index bba36351d9..4cc4b821bf 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -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: diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 697d27907d..f8b4948697 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2654,6 +2654,16 @@ 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"> <menu_item_check.on_check |