diff options
| -rwxr-xr-x | indra/newview/llspatialpartition.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/llvieweroctree.cpp | 8 | ||||
| -rw-r--r-- | indra/newview/llvieweroctree.h | 4 | ||||
| -rwxr-xr-x | indra/newview/llvocache.cpp | 6 | 
4 files changed, 18 insertions, 2 deletions
| diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 0fbe1578cf..50576b7a2c 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 e8eba43242..56f10aba71 100644 --- a/indra/newview/llvieweroctree.cpp +++ b/indra/newview/llvieweroctree.cpp @@ -435,6 +435,7 @@ LLviewerOctreeGroup::~LLviewerOctreeGroup()  LLviewerOctreeGroup::LLviewerOctreeGroup(OctreeNode* node) :  	mOctreeNode(node), +	mAnyVisible(0),  	mState(CLEAN)  {  	LLVector4a tmp; @@ -735,6 +736,7 @@ BOOL LLviewerOctreeGroup::isRecentlyVisible() const  void LLviewerOctreeGroup::setVisible()  {  	mVisible[LLViewerCamera::sCurCameraID] = LLViewerOctreeEntryData::getCurrentFrame(); +	mAnyVisible = LLViewerOctreeEntryData::getCurrentFrame();  }  void LLviewerOctreeGroup::checkStates() @@ -871,6 +873,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 174af5e22f..90870baaea 100644 --- a/indra/newview/llvieweroctree.h +++ b/indra/newview/llvieweroctree.h @@ -233,6 +233,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; } @@ -278,7 +279,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); @@ -330,6 +331,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/llvocache.cpp b/indra/newview/llvocache.cpp index ada412be8c..71d5a92df3 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)   	{ | 
