diff options
Diffstat (limited to 'indra/newview/llvieweroctree.cpp')
-rw-r--r-- | indra/newview/llvieweroctree.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/indra/newview/llvieweroctree.cpp b/indra/newview/llvieweroctree.cpp index ff8f4d2434..88f3c7d6f9 100644 --- a/indra/newview/llvieweroctree.cpp +++ b/indra/newview/llvieweroctree.cpp @@ -1439,7 +1439,8 @@ S32 LLViewerOctreeCull::AABBRegionSphereIntersectObjectExtents(const LLViewerOct } //------------------------------------------ //check if the objects projection large enough -bool LLViewerOctreeCull::checkProjectionArea(const LLVector4a& center, const LLVector4a& size, const LLVector3& shift, F32 pixel_threshold, F32 near_squared_radius) + +bool LLViewerOctreeCull::checkProjectionArea(const LLVector4a& center, const LLVector4a& size, const LLVector3& shift, F32 pixel_threshold, F32 near_radius) { LLVector3 local_orig = mCamera->getOrigin() - shift; LLVector4a origin; @@ -1447,14 +1448,18 @@ bool LLViewerOctreeCull::checkProjectionArea(const LLVector4a& center, const LLV LLVector4a lookAt; lookAt.setSub(center, origin); - F32 squared_dist = lookAt.dot3(lookAt).getF32(); - if(squared_dist < near_squared_radius) + F32 distance = lookAt.getLength3().getF32(); + if(distance <= near_radius) { - return true; //always load closeby objects + return true; //always load close-by objects } + // treat object as if it were near_radius meters closer than it actually was. + // this allows us to get some temporal coherence on visibility...objects that can be reached quickly will tend to be visible + distance -= near_radius; + F32 squared_rad = size.dot3(size).getF32(); - return squared_rad / squared_dist > pixel_threshold; + return squared_rad / distance > pixel_threshold; } //virtual |