add a debug setting: "BackShpereCullingRadius"

master
Xiaohong Bao 2013-10-03 16:21:54 -06:00
parent c2521e41d7
commit 9ae025f8ee
3 changed files with 18 additions and 6 deletions

View File

@ -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>

View File

@ -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
}
}

View File

@ -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;