diff options
-rwxr-xr-x | indra/newview/app_settings/settings.xml | 11 | ||||
-rwxr-xr-x | indra/newview/llvocache.cpp | 11 | ||||
-rwxr-xr-x | 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 305aaf2a3a..14e96a06cc 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 20e69cbea9..ada412be8c 100755 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -640,11 +640,11 @@ private: 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 @@ private: 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 16ed05dc94..b58bb3d499 100755 --- a/indra/newview/llvocache.h +++ b/indra/newview/llvocache.h @@ -186,7 +186,7 @@ public: 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; |