diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index fe743e745162d29ea68d7c2d538157cedcbc853a..bdc12ec0e3c384ca6003dde4477a62c00bf64ba1 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -708,7 +708,14 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update) LLVOVolume* volume = getVOVolume(); if (volume) { - pos.set(getPositionGroup().getF32ptr()); + if (getSpatialGroup()) + { + pos.set(getPositionGroup().getF32ptr()); + } + else + { + pos = getPositionAgent(); + } if (isState(LLDrawable::HAS_ALPHA)) { diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 37aa0802288c878765cf4ca831c3b2ba50acb394..99c7d4b8c93d8bc3e201aed3700d58642fbcce83 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -937,6 +937,10 @@ U32 info_display_from_string(std::string info_display) { return LLPipeline::RENDER_DEBUG_FACE_AREA; } + else if ("lod info" == info_display) + { + return LLPipeline::RENDER_DEBUG_LOD_INFO; + } else if ("build queue" == info_display) { return LLPipeline::RENDER_DEBUG_BUILD_QUEUE; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 66263412ec5699847bde052b81c7453465748a84..7601b68c5f99d9cf3f304992c99e2646e64127a2 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1218,7 +1218,10 @@ BOOL LLVOVolume::calcLOD() distance = mDrawable->mDistanceWRTCamera; radius = getVolume()->mLODScaleBias.scaledVec(getScale()).length(); } - + + //hold onto unmodified distance for debugging + F32 debug_distance = distance; + distance *= sDistanceFactor; F32 rampDist = LLVOVolume::sLODFactor * 2; @@ -1237,6 +1240,12 @@ BOOL LLVOVolume::calcLOD() cur_detail = computeLODDetail(llround(distance, 0.01f), llround(radius, 0.01f)); + + if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_LOD_INFO)) + { + setDebugText(llformat("%.2f:%.2f, %d", debug_distance, radius, cur_detail)); + } + if (cur_detail != mLOD) { mAppAngle = llround((F32) atan2( mDrawable->getRadius(), mDrawable->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 9eaf515c653324043a8e9f50854c7bb0a926e3c7..ba597d62bf19a973dabbc486abae0db9c4c0a8e4 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2742,7 +2742,7 @@ void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera) if (LLViewerCamera::sCurCameraID == LLViewerCamera::CAMERA_WORLD) { - if (drawablep->isVisible()) + //if (drawablep->isVisible()) isVisible() check here is redundant, if it wasn't visible, it wouldn't be here { if (!drawablep->isActive()) { diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 32ac93388d9c2db5c9ab391124144fee87da1d49..be58af947c43dfa4d715a1900ec0c442dac3e327 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -447,6 +447,7 @@ class LLPipeline RENDER_DEBUG_UPDATE_TYPE = 0x0800000, RENDER_DEBUG_PHYSICS_SHAPES = 0x1000000, RENDER_DEBUG_NORMALS = 0x2000000, + RENDER_DEBUG_LOD_INFO = 0x4000000, }; public: diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 0a6be2899ba83919476081e608e284bfe38d1953..38e91656136780b1db888c8a1187e2ed0191457b 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2277,6 +2277,16 @@ function="Advanced.ToggleInfoDisplay" parameter="face area" /> </menu_item_check> + <menu_item_check + label="LOD Info" + name="LOD Info"> + <menu_item_check.on_check + function="Advanced.CheckInfoDisplay" + parameter="lod info" /> + <menu_item_check.on_click + function="Advanced.ToggleInfoDisplay" + parameter="lod info" /> + </menu_item_check> <menu_item_check label="Build Queue" name="Build Queue">