From 9ae025f8ee8688b25678a243ba19f1398de08060 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao <bao@lindenlab.com> Date: Thu, 3 Oct 2013 16:21:54 -0600 Subject: [PATCH] add a debug setting: "BackShpereCullingRadius" --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llvocache.cpp | 11 ++++++----- indra/newview/llvocache.h | 2 +- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 305aaf2a3ae..14e96a06cc5 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -765,6 +765,17 @@ <key>Value</key> <real>0.0311</real> </map> + <key>BackShpereCullingRadius</key> + <map> + <key>Comment</key> + <string>Radius of back sphere in meters, objects behind camera but within this radius are loaded for rendering</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>20.0</real> + </map> <key>BottomPanelNew</key> <map> <key>Comment</key> diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index 20e69cbea9f..ada412be8cb 100755 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -640,11 +640,11 @@ class LLVOCacheOctreeCull : public LLViewerOctreeCull class LLVOCacheOctreeBackCull : public LLViewerOctreeCull { public: - LLVOCacheOctreeBackCull(LLCamera* camera, const LLVector3& shift, LLViewerRegion* regionp) + LLVOCacheOctreeBackCull(LLCamera* camera, const LLVector3& shift, LLViewerRegion* regionp, F32 back_sphere_radius) : LLViewerOctreeCull(camera), mRegionp(regionp) { mLocalShift = shift; - mSphereRadius = 20.f; //20m + mSphereRadius = back_sphere_radius; } virtual S32 frustumCheck(const LLviewerOctreeGroup* group) @@ -678,7 +678,7 @@ class LLVOCacheOctreeBackCull : public LLViewerOctreeCull LLVector3 mLocalShift; //shift vector from agent space to local region space. }; -void LLVOCachePartition::selectBackObjects(LLCamera &camera) +void LLVOCachePartition::selectBackObjects(LLCamera &camera, F32 back_sphere_radius) { if(LLViewerCamera::sCurCameraID != LLViewerCamera::CAMERA_WORLD) { @@ -699,7 +699,7 @@ void LLVOCachePartition::selectBackObjects(LLCamera &camera) //localize the camera LLVector3 region_agent = mRegionp->getOriginAgent(); - LLVOCacheOctreeBackCull culler(&camera, region_agent, mRegionp); + LLVOCacheOctreeBackCull culler(&camera, region_agent, mRegionp, back_sphere_radius); culler.traverse(mOctree); mBackSlectionEnabled--; @@ -714,6 +714,7 @@ void LLVOCachePartition::selectBackObjects(LLCamera &camera) S32 LLVOCachePartition::cull(LLCamera &camera, bool do_occlusion) { static LLCachedControl<bool> use_object_cache_occlusion(gSavedSettings,"UseObjectCacheOcclusion"); + static LLCachedControl<F32> back_sphere_radius(gSavedSettings,"BackShpereCullingRadius"); if(!LLViewerRegion::sVOCacheCullingEnabled) { @@ -745,7 +746,7 @@ S32 LLVOCachePartition::cull(LLCamera &camera, bool do_occlusion) } if(LLViewerOctreeEntryData::getCurrentFrame() % seed != mIdleHash) { - selectBackObjects(camera);//process back objects selection + selectBackObjects(camera, back_sphere_radius);//process back objects selection return 0; //nothing changed, reduce frequency of culling } } diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h index 16ed05dc943..b58bb3d4991 100755 --- a/indra/newview/llvocache.h +++ b/indra/newview/llvocache.h @@ -186,7 +186,7 @@ class LLVOCachePartition : public LLViewerOctreePartition, public LLTrace::MemTr void removeOccluder(LLVOCacheGroup* group); private: - void selectBackObjects(LLCamera &camera); //select objects behind camera. + void selectBackObjects(LLCamera &camera, F32 back_sphere_radius); //select objects behind camera. public: static BOOL sNeedsOcclusionCheck; -- GitLab