diff options
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/app_settings/settings.xml | 33 | ||||
-rwxr-xr-x | indra/newview/llappviewer.cpp | 2 | ||||
-rwxr-xr-x | indra/newview/llviewerobjectlist.cpp | 24 | ||||
-rwxr-xr-x | indra/newview/llviewerregion.cpp | 13 | ||||
-rwxr-xr-x | indra/newview/llvocache.cpp | 44 | ||||
-rwxr-xr-x | indra/newview/llvocache.h | 6 |
6 files changed, 89 insertions, 33 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index b2e3c8b683..93cc605be0 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -721,6 +721,17 @@ <integer>0</integer> </map> + <key>BackDistanceFactor</key> + <map> + <key>Comment</key> + <string>Keep invisible objects in memory which are in the distance range (the factor * draw_distance) to the camera</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>0.125</real> + </map> <key>BackgroundYieldTime</key> <map> <key>Comment</key> @@ -732,6 +743,17 @@ <key>Value</key> <integer>40</integer> </map> + <key>BackProjectionAngleSquared</key> + <map> + <key>Comment</key> + <string>squared tan(object bbox projection angle). that of invisible objects greater than this threshold are kept in memory</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>0.0311</real> + </map> <key>BottomPanelNew</key> <map> <key>Comment</key> @@ -6306,6 +6328,17 @@ <key>Value</key> <integer>64</integer> </map> + <key>NewObjectCreationThrottleDelayTime</key> + <map> + <key>Comment</key> + <string>time in seconds NewObjectCreationThrottle to take effect after the progress screen is lifted</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>2.0</real> + </map> <key>NextOwnerCopy</key> <map> <key>Comment</key> diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 0f155b8ad7..7f37cee8b8 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4030,7 +4030,7 @@ U32 LLAppViewer::getObjectCacheVersion() { // Viewer object cache version, change if object update // format changes. JC - const U32 INDRA_OBJECT_CACHE_VERSION = 15; + const U32 INDRA_OBJECT_CACHE_VERSION = 14; return INDRA_OBJECT_CACHE_VERSION; } diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 4643430c6b..897da7f0b3 100755 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -365,7 +365,16 @@ LLViewerObject* LLViewerObjectList::processObjectUpdateFromCache(LLVOCacheEntry* processUpdateCore(objectp, NULL, 0, OUT_FULL_CACHED, cached_dpp, justCreated, true); objectp->loadFlags(entry->getUpdateFlags()); //just in case, reload update flags from cache. - + + if(entry->getHitCount() > 0) + { + objectp->setLastUpdateType(OUT_FULL_CACHED); + } + else + { + objectp->setLastUpdateType(OUT_FULL_COMPRESSED); //newly cached + objectp->setLastUpdateCached(TRUE); + } recorder.log(0.2f); LLVOAvatar::cullAvatarsByPixelArea(); @@ -467,10 +476,10 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, if(flags & FLAGS_TEMPORARY_ON_REZ) { - compressed_dp.unpackUUID(fullid, "ID"); - compressed_dp.unpackU32(local_id, "LocalID"); - compressed_dp.unpackU8(pcode, "PCode"); - } + compressed_dp.unpackUUID(fullid, "ID"); + compressed_dp.unpackU32(local_id, "LocalID"); + compressed_dp.unpackU8(pcode, "PCode"); + } else //send to object cache { regionp->cacheFullUpdate(compressed_dp, flags); @@ -608,7 +617,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, LL_WARNS() << "Dead object " << objectp->mID << " in UUID map 1!" << LL_ENDL; } - bool bCached = false; + //bool bCached = false; if (compressed) { if (update_type != OUT_TERSE_IMPROVED) // OUT_FULL_COMPRESSED only? @@ -641,8 +650,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, processUpdateCore(objectp, user_data, i, update_type, NULL, justCreated); } recorder.objectUpdateEvent(local_id, update_type, objectp, msg_size); - objectp->setLastUpdateType(update_type); - objectp->setLastUpdateCached(bCached); + objectp->setLastUpdateType(update_type); } recorder.log(0.2f); diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index da01c0406a..9c038d54d5 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1233,6 +1233,7 @@ BOOL LLViewerRegion::idleUpdate(F32 max_update_time) void LLViewerRegion::calcNewObjectCreationThrottle() { static LLCachedControl<S32> new_object_creation_throttle(gSavedSettings,"NewObjectCreationThrottle"); + static LLCachedControl<F32> throttle_delay_time(gSavedSettings,"NewObjectCreationThrottleDelayTime"); static LLFrameTimer timer; // @@ -1243,16 +1244,20 @@ void LLViewerRegion::calcNewObjectCreationThrottle() //>0: valid throttling number // - if(gViewerWindow->getProgressView()->getVisible()) + if(gViewerWindow->getProgressView()->getVisible() && throttle_delay_time > 0.f) { sNewObjectCreationThrottle = -2; //cancel the throttling timer.reset(); } - else if(sNewObjectCreationThrottle < 0) //just recoved from the login/teleport screen + else if(sNewObjectCreationThrottle < -1) //just recoved from the login/teleport screen { - if(new_object_creation_throttle > 0 && timer.getElapsedTimeF32() > 2.0f) //wait for two seconds to reset the throttle + if(timer.getElapsedTimeF32() > throttle_delay_time) //wait for throttle_delay_time to reset the throttle { sNewObjectCreationThrottle = new_object_creation_throttle; //reset + if(sNewObjectCreationThrottle < -1) + { + sNewObjectCreationThrottle = -1; + } } } } @@ -1285,6 +1290,8 @@ F32 LLViewerRegion::killInvisibleObjects(F32 max_time) S32 update_counter = llmin(max_update, mImpl->mActiveSet.size()); LLVOCacheEntry::vocache_entry_set_t::iterator iter = mImpl->mActiveSet.upper_bound(mLastVisitedEntry); + LLVOCacheEntry::updateBackCullingFactors(); + for(; update_counter > 0; --update_counter, ++iter) { if(iter == mImpl->mActiveSet.end()) diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index dc7b907a35..1cfda038a8 100755 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -33,7 +33,10 @@ #include "lldrawable.h" #include "llviewerregion.h" #include "pipeline.h" +#include "llagentcamera.h" +F32 LLVOCacheEntry::sBackDistanceSquared = 0.f; +F32 LLVOCacheEntry::sBackAngleTanSquared = 0.f; BOOL LLVOCachePartition::sNeedsOcclusionCheck = FALSE; LLTrace::MemStatHandle LLVOCachePartition::sMemStat("LLVOCachePartition"); @@ -286,18 +289,6 @@ void LLVOCacheEntry::removeAllChildren() mChildrenList.clear(); } -LLDataPackerBinaryBuffer *LLVOCacheEntry::getDP(U32 crc) -{ - if ( (mCRC != crc) - ||(mDP.getBufferSize() == 0)) - { - //LL_INFOS() << "Not getting cache entry, invalid!" << LL_ENDL; - return NULL; - } - mHitCount++; - return &mDP; -} - LLDataPackerBinaryBuffer *LLVOCacheEntry::getDP() { if (mDP.getBufferSize() == 0) @@ -365,6 +356,21 @@ BOOL LLVOCacheEntry::writeToFile(LLAPRFile* apr_file) const return success ; } +//static +void LLVOCacheEntry::updateBackCullingFactors() +{ + //distance to keep objects = back_dist_factor * draw_distance + static LLCachedControl<F32> back_dist_factor(gSavedSettings,"BackDistanceFactor"); + + //squared tan(projection angle of the bbox), default is 10 (degree) + static LLCachedControl<F32> squared_back_angle(gSavedSettings,"BackProjectionAngleSquared"); + + sBackDistanceSquared = back_dist_factor * gAgentCamera.mDrawDistance; + sBackDistanceSquared *= sBackDistanceSquared; + + sBackAngleTanSquared = squared_back_angle; +} + bool LLVOCacheEntry::isRecentlyVisible() const { bool vis = LLViewerOctreeEntryData::isRecentlyVisible(); @@ -375,12 +381,10 @@ bool LLVOCacheEntry::isRecentlyVisible() const } //combination of projected area and squared distance - if(!vis && !mParentID && mSceneContrib > 0.0311f) //projection angle > 10 (degree) + if(!vis && !mParentID && mSceneContrib > sBackAngleTanSquared) { - //squared distance - const F32 SQUARED_CUT_OFF_DIST = 256.0; //16m F32 rad = getBinRadius(); - vis = (rad * rad / mSceneContrib < SQUARED_CUT_OFF_DIST); + vis = (rad * rad / mSceneContrib < sBackDistanceSquared); } return vis; @@ -638,10 +642,10 @@ S32 LLVOCachePartition::cull(LLCamera &camera, bool do_occlusion) } mCulledTime[LLViewerCamera::sCurCameraID] = LLViewerOctreeEntryData::getCurrentFrame(); - //if(!mDirty && !mCullHistory[LLViewerCamera::sCurCameraID] && LLViewerRegion::isViewerCameraStatic()) - //{ - // return 0; //nothing changed, skip culling - //} + if(!mDirty && !mCullHistory[LLViewerCamera::sCurCameraID] && LLViewerRegion::isViewerCameraStatic()) + { + return 0; //nothing changed, skip culling + } ((LLviewerOctreeGroup*)mOctree->getListener(0))->rebound(); mCullHistory[LLViewerCamera::sCurCameraID] <<= 1; diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h index 4eca083445..52b25b7f91 100755 --- a/indra/newview/llvocache.h +++ b/indra/newview/llvocache.h @@ -97,7 +97,6 @@ public: void dump() const; BOOL writeToFile(LLAPRFile* apr_file) const; - LLDataPackerBinaryBuffer *getDP(U32 crc); LLDataPackerBinaryBuffer *getDP(); void recordHit(); void recordDupe() { mDupeCount++; } @@ -124,6 +123,8 @@ public: void setUpdateFlags(U32 flags) {mUpdateFlags = flags;} U32 getUpdateFlags() const {return mUpdateFlags;} + static void updateBackCullingFactors(); + private: static U32 getInvisibleObjectsLiveTime(); @@ -152,6 +153,9 @@ protected: std::vector<LLVOCacheEntry*> mChildrenList; //children entries in a linked set. BOOL mTouched; //if set, this entry is valid, otherwise it is invalid. + + static F32 sBackDistanceSquared; + static F32 sBackAngleTanSquared; }; class LLVOCachePartition : public LLViewerOctreePartition, public LLTrace::MemTrackable<LLVOCachePartition> |