summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/llspatialpartition.cpp2
-rw-r--r--indra/newview/llvieweroctree.cpp8
-rw-r--r--indra/newview/llvieweroctree.h4
-rwxr-xr-xindra/newview/llviewerregion.cpp12
-rwxr-xr-xindra/newview/llviewerregion.h3
-rwxr-xr-xindra/newview/llvocache.cpp26
6 files changed, 46 insertions, 9 deletions
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 045fcccad7..bbbc340532 100755
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -1105,7 +1105,7 @@ public:
{
LLSpatialGroup* group = (LLSpatialGroup*)base_group;
if (group->needsUpdate() ||
- group->mVisible[LLViewerCamera::sCurCameraID] < LLDrawable::getCurrentFrame() - 1)
+ group->getVisible(LLViewerCamera::sCurCameraID) < LLDrawable::getCurrentFrame() - 1)
{
group->doOcclusion(mCamera);
}
diff --git a/indra/newview/llvieweroctree.cpp b/indra/newview/llvieweroctree.cpp
index 5bd0a95387..ce8eef7d86 100644
--- a/indra/newview/llvieweroctree.cpp
+++ b/indra/newview/llvieweroctree.cpp
@@ -437,6 +437,7 @@ LLViewerOctreeGroup::~LLViewerOctreeGroup()
LLViewerOctreeGroup::LLViewerOctreeGroup(OctreeNode* node)
: LLTrace::MemTrackable<LLViewerOctreeGroup, 16>("LLViewerOctreeGroup"),
mOctreeNode(node),
+ mAnyVisible(0),
mState(CLEAN)
{
LLVector4a tmp;
@@ -737,6 +738,7 @@ BOOL LLViewerOctreeGroup::isRecentlyVisible() const
void LLViewerOctreeGroup::setVisible()
{
mVisible[LLViewerCamera::sCurCameraID] = LLViewerOctreeEntryData::getCurrentFrame();
+ mAnyVisible = LLViewerOctreeEntryData::getCurrentFrame();
}
void LLViewerOctreeGroup::checkStates()
@@ -873,6 +875,12 @@ BOOL LLOcclusionCullingGroup::isRecentlyVisible() const
return (LLDrawable::getCurrentFrame() - mVisible[LLViewerCamera::sCurCameraID]) < MIN_VIS_FRAME_RANGE ;
}
+BOOL LLOcclusionCullingGroup::isAnyRecentlyVisible() const
+{
+ const S32 MIN_VIS_FRAME_RANGE = 2;
+ return (LLDrawable::getCurrentFrame() - mAnyVisible) < MIN_VIS_FRAME_RANGE ;
+}
+
//virtual
void LLOcclusionCullingGroup::handleChildAddition(const OctreeNode* parent, OctreeNode* child)
{
diff --git a/indra/newview/llvieweroctree.h b/indra/newview/llvieweroctree.h
index 1eaa1b931e..e673bb6349 100644
--- a/indra/newview/llvieweroctree.h
+++ b/indra/newview/llvieweroctree.h
@@ -215,6 +215,7 @@ public:
void setVisible();
BOOL isVisible() const;
virtual BOOL isRecentlyVisible() const;
+ S32 getVisible(LLViewerCamera::eCameraID id) const {return mVisible[id];}
bool isEmpty() const { return mOctreeNode->isEmpty(); }
U32 getState() {return mState; }
@@ -260,7 +261,7 @@ protected:
LL_ALIGN_16(LLVector4a mExtents[2]); // extents (min, max) of this node and all its children
LL_ALIGN_16(LLVector4a mObjectExtents[2]); // extents (min, max) of objects in this node
-public:
+ S32 mAnyVisible; //latest visible to any camera
S32 mVisible[LLViewerCamera::NUM_CAMERAS];
};//LL_ALIGN_POSTFIX(16);
@@ -312,6 +313,7 @@ public:
//virtual
BOOL isRecentlyVisible() const;
LLViewerOctreePartition* getSpatialPartition()const {return mSpatialPartition;}
+ BOOL isAnyRecentlyVisible() const;
static U32 getNewOcclusionQueryObjectName();
static void releaseOcclusionQueryObjectName(U32 name);
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 4b4de583d8..8a8d1b1922 100755
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -377,7 +377,8 @@ LLViewerRegion::LLViewerRegion(const U64 &handle,
mPacketsReceived(0.f),
mDead(FALSE),
mLastVisitedEntry(NULL),
- mInvisibilityCheckHistory(-1)
+ mInvisibilityCheckHistory(-1),
+ mPaused(FALSE)
{
mWidth = region_width_meters;
mImpl->mOriginGlobal = from_region_handle(handle);
@@ -1185,6 +1186,7 @@ void LLViewerRegion::clearCachedVisibleObjects()
//reset all occluders
mImpl->mVOCachePartition->resetOccluders();
+ mPaused = TRUE;
//clean visible entries
for(LLVOCacheEntry::vocache_entry_set_t::iterator iter = mImpl->mVisibleEntries.begin(); iter != mImpl->mVisibleEntries.end();)
@@ -1257,9 +1259,13 @@ BOOL LLViewerRegion::idleUpdate(F32 max_update_time)
{
return did_update;
}
-
+ if(mPaused)
+ {
+ mPaused = FALSE; //unpause.
+ }
+
//reset all occluders
- mImpl->mVOCachePartition->resetOccluders();
+ mImpl->mVOCachePartition->resetOccluders();
max_update_time -= update_timer.getElapsedTimeF32();
diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h
index 4e2252b75b..ec61364a91 100755
--- a/indra/newview/llviewerregion.h
+++ b/indra/newview/llviewerregion.h
@@ -373,6 +373,8 @@ public:
void removeFromCreatedList(U32 local_id);
void addToCreatedList(U32 local_id);
+ BOOL isPaused() const {return mPaused;}
+
private:
void addToVOCacheTree(LLVOCacheEntry* entry);
LLViewerObject* addNewObject(LLVOCacheEntry* entry);
@@ -482,6 +484,7 @@ private:
BOOL mCapabilitiesReceived;
BOOL mReleaseNotesRequested;
BOOL mDead; //if true, this region is in the process of deleting.
+ BOOL mPaused; //pause processing the objects in the region
typedef std::map<U32, std::vector<U32> > orphan_list_t;
orphan_list_t mOrphanMap;
diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp
index 3f01ffa3cd..0466dea39d 100755
--- a/indra/newview/llvocache.cpp
+++ b/indra/newview/llvocache.cpp
@@ -361,6 +361,12 @@ bool LLVOCacheEntry::isRecentlyVisible() const
{
bool vis = LLViewerOctreeEntryData::isRecentlyVisible();
+ if(!vis && getGroup())
+ {
+ //recently visible to any camera?
+ vis = ((LLOcclusionCullingGroup*)getGroup())->isAnyRecentlyVisible();
+ }
+
//combination of projected area and squared distance
if(!vis && !mParentID && mSceneContrib > sBackAngleTanSquared)
{
@@ -475,9 +481,13 @@ void LLVOCacheEntry::updateParentBoundingInfo(const LLVOCacheEntry* child)
//-------------------------------------------------------------------
LLVOCacheGroup::~LLVOCacheGroup()
{
- if(mOcclusionState[0] & ACTIVE_OCCLUSION)
+ for(S32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++)
{
- ((LLVOCachePartition*)mSpatialPartition)->removeOccluder(this);
+ if(mOcclusionState[i] & ACTIVE_OCCLUSION)
+ {
+ ((LLVOCachePartition*)mSpatialPartition)->removeOccluder(this);
+ break;
+ }
}
}
@@ -720,6 +730,10 @@ S32 LLVOCachePartition::cull(LLCamera &camera, bool do_occlusion)
{
return 0;
}
+ if(mRegionp->isPaused())
+ {
+ return 0;
+ }
((LLViewerOctreeGroup*)mOctree->getListener(0))->rebound();
@@ -785,7 +799,7 @@ void LLVOCachePartition::addOccluders(LLViewerOctreeGroup* gp)
if(!group->isOcclusionState(LLOcclusionCullingGroup::ACTIVE_OCCLUSION))
{
- group->setOcclusionState(LLOcclusionCullingGroup::ACTIVE_OCCLUSION, LLOcclusionCullingGroup::STATE_MODE_ALL_CAMERAS);
+ group->setOcclusionState(LLOcclusionCullingGroup::ACTIVE_OCCLUSION);
mOccludedGroups.insert(group);
}
}
@@ -802,7 +816,11 @@ void LLVOCachePartition::processOccluders(LLCamera* camera)
for(std::set<LLVOCacheGroup*>::iterator iter = mOccludedGroups.begin(); iter != mOccludedGroups.end(); ++iter)
{
LLVOCacheGroup* group = *iter;
- group->doOcclusion(camera, &shift);
+ if(group->isOcclusionState(LLOcclusionCullingGroup::ACTIVE_OCCLUSION))
+ {
+ group->doOcclusion(camera, &shift);
+ group->clearOcclusionState(LLOcclusionCullingGroup::ACTIVE_OCCLUSION);
+ }
}
}