diff options
author | Xiaohong Bao <bao@lindenlab.com> | 2013-10-18 16:15:05 -0600 |
---|---|---|
committer | Xiaohong Bao <bao@lindenlab.com> | 2013-10-18 16:15:05 -0600 |
commit | fc45b59a977881a4e37619cb0220790d5ad4c814 (patch) | |
tree | aa221532d4fe021f7ab08cb3d39520c37a669a36 /indra/newview/llviewerregion.cpp | |
parent | d2cf7ba42931bb7ecf637fbf4ff25c7837c3296f (diff) | |
parent | 7bfacf8ca6c7bfdd9b11a2036a914c8f47058a61 (diff) |
Automated merge with http://bitbucket.org/lindenlab/viewer-interesting
Diffstat (limited to 'indra/newview/llviewerregion.cpp')
-rwxr-xr-x | indra/newview/llviewerregion.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 0ad4402dcc..e73b4fb62c 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1157,25 +1157,40 @@ F32 LLViewerRegion::updateVisibleEntries(F32 max_time) F32 LLViewerRegion::createVisibleObjects(F32 max_time) { + static LLCachedControl<F32> projection_area_cutoff(gSavedSettings,"ObjectProjectionAreaCutOFF"); + if(mDead) { return max_time; } if(mImpl->mWaitingList.empty()) { + mImpl->mVOCachePartition->setCullHistory(FALSE); return max_time; } + //object projected area threshold + F32 pixel_meter_ratio = LLViewerCamera::getInstance()->getPixelMeterRatio(); + F32 projection_threshold = pixel_meter_ratio > 0.f ? projection_area_cutoff / pixel_meter_ratio : 0.f; + projection_threshold *= projection_threshold; + S32 throttle = sNewObjectCreationThrottle; + BOOL has_new_obj = FALSE; LLTimer update_timer; for(LLVOCacheEntry::vocache_entry_priority_list_t::iterator iter = mImpl->mWaitingList.begin(); iter != mImpl->mWaitingList.end(); ++iter) { LLVOCacheEntry* vo_entry = *iter; + if(vo_entry->getSceneContribution() < projection_threshold) + { + break; + } + if(vo_entry->getState() < LLVOCacheEntry::WAITING) { addNewObject(vo_entry); + has_new_obj = TRUE; if(throttle > 0 && !(--throttle) && update_timer.getElapsedTimeF32() > max_time) { break; @@ -1183,6 +1198,8 @@ F32 LLViewerRegion::createVisibleObjects(F32 max_time) } } + mImpl->mVOCachePartition->setCullHistory(has_new_obj); + return max_time - update_timer.getElapsedTimeF32(); } |