Fall in line with LL octree code.
This commit is contained in:
@@ -12628,6 +12628,18 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<integer>128</integer>
|
||||
</map>
|
||||
|
||||
<key>OctreeMinimumNodeSize</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Minimum size of any octree node</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>F32</string>
|
||||
<key>Value</key>
|
||||
<real>0.01</real>
|
||||
</map>
|
||||
|
||||
<key>OctreeReserveNodeCapacity</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
||||
@@ -70,6 +70,7 @@ static U32 sZombieGroups = 0;
|
||||
U32 LLSpatialGroup::sNodeCount = 0;
|
||||
|
||||
U32 gOctreeMaxCapacity;
|
||||
float gOctreeMinSize;
|
||||
U32 gOctreeReserveCapacity;
|
||||
|
||||
BOOL LLSpatialGroup::sNoDelete = FALSE;
|
||||
@@ -1623,10 +1624,10 @@ void renderOctree(LLSpatialGroup* group)
|
||||
gGL.diffuseColor4fv(col.mV);
|
||||
LLVector4a fudge;
|
||||
fudge.splat(0.001f);
|
||||
const LLVector4a* bounds = group->getObjectBounds();
|
||||
LLVector4a size = bounds[1];
|
||||
size.mul(1.01f);
|
||||
size.add(fudge);
|
||||
//const LLVector4a* bounds = group->getObjectBounds();
|
||||
//LLVector4a size = bounds[1];
|
||||
//size.mul(1.01f);
|
||||
//size.add(fudge);*/
|
||||
|
||||
//{
|
||||
// LLGLDepthTest depth(GL_TRUE, GL_FALSE);
|
||||
|
||||
@@ -454,6 +454,7 @@ static bool handleRepartition(const LLSD&)
|
||||
if (gPipeline.isInit())
|
||||
{
|
||||
gOctreeMaxCapacity = gSavedSettings.getU32("OctreeMaxNodeCapacity");
|
||||
gOctreeMinSize = gSavedSettings.getF32("OctreeMinimumNodeSize");
|
||||
gOctreeReserveCapacity = llmin(gSavedSettings.getU32("OctreeReserveNodeCapacity"),U32(512));
|
||||
gObjectList.repartitionObjects();
|
||||
}
|
||||
@@ -692,6 +693,7 @@ void settings_setup_listeners()
|
||||
gSavedSettings.getControl("OctreeStaticObjectSizeFactor")->getSignal()->connect(boost::bind(&handleRepartition, _2));
|
||||
gSavedSettings.getControl("OctreeDistanceFactor")->getSignal()->connect(boost::bind(&handleRepartition, _2));
|
||||
gSavedSettings.getControl("OctreeMaxNodeCapacity")->getSignal()->connect(boost::bind(&handleRepartition, _2));
|
||||
gSavedSettings.getControl("OctreeMinimumNodeSize")->getSignal()->connect(boost::bind(&handleRepartition, _2));
|
||||
gSavedSettings.getControl("OctreeReserveNodeCapacity")->getSignal()->connect(boost::bind(&handleRepartition, _2));
|
||||
gSavedSettings.getControl("OctreeAlphaDistanceFactor")->getSignal()->connect(boost::bind(&handleRepartition, _2));
|
||||
gSavedSettings.getControl("OctreeAttachmentSizeFactor")->getSignal()->connect(boost::bind(&handleRepartition, _2));
|
||||
|
||||
@@ -1033,7 +1033,7 @@ BOOL LLOcclusionCullingGroup::earlyFail(LLCamera* camera, const LLVector4a* boun
|
||||
LLVector4a fudge(vel*2.f);
|
||||
|
||||
const LLVector4a& c = bounds[0];
|
||||
static LLVector4a r;
|
||||
LLVector4a r;
|
||||
r.setAdd(bounds[1], fudge);
|
||||
|
||||
/*if (r.magVecSquared() > 1024.0*1024.0)
|
||||
@@ -1242,6 +1242,11 @@ void LLOcclusionCullingGroup::doOcclusion(LLCamera* camera, const LLVector4a* sh
|
||||
//static LLVector4a fudge(SG_OCCLUSION_FUDGE);
|
||||
static LLCachedControl<F32> vel("SHOcclusionFudge",SG_OCCLUSION_FUDGE);
|
||||
LLVector4a fudge(SG_OCCLUSION_FUDGE);
|
||||
if (LLDrawPool::POOL_WATER == mSpatialPartition->mDrawableType)
|
||||
{
|
||||
fudge.getF32ptr()[2] = 1.f;
|
||||
}
|
||||
|
||||
static LLVector4a fudged_bounds;
|
||||
fudged_bounds.setAdd(fudge, bounds[1]);
|
||||
shader->uniform3fv(LLShaderMgr::BOX_SIZE, 1, fudged_bounds.getF32ptr());
|
||||
|
||||
@@ -958,6 +958,7 @@ void LLPipeline::refreshCachedSettings()
|
||||
LLVOAvatar::sMaxVisible = (U32)gSavedSettings.getS32("RenderAvatarMaxVisible");
|
||||
//LLPipeline::sDelayVBUpdate = gSavedSettings.getBOOL("RenderDelayVBUpdate");
|
||||
gOctreeMaxCapacity = gSavedSettings.getU32("OctreeMaxNodeCapacity");
|
||||
gOctreeMinSize = gSavedSettings.getF32("OctreeMinimumNodeSize");
|
||||
gOctreeReserveCapacity = llmin(gSavedSettings.getU32("OctreeReserveNodeCapacity"), U32(512));
|
||||
LLPipeline::sDynamicLOD = gSavedSettings.getBOOL("RenderDynamicLOD");
|
||||
LLPipeline::sRenderBump = gSavedSettings.getBOOL("RenderObjectBump");
|
||||
|
||||
Reference in New Issue
Block a user