diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 305aaf2a3ae2a9d18b4fa55e4ad11f50382e4abe..14e96a06cc554adccac0ed0dfdb7c5e266ae7fc2 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 20e69cbea9fea61be52494d3bc2ff481f415a7a4..ada412be8cb082a6a1d9aa7ac68610f730b11fe3 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 16ed05dc94382c92190c1f2ad44bd27560322690..b58bb3d49915185eac1c0ee0e8bff3fa508ea915 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;