From 60c0c0e0e4b504ae4e1a701265c1134220e7a8a1 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 4 Jul 2016 19:55:54 +0300 Subject: MAINT-6259 rigged items' LOD should be size dependent, not only avatar dependent --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llappviewer.cpp | 1 + indra/newview/llviewercontrol.cpp | 7 +++++++ indra/newview/llvovolume.cpp | 6 +++++- indra/newview/llvovolume.h | 1 + 5 files changed, 25 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 6106dde734..ae900c3ecd 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10218,6 +10218,17 @@ Value 1.0 + RenderRiggedLODFactor + + Comment + Controls level of detail of worn rigged meshes (multiplier for current screen area when calculated level of detail) + Persist + 1 + Type + F32 + Value + 2.5 + RenderWater Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index acbcb4f8b7..8406f09114 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -587,6 +587,7 @@ static void settings_to_globals() LLImageGL::sGlobalUseAnisotropic = gSavedSettings.getBOOL("RenderAnisotropic"); LLImageGL::sCompressTextures = gSavedSettings.getBOOL("RenderCompressTextures"); LLVOVolume::sLODFactor = gSavedSettings.getF32("RenderVolumeLODFactor"); + LLVOVolume::sRiggedLODFactor = gSavedSettings.getF32("RenderRiggedLODFactor"); LLVOVolume::sDistanceFactor = 1.f-LLVOVolume::sLODFactor * 0.1f; LLVolumeImplFlexible::sUpdateFactor = gSavedSettings.getF32("RenderFlexTimeFactor"); LLVOTree::sTreeFactor = gSavedSettings.getF32("RenderTreeLODFactor"); diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 16f40fb747..abb92476d6 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -207,6 +207,12 @@ static bool handleVolumeLODChanged(const LLSD& newvalue) return true; } +static bool handleRiggedLODChanged(const LLSD& newvalue) +{ + LLVOVolume::sRiggedLODFactor = (F32)newvalue.asReal(); + return true; +} + static bool handleAvatarLODChanged(const LLSD& newvalue) { LLVOAvatar::sLODFactor = (F32) newvalue.asReal(); @@ -619,6 +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("RenderRiggedLODFactor")->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)); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 8f0b233f01..55d65b8a09 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -86,6 +86,7 @@ BOOL gAnimateTextures = TRUE; //extern BOOL gHideSelectedObjects; F32 LLVOVolume::sLODFactor = 1.f; +F32 LLVOVolume::sRiggedLODFactor = 2.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; @@ -1252,7 +1253,10 @@ BOOL LLVOVolume::calcLOD() } distance = avatar->mDrawable->mDistanceWRTCamera; - radius = avatar->getBinRadius(); + F32 avatar_radius = avatar->getBinRadius(); + F32 object_radius = getVolume() ? getVolume()->mLODScaleBias.scaledVec(getScale()).length() : getScale().length(); + radius = object_radius * LLVOVolume::sRiggedLODFactor; + radius = llmin(radius, avatar_radius); } else { diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index a331908320..b63d76d132 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -379,6 +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 sRiggedLODFactor; // Worn rigged LOD scale factor static F32 sDistanceFactor; // LOD distance factor static LLPointer sObjectMediaClient; -- cgit v1.2.3