summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerregion.cpp
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2013-11-13 09:40:48 -0700
committerXiaohong Bao <bao@lindenlab.com>2013-11-13 09:40:48 -0700
commit58ee2a30ce5fb83186392693c7b014aa667e02cf (patch)
treeb1fad22f6c5dace07e0cc721f87cef796b194558 /indra/newview/llviewerregion.cpp
parent1983f52ce5211c02a55f5cabd86962eea3a22084 (diff)
more fix for SH-4607: Create new object cache tuning parameters
Diffstat (limited to 'indra/newview/llviewerregion.cpp')
-rwxr-xr-xindra/newview/llviewerregion.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index afc00764b8..06f9af8751 100755
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1131,6 +1131,8 @@ void LLViewerRegion::updateVisibleEntries(F32 max_time)
//
//object projected area threshold
F32 projection_threshold = LLVOCacheEntry::getSquaredPixelThreshold(mImpl->mVOCachePartition->isFrontCull());
+ F32 dist_threshold = mImpl->mVOCachePartition->isFrontCull() ? gAgentCamera.mDrawDistance : LLVOCacheEntry::sRearFarRadius;
+
std::set< LLPointer<LLViewerOctreeGroup> >::iterator group_iter = mImpl->mVisibleGroups.begin();
for(; group_iter != mImpl->mVisibleGroups.end(); ++group_iter)
{
@@ -1153,7 +1155,7 @@ void LLViewerRegion::updateVisibleEntries(F32 max_time)
continue;
}
- vo_entry->calcSceneContribution(local_origin, needs_update, last_update);
+ vo_entry->calcSceneContribution(local_origin, needs_update, last_update, dist_threshold);
if(vo_entry->getSceneContribution() > projection_threshold)
{
mImpl->mWaitingList.insert(vo_entry);
@@ -1389,10 +1391,9 @@ void LLViewerRegion::killInvisibleObjects(F32 max_time)
LLTimer update_timer;
LLVector4a camera_origin;
- camera_origin.load3(LLViewerCamera::getInstance()->getOrigin().mV);
- F32 squared_back_threshold = LLVOCacheEntry::sRearFarRadius;
- squared_back_threshold *= squared_back_threshold;
-
+ camera_origin.load3(LLViewerCamera::getInstance()->getOrigin().mV);
+ F32 back_threshold = LLVOCacheEntry::sRearFarRadius;
+
bool unstable = sNewObjectCreationThrottle < 0;
size_t max_update = unstable ? mImpl->mActiveSet.size() : 64;
if(!mInvisibilityCheckHistory && isViewerCameraStatic())
@@ -1411,8 +1412,12 @@ void LLViewerRegion::killInvisibleObjects(F32 max_time)
{
iter = mImpl->mActiveSet.begin();
}
+ if((*iter)->getParentID() > 0)
+ {
+ continue; //skip child objects, they are removed with their parent.
+ }
- if(!(*iter)->isAnyVisible(camera_origin, squared_back_threshold) && (unstable || (*iter)->mLastCameraUpdated < sLastCameraUpdated))
+ if(!(*iter)->isAnyVisible(camera_origin, back_threshold) && (unstable || (*iter)->mLastCameraUpdated < sLastCameraUpdated))
{
killObject((*iter), delete_list);
}