summaryrefslogtreecommitdiff
path: root/indra/newview/llvocache.cpp
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2013-08-29 13:14:56 -0600
committerXiaohong Bao <bao@lindenlab.com>2013-08-29 13:14:56 -0600
commit1751650dbcad4ea66b2c3779aa52960ec1640466 (patch)
treeecdf21bf9ab9da62addfdad030c54aa765f7581b /indra/newview/llvocache.cpp
parent126a977bf824f2b9fe130186b592f3be747a09b6 (diff)
add some debug settings for easier tuning up performance.
Diffstat (limited to 'indra/newview/llvocache.cpp')
-rwxr-xr-xindra/newview/llvocache.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp
index dcd1ae391d..1cfda038a8 100755
--- a/indra/newview/llvocache.cpp
+++ b/indra/newview/llvocache.cpp
@@ -33,7 +33,10 @@
#include "lldrawable.h"
#include "llviewerregion.h"
#include "pipeline.h"
+#include "llagentcamera.h"
+F32 LLVOCacheEntry::sBackDistanceSquared = 0.f;
+F32 LLVOCacheEntry::sBackAngleTanSquared = 0.f;
BOOL LLVOCachePartition::sNeedsOcclusionCheck = FALSE;
LLTrace::MemStatHandle LLVOCachePartition::sMemStat("LLVOCachePartition");
@@ -353,6 +356,21 @@ BOOL LLVOCacheEntry::writeToFile(LLAPRFile* apr_file) const
return success ;
}
+//static
+void LLVOCacheEntry::updateBackCullingFactors()
+{
+ //distance to keep objects = back_dist_factor * draw_distance
+ static LLCachedControl<F32> back_dist_factor(gSavedSettings,"BackDistanceFactor");
+
+ //squared tan(projection angle of the bbox), default is 10 (degree)
+ static LLCachedControl<F32> squared_back_angle(gSavedSettings,"BackProjectionAngleSquared");
+
+ sBackDistanceSquared = back_dist_factor * gAgentCamera.mDrawDistance;
+ sBackDistanceSquared *= sBackDistanceSquared;
+
+ sBackAngleTanSquared = squared_back_angle;
+}
+
bool LLVOCacheEntry::isRecentlyVisible() const
{
bool vis = LLViewerOctreeEntryData::isRecentlyVisible();
@@ -363,12 +381,10 @@ bool LLVOCacheEntry::isRecentlyVisible() const
}
//combination of projected area and squared distance
- if(!vis && !mParentID && mSceneContrib > 0.0311f) //projection angle > 10 (degree)
+ if(!vis && !mParentID && mSceneContrib > sBackAngleTanSquared)
{
- //squared distance
- const F32 SQUARED_CUT_OFF_DIST = 256.0; //16m
F32 rad = getBinRadius();
- vis = (rad * rad / mSceneContrib < SQUARED_CUT_OFF_DIST);
+ vis = (rad * rad / mSceneContrib < sBackDistanceSquared);
}
return vis;