summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llvieweroctree.cpp5
-rwxr-xr-xindra/newview/llvocache.cpp16
-rwxr-xr-xindra/newview/llvocache.h10
3 files changed, 12 insertions, 19 deletions
diff --git a/indra/newview/llvieweroctree.cpp b/indra/newview/llvieweroctree.cpp
index aef632e913..88f3c7d6f9 100644
--- a/indra/newview/llvieweroctree.cpp
+++ b/indra/newview/llvieweroctree.cpp
@@ -1440,11 +1440,8 @@ S32 LLViewerOctreeCull::AABBRegionSphereIntersectObjectExtents(const LLViewerOct
//------------------------------------------
//check if the objects projection large enough
-static LLTrace::BlockTimerStatHandle sProjectedAreaCheckTimeStat("Object projected area check", "Culling objects based on projected area");
-
bool LLViewerOctreeCull::checkProjectionArea(const LLVector4a& center, const LLVector4a& size, const LLVector3& shift, F32 pixel_threshold, F32 near_radius)
{
- LL_RECORD_BLOCK_TIME(sProjectedAreaCheckTimeStat);
LLVector3 local_orig = mCamera->getOrigin() - shift;
LLVector4a origin;
origin.load3(local_orig.mV);
@@ -1462,7 +1459,7 @@ bool LLViewerOctreeCull::checkProjectionArea(const LLVector4a& center, const LLV
distance -= near_radius;
F32 squared_rad = size.dot3(size).getF32();
- return squared_rad / (distance * distance) > pixel_threshold;
+ return squared_rad / distance > pixel_threshold;
}
//virtual
diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp
index 956f9a2667..515cc003c0 100755
--- a/indra/newview/llvocache.cpp
+++ b/indra/newview/llvocache.cpp
@@ -433,11 +433,8 @@ bool LLVOCacheEntry::isAnyVisible(const LLVector4a& camera_origin, const LLVecto
return vis;
}
-static LLTrace::BlockTimerStatHandle sSceneContributionCalc("Calculate scene contribution", "Calculates relative importance of object to scene, to control object load from cache");
-
-void LLVOCacheEntry::calcSceneContribution(const LLVector4a& camera_origin, bool needs_update, U32 last_update, F32 dist_threshold)
+void LLVOCacheEntry::calcSceneContribution(const LLVector4a& camera_origin, bool needs_update, U32 last_update, F32 max_dist)
{
- LL_RECORD_BLOCK_TIME(sSceneContributionCalc);
if(!needs_update && getVisible() >= last_update)
{
return; //no need to update
@@ -446,8 +443,9 @@ void LLVOCacheEntry::calcSceneContribution(const LLVector4a& camera_origin, bool
LLVector4a lookAt;
lookAt.setSub(getPositionGroup(), camera_origin);
F32 distance = lookAt.getLength3().getF32();
+ distance -= sNearRadius;
- if(distance <= sNearRadius)
+ if(distance <= 0.f)
{
//nearby objects, set a large number
const F32 LARGE_SCENE_CONTRIBUTION = 1000.f; //a large number to force to load the object.
@@ -455,14 +453,12 @@ void LLVOCacheEntry::calcSceneContribution(const LLVector4a& camera_origin, bool
}
else
{
- distance -= sNearRadius;
-
F32 rad = getBinRadius();
- dist_threshold += rad;
+ max_dist += rad;
- if(distance < dist_threshold)
+ if(distance + sNearRadius < max_dist)
{
- mSceneContrib = (rad * rad) / (distance * distance);
+ mSceneContrib = (rad * rad) / distance;
}
else
{
diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h
index 80268d4e9c..c32b4f8984 100755
--- a/indra/newview/llvocache.h
+++ b/indra/newview/llvocache.h
@@ -158,11 +158,11 @@ protected:
F32 mBSphereRadius; //bounding sphere radius
public:
- static U32 sMinFrameRange;
- static F32 sNearRadius;
- static F32 sRearFarRadius;
- static F32 sFrontPixelThreshold;
- static F32 sRearPixelThreshold;
+ static U32 sMinFrameRange;
+ static F32 sNearRadius;
+ static F32 sRearFarRadius;
+ static F32 sFrontPixelThreshold;
+ static F32 sRearPixelThreshold;
};
class LLVOCacheGroup : public LLOcclusionCullingGroup