diff options
| author | Richard Linden <none@none> | 2013-12-03 15:52:36 -0800 |
|---|---|---|
| committer | Richard Linden <none@none> | 2013-12-03 15:52:36 -0800 |
| commit | 3cb64c5038b7cde8bd44ec3a029d477e415085ee (patch) | |
| tree | 38085823779454f6cd487e8dc5e4dd16dd8dd670 /indra/newview/llvocache.cpp | |
| parent | 29476d29c4c78a6417c45090bdc6ea14c8251d73 (diff) | |
SH-4606 FIX Interesting: Small objects do not load until they are very close.
changed culling to use inverse distance to calculate solid angle, not distance squared
Diffstat (limited to 'indra/newview/llvocache.cpp')
| -rwxr-xr-x | indra/newview/llvocache.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
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 { |
