summaryrefslogtreecommitdiff
path: root/indra/newview/llvocache.cpp
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2013-11-06 09:42:06 -0700
committerXiaohong Bao <bao@lindenlab.com>2013-11-06 09:42:06 -0700
commit463a8930c8bddd8740478f6400561a48220ee584 (patch)
tree61899b258e36ab0f6692d35645a22f21e7496759 /indra/newview/llvocache.cpp
parent0ce7008521b776451c0ce38299fa87c9e64c63cd (diff)
re-organize the code of processing the debug setting "ObjectProjectionAreaCutOff"
Diffstat (limited to 'indra/newview/llvocache.cpp')
-rwxr-xr-xindra/newview/llvocache.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp
index be7ff00c05..d0061fc777 100755
--- a/indra/newview/llvocache.cpp
+++ b/indra/newview/llvocache.cpp
@@ -358,6 +358,19 @@ void LLVOCacheEntry::updateDebugSettings()
sBackAngleTanSquared = squared_back_angle;
}
+//static
+F32 LLVOCacheEntry::getSquaredObjectScreenAreaThreshold()
+{
+ static LLCachedControl<F32> projection_area_cutoff(gSavedSettings,"ObjectProjectionAreaCutOff");
+
+ //object projected area threshold
+ F32 pixel_meter_ratio = LLViewerCamera::getInstance()->getPixelMeterRatio();
+ F32 projection_threshold = pixel_meter_ratio > 0.f ? projection_area_cutoff / pixel_meter_ratio : 0.f;
+ projection_threshold *= projection_threshold;
+
+ return projection_threshold;
+}
+
bool LLVOCacheEntry::isAnyVisible(const LLVector4a& camera_origin, F32 squared_dist_threshold)
{
LLOcclusionCullingGroup* group = (LLOcclusionCullingGroup*)getGroup();
@@ -752,8 +765,7 @@ void LLVOCachePartition::selectBackObjects(LLCamera &camera, F32 back_sphere_rad
S32 LLVOCachePartition::cull(LLCamera &camera, bool do_occlusion)
{
static LLCachedControl<bool> use_object_cache_occlusion(gSavedSettings,"UseObjectCacheOcclusion");
- static LLCachedControl<F32> back_sphere_radius(gSavedSettings,"BackShpereCullingRadius");
- static LLCachedControl<F32> projection_area_cutoff(gSavedSettings,"ObjectProjectionAreaCutOFF");
+ static LLCachedControl<F32> back_sphere_radius(gSavedSettings,"BackShpereCullingRadius");
if(!LLViewerRegion::sVOCacheCullingEnabled)
{
@@ -778,10 +790,8 @@ S32 LLVOCachePartition::cull(LLCamera &camera, bool do_occlusion)
mCulledTime[LLViewerCamera::sCurCameraID] = LLViewerOctreeEntryData::getCurrentFrame();
//object projected area threshold
- F32 pixel_meter_ratio = LLViewerCamera::getInstance()->getPixelMeterRatio();
- F32 projection_threshold = pixel_meter_ratio > 0.f ? projection_area_cutoff / pixel_meter_ratio : 0.f;
- projection_threshold *= projection_threshold;
-
+ F32 projection_threshold = LLVOCacheEntry::getSquaredObjectScreenAreaThreshold();
+
if(!mCullHistory && LLViewerRegion::isViewerCameraStatic())
{
U32 seed = llmax(mLODPeriod >> 1, (U32)4);