Backed out changeset: 27782e83386b

Reverting MAINT-6793
master
AndreyL ProductEngine 2016-11-08 04:44:46 +02:00
parent 1ff67ec512
commit 0e6e04317b
5 changed files with 12 additions and 40 deletions

View File

@ -10273,16 +10273,16 @@
<key>Value</key>
<real>1.0</real>
</map>
<key>RenderRiggedLodCompensation</key>
<key>RenderRiggedFactorMultiplier</key>
<map>
<key>Comment</key>
<string>Affects visibility range of worn rigged meshes to compensate for missing LODs (limited by avatars own visibility)</string>
<string>Affects level of detail for worn rigged meshes</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>6.5</real>
<real>7.5</real>
</map>
<key>RenderWater</key>
<map>

View File

@ -592,7 +592,7 @@ static void settings_to_globals()
LLImageGL::sGlobalUseAnisotropic = gSavedSettings.getBOOL("RenderAnisotropic");
LLImageGL::sCompressTextures = gSavedSettings.getBOOL("RenderCompressTextures");
LLVOVolume::sLODFactor = gSavedSettings.getF32("RenderVolumeLODFactor");
LLVOVolume::sRiggedLODCompensation = llmax(0.25f, gSavedSettings.getF32("RenderRiggedLodCompensation"));
LLVOVolume::sRiggedFactorMultiplier = gSavedSettings.getF32("RenderRiggedFactorMultiplier");
LLVOVolume::sDistanceFactor = 1.f-LLVOVolume::sLODFactor * 0.1f;
LLVolumeImplFlexible::sUpdateFactor = gSavedSettings.getF32("RenderFlexTimeFactor");
LLVOTree::sTreeFactor = gSavedSettings.getF32("RenderTreeLODFactor");

View File

@ -209,7 +209,7 @@ static bool handleVolumeLODChanged(const LLSD& newvalue)
static bool handleRiggedLODChanged(const LLSD& newvalue)
{
LLVOVolume::sRiggedLODCompensation = llmax(0.25f, (F32)newvalue.asReal());
LLVOVolume::sRiggedFactorMultiplier = (F32)newvalue.asReal();
return true;
}
@ -625,7 +625,7 @@ void settings_setup_listeners()
gSavedSettings.getControl("WindLightUseAtmosShaders")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
gSavedSettings.getControl("RenderGammaFull")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
gSavedSettings.getControl("RenderVolumeLODFactor")->getSignal()->connect(boost::bind(&handleVolumeLODChanged, _2));
gSavedSettings.getControl("RenderRiggedLodCompensation")->getSignal()->connect(boost::bind(&handleRiggedLODChanged, _2));
gSavedSettings.getControl("RenderRiggedFactorMultiplier")->getSignal()->connect(boost::bind(&handleRiggedLODChanged, _2));
gSavedSettings.getControl("RenderAvatarLODFactor")->getSignal()->connect(boost::bind(&handleAvatarLODChanged, _2));
gSavedSettings.getControl("RenderAvatarPhysicsLODFactor")->getSignal()->connect(boost::bind(&handleAvatarPhysicsLODChanged, _2));
gSavedSettings.getControl("RenderTerrainLODFactor")->getSignal()->connect(boost::bind(&handleTerrainLODChanged, _2));

View File

@ -80,14 +80,13 @@
const F32 FORCE_SIMPLE_RENDER_AREA = 512.f;
const F32 FORCE_CULL_AREA = 8.f;
static const F32 MINIMUM_RIGGED_RADIUS = 0.05f;
U32 JOINT_COUNT_REQUIRED_FOR_FULLRIG = 20;
BOOL gAnimateTextures = TRUE;
//extern BOOL gHideSelectedObjects;
F32 LLVOVolume::sLODFactor = 1.f;
F32 LLVOVolume::sRiggedLODCompensation = 6.5f;
F32 LLVOVolume::sRiggedFactorMultiplier = 6.f;
F32 LLVOVolume::sLODSlopDistanceFactor = 0.5f; //Changing this to zero, effectively disables the LOD transition slop
F32 LLVOVolume::sDistanceFactor = 1.0f;
S32 LLVOVolume::sNumLODChanges = 0;
@ -1255,39 +1254,12 @@ BOOL LLVOVolume::calcLOD()
}
// Note: when changing, take note that a lot of rigged meshes have only one LOD.
lod_factor *= LLVOVolume::sRiggedFactorMultiplier;
distance = avatar->mDrawable->mDistanceWRTCamera;
F32 avatar_radius = avatar->getBinRadius();
F32 object_radius = 0;
LLDrawable* drawablep = mDrawable.get();
while (!drawablep->isRoot())
{
drawablep = drawablep->getParent();
}
// Mesh can consist of multiple objects that have to be treated as one item or we will
// get strange deformations or partially missing meshes (smallest elements will disappear)
LLSpatialBridge* bridge = drawablep->getSpatialBridge();
if (bridge)
{
const LLVector4a* ext = bridge->getSpatialExtents();
LLVector4a diff;
diff.setSub(ext[1], ext[0]);
object_radius = diff.getLength3().getF32();
}
if (object_radius <= 0)
{
// bridge missing or somehow not updated
const LLVector4a* ext = mDrawable->getSpatialExtents();
LLVector4a diff;
diff.setSub(ext[1], ext[0]);
object_radius = diff.getLength3().getF32();
}
// sRiggedLODCompensation is made to compensate for missing lower lods
radius = object_radius * LLVOVolume::sRiggedLODCompensation;
radius = llclamp(radius, MINIMUM_RIGGED_RADIUS, avatar_radius);
F32 object_radius = getVolume() ? getVolume()->mLODScaleBias.scaledVec(getScale()).length() : getScale().length();
radius = object_radius * LLVOVolume::sRiggedFactorMultiplier;
radius = llmin(radius, avatar_radius);
}
else
{

View File

@ -379,7 +379,7 @@ private:
public:
static F32 sLODSlopDistanceFactor;// Changing this to zero, effectively disables the LOD transition slop
static F32 sLODFactor; // LOD scale factor
static F32 sRiggedLODCompensation; // HACK: worn rigged LODs often have only high lod, so we are bumping them up withing avatar's visibility
static F32 sRiggedFactorMultiplier; // Worn rigged LOD scale factor multiplier
static F32 sDistanceFactor; // LOD distance factor
static LLPointer<LLObjectMediaDataClient> sObjectMediaClient;