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/llvovolume.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvovolume.cpp') 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 { -- cgit v1.3 From b652774324e0cdf01cf7a75a45abb05391654809 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 18 Jul 2016 17:28:02 +0300 Subject: Backed out changeset: a1a0a055e892 --- 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, 1 insertion(+), 25 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index ae900c3ecd..6106dde734 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10218,17 +10218,6 @@ 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 8406f09114..acbcb4f8b7 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -587,7 +587,6 @@ 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 abb92476d6..16f40fb747 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -207,12 +207,6 @@ 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(); @@ -625,7 +619,6 @@ 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 177ad9ab3d..486f6fae61 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -86,7 +86,6 @@ 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; @@ -1253,10 +1252,7 @@ BOOL LLVOVolume::calcLOD() } distance = avatar->mDrawable->mDistanceWRTCamera; - 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); + radius = avatar->getBinRadius(); } else { diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index b63d76d132..a331908320 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -379,7 +379,6 @@ 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.3 From bb4a958a00f73068fa6e531b3c38738db658d798 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Thu, 14 Jul 2016 17:10:59 +0300 Subject: MAINT-6125 Mesh avatar deforms constantly FIXED --- indra/newview/llvieweroctree.cpp | 2 +- indra/newview/llvovolume.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvieweroctree.cpp b/indra/newview/llvieweroctree.cpp index 023f1b92ba..86591ff4df 100644 --- a/indra/newview/llvieweroctree.cpp +++ b/indra/newview/llvieweroctree.cpp @@ -465,7 +465,7 @@ LLViewerOctreeGroup::LLViewerOctreeGroup(OctreeNode* node) { LLVector4a tmp; tmp.splat(0.f); - mExtents[0] = mExtents[1] = mObjectBounds[0] = mObjectBounds[0] = mObjectBounds[1] = + mExtents[0] = mExtents[1] = mObjectBounds[0] = mObjectBounds[1] = mObjectExtents[0] = mObjectExtents[1] = tmp; mBounds[0] = node->getCenter(); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 8f0b233f01..fea2235175 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1753,7 +1753,10 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable) dirtySpatialGroup(drawable->isState(LLDrawable::IN_REBUILD_Q1)); compiled = TRUE; lodOrSculptChanged(drawable, compiled); - genBBoxes(FALSE); + if (!mLODChanged) + { + genBBoxes(FALSE); + } } // it has its own drawable (it's moved) or it has changed UVs or it has changed xforms from global<->local else -- cgit v1.3 From ee51eee6275d6238a606da028a779bb07dc3b64c Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 19 Jul 2016 19:33:50 +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 | 26 +++++++++++++++++--------- indra/newview/llvovolume.h | 3 ++- 5 files changed, 38 insertions(+), 10 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 90ad5a605d..c3d7d67c86 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10218,6 +10218,17 @@ Value 1.0 + RenderRiggedFactorMultiplier + + Comment + Affects level of detail for worn rigged meshes + Persist + 1 + Type + F32 + Value + 7.5 + RenderWater Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 724eb56286..950692a788 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::sRiggedFactorMultiplier = gSavedSettings.getF32("RenderRiggedFactorMultiplier"); 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..5e74e9f019 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::sRiggedFactorMultiplier = (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("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)); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index fde997d54e..5fc571bf1d 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::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; @@ -1213,18 +1214,18 @@ void LLVOVolume::sculpt() } } -S32 LLVOVolume::computeLODDetail(F32 distance, F32 radius) +S32 LLVOVolume::computeLODDetail(F32 distance, F32 radius, F32 lod_factor) { S32 cur_detail; if (LLPipeline::sDynamicLOD) { // We've got LOD in the profile, and in the twist. Use radius. - F32 tan_angle = (LLVOVolume::sLODFactor*radius)/distance; + F32 tan_angle = (lod_factor*radius) / distance; cur_detail = LLVolumeLODGroup::getDetailFromTan(ll_round(tan_angle, 0.01f)); } else { - cur_detail = llclamp((S32) (sqrtf(radius)*LLVOVolume::sLODFactor*4.f), 0, 3); + cur_detail = llclamp((S32)(sqrtf(radius)*lod_factor*4.f), 0, 3); } return cur_detail; } @@ -1240,6 +1241,7 @@ BOOL LLVOVolume::calcLOD() F32 radius; F32 distance; + F32 lod_factor = LLVOVolume::sLODFactor; if (mDrawable->isState(LLDrawable::RIGGED)) { @@ -1251,22 +1253,27 @@ BOOL LLVOVolume::calcLOD() return FALSE; } + // Note: when changing, take note that a lot of rigged meshes have only one LOD. + lod_factor *= LLVOVolume::sRiggedFactorMultiplier; 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::sRiggedFactorMultiplier; + radius = llmin(radius, avatar_radius); } else { distance = mDrawable->mDistanceWRTCamera; radius = getVolume() ? getVolume()->mLODScaleBias.scaledVec(getScale()).length() : getScale().length(); } - + //hold onto unmodified distance for debugging //F32 debug_distance = distance; - + distance *= sDistanceFactor; - F32 rampDist = LLVOVolume::sLODFactor * 2; - + F32 rampDist = lod_factor * 2; + if (distance < rampDist) { // Boost LOD when you're REALLY close @@ -1279,7 +1286,8 @@ BOOL LLVOVolume::calcLOD() distance *= F_PI/3.f; cur_detail = computeLODDetail(ll_round(distance, 0.01f), - ll_round(radius, 0.01f)); + ll_round(radius, 0.01f), + lod_factor); if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_LOD_INFO) && diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index a331908320..ca9917069b 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -327,7 +327,7 @@ public: void clearRiggedVolume(); protected: - S32 computeLODDetail(F32 distance, F32 radius); + S32 computeLODDetail(F32 distance, F32 radius, F32 lod_factor); BOOL calcLOD(); LLFace* addFace(S32 face_index); void updateTEData(); @@ -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 sRiggedFactorMultiplier; // Worn rigged LOD scale factor multiplier static F32 sDistanceFactor; // LOD distance factor static LLPointer sObjectMediaClient; -- cgit v1.3 From 22238182c67b3d322e82bb042ad1d618c733a36d Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 2 Aug 2016 21:28:26 +0300 Subject: MAINT-6259 Rigged mesh LOD swapping --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llvovolume.cpp | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c3d7d67c86..f1d0901a81 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10227,7 +10227,7 @@ Type F32 Value - 7.5 + 6.5 RenderWater diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 5fc571bf1d..1112b7dee6 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1257,7 +1257,18 @@ BOOL LLVOVolume::calcLOD() lod_factor *= LLVOVolume::sRiggedFactorMultiplier; distance = avatar->mDrawable->mDistanceWRTCamera; F32 avatar_radius = avatar->getBinRadius(); - F32 object_radius = getVolume() ? getVolume()->mLODScaleBias.scaledVec(getScale()).length() : getScale().length(); + F32 object_radius; + if (mDrawable.notNull() && !mDrawable->isDead()) + { + const LLVector4a* ext = mDrawable->getSpatialExtents(); + LLVector4a diff; + diff.setSub(ext[1], ext[0]); + object_radius = diff.getLength3().getF32(); + } + else + { + object_radius = getVolume() ? getVolume()->mLODScaleBias.scaledVec(getScale()).length() : getScale().length(); + } radius = object_radius * LLVOVolume::sRiggedFactorMultiplier; radius = llmin(radius, avatar_radius); } -- cgit v1.3 From e3c58f74781186f084f60b35b931c5bb5d75e1ba Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 10 Aug 2016 19:02:57 +0300 Subject: MAINT-6554 reducing log spam --- indra/newview/llvovolume.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 50ccb2f74a..4aef6480cb 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4451,7 +4451,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, LL_RECORD_BLOCK_TIME(FTM_REGISTER_FACE); if (type == LLRenderPass::PASS_ALPHA && facep->getTextureEntry()->getMaterialParams().notNull() && !facep->getVertexBuffer()->hasDataType(LLVertexBuffer::TYPE_TANGENT)) { - LL_WARNS("RenderMaterials") << "Oh no! No binormals for this alpha blended face!" << LL_ENDL; + LL_WARNS_ONCE("RenderMaterials") << "Oh no! No binormals for this alpha blended face!" << LL_ENDL; } if (facep->getViewerObject()->isSelected() && LLSelectMgr::getInstance()->mHideSelectedObjects) -- cgit v1.3 From c50cb47f1b78cb9880a34fe8184bd9d0fd7e0e7d Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 17 Oct 2016 22:27:20 +0300 Subject: Backed out changeset: 4df419cb7b2f --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llvovolume.cpp | 13 +------------ 2 files changed, 2 insertions(+), 13 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 460c0809a6..28c632b498 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10282,7 +10282,7 @@ Type F32 Value - 6.5 + 7.5 RenderWater diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 4aef6480cb..55739915a3 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1257,18 +1257,7 @@ BOOL LLVOVolume::calcLOD() lod_factor *= LLVOVolume::sRiggedFactorMultiplier; distance = avatar->mDrawable->mDistanceWRTCamera; F32 avatar_radius = avatar->getBinRadius(); - F32 object_radius; - if (mDrawable.notNull() && !mDrawable->isDead()) - { - const LLVector4a* ext = mDrawable->getSpatialExtents(); - LLVector4a diff; - diff.setSub(ext[1], ext[0]); - object_radius = diff.getLength3().getF32(); - } - else - { - object_radius = getVolume() ? getVolume()->mLODScaleBias.scaledVec(getScale()).length() : getScale().length(); - } + F32 object_radius = getVolume() ? getVolume()->mLODScaleBias.scaledVec(getScale()).length() : getScale().length(); radius = object_radius * LLVOVolume::sRiggedFactorMultiplier; radius = llmin(radius, avatar_radius); } -- cgit v1.3 From 6b1f96187d7a93a4bbaecf1a84162a141eed5971 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 18 Oct 2016 15:32:01 +0300 Subject: MAINT-6793 Rigged mesh sometimes full of holes --- indra/newview/app_settings/settings.xml | 6 +++--- indra/newview/llappviewer.cpp | 2 +- indra/newview/llviewercontrol.cpp | 4 ++-- indra/newview/llvovolume.cpp | 38 ++++++++++++++++++++++++++++----- indra/newview/llvovolume.h | 2 +- 5 files changed, 40 insertions(+), 12 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 28c632b498..017b2a5249 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10273,16 +10273,16 @@ Value 1.0 - RenderRiggedFactorMultiplier + RenderRiggedLodCompensation Comment - Affects level of detail for worn rigged meshes + Affects visibility range of worn rigged meshes to compensate for missing LODs (limited by avatars own visibility) Persist 1 Type F32 Value - 7.5 + 6.5 RenderWater diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index b0829a3da1..bf7e643d0b 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -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::sRiggedFactorMultiplier = gSavedSettings.getF32("RenderRiggedFactorMultiplier"); + LLVOVolume::sRiggedLODCompensation = llmax(0.25f, gSavedSettings.getF32("RenderRiggedLodCompensation")); 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 5e74e9f019..bdd79b0da1 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -209,7 +209,7 @@ static bool handleVolumeLODChanged(const LLSD& newvalue) static bool handleRiggedLODChanged(const LLSD& newvalue) { - LLVOVolume::sRiggedFactorMultiplier = (F32)newvalue.asReal(); + LLVOVolume::sRiggedLODCompensation = llmax(0.25f, (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("RenderRiggedFactorMultiplier")->getSignal()->connect(boost::bind(&handleRiggedLODChanged, _2)); + gSavedSettings.getControl("RenderRiggedLodCompensation")->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 55739915a3..8d86623665 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -80,13 +80,14 @@ 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::sRiggedFactorMultiplier = 6.f; +F32 LLVOVolume::sRiggedLODCompensation = 6.5f; F32 LLVOVolume::sLODSlopDistanceFactor = 0.5f; //Changing this to zero, effectively disables the LOD transition slop F32 LLVOVolume::sDistanceFactor = 1.0f; S32 LLVOVolume::sNumLODChanges = 0; @@ -1254,12 +1255,39 @@ 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 = getVolume() ? getVolume()->mLODScaleBias.scaledVec(getScale()).length() : getScale().length(); - radius = object_radius * LLVOVolume::sRiggedFactorMultiplier; - radius = llmin(radius, avatar_radius); + 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); } else { diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index ca9917069b..ff005f8dc5 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -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 sRiggedFactorMultiplier; // Worn rigged LOD scale factor multiplier + static F32 sRiggedLODCompensation; // HACK: worn rigged LODs often have only high lod, so we are bumping them up withing avatar's visibility static F32 sDistanceFactor; // LOD distance factor static LLPointer sObjectMediaClient; -- cgit v1.3 From 0e6e04317bb896331b984e624c48e702986f2def Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Tue, 8 Nov 2016 04:44:46 +0200 Subject: Backed out changeset: 27782e83386b Reverting MAINT-6793 --- indra/newview/app_settings/settings.xml | 6 +++--- indra/newview/llappviewer.cpp | 2 +- indra/newview/llviewercontrol.cpp | 4 ++-- indra/newview/llvovolume.cpp | 38 +++++---------------------------- indra/newview/llvovolume.h | 2 +- 5 files changed, 12 insertions(+), 40 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 017b2a5249..28c632b498 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10273,16 +10273,16 @@ Value 1.0 - RenderRiggedLodCompensation + RenderRiggedFactorMultiplier Comment - Affects visibility range of worn rigged meshes to compensate for missing LODs (limited by avatars own visibility) + Affects level of detail for worn rigged meshes Persist 1 Type F32 Value - 6.5 + 7.5 RenderWater diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index bf7e643d0b..b0829a3da1 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -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"); diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index bdd79b0da1..5e74e9f019 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -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)); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 8d86623665..55739915a3 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -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 { diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index ff005f8dc5..ca9917069b 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -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 sObjectMediaClient; -- cgit v1.3 From c24b95e483549870a69062510f0abc9eded97a36 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Tue, 8 Nov 2016 04:45:47 +0200 Subject: Backed out changeset: 2a56972b1571 Reverting MAINT-6259 --- indra/newview/app_settings/settings.xml | 11 ----------- indra/newview/llappviewer.cpp | 1 - indra/newview/llviewercontrol.cpp | 7 ------- indra/newview/llvovolume.cpp | 26 +++++++++----------------- indra/newview/llvovolume.h | 3 +-- 5 files changed, 10 insertions(+), 38 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 28c632b498..5cf2e4555d 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10273,17 +10273,6 @@ Value 1.0 - RenderRiggedFactorMultiplier - - Comment - Affects level of detail for worn rigged meshes - Persist - 1 - Type - F32 - Value - 7.5 - RenderWater Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index b0829a3da1..9db03a7438 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -592,7 +592,6 @@ static void settings_to_globals() LLImageGL::sGlobalUseAnisotropic = gSavedSettings.getBOOL("RenderAnisotropic"); LLImageGL::sCompressTextures = gSavedSettings.getBOOL("RenderCompressTextures"); LLVOVolume::sLODFactor = gSavedSettings.getF32("RenderVolumeLODFactor"); - LLVOVolume::sRiggedFactorMultiplier = gSavedSettings.getF32("RenderRiggedFactorMultiplier"); 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 5e74e9f019..16f40fb747 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -207,12 +207,6 @@ static bool handleVolumeLODChanged(const LLSD& newvalue) return true; } -static bool handleRiggedLODChanged(const LLSD& newvalue) -{ - LLVOVolume::sRiggedFactorMultiplier = (F32)newvalue.asReal(); - return true; -} - static bool handleAvatarLODChanged(const LLSD& newvalue) { LLVOAvatar::sLODFactor = (F32) newvalue.asReal(); @@ -625,7 +619,6 @@ 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("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)); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 55739915a3..da1587d494 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -86,7 +86,6 @@ BOOL gAnimateTextures = TRUE; //extern BOOL gHideSelectedObjects; F32 LLVOVolume::sLODFactor = 1.f; -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; @@ -1214,18 +1213,18 @@ void LLVOVolume::sculpt() } } -S32 LLVOVolume::computeLODDetail(F32 distance, F32 radius, F32 lod_factor) +S32 LLVOVolume::computeLODDetail(F32 distance, F32 radius) { S32 cur_detail; if (LLPipeline::sDynamicLOD) { // We've got LOD in the profile, and in the twist. Use radius. - F32 tan_angle = (lod_factor*radius) / distance; + F32 tan_angle = (LLVOVolume::sLODFactor*radius)/distance; cur_detail = LLVolumeLODGroup::getDetailFromTan(ll_round(tan_angle, 0.01f)); } else { - cur_detail = llclamp((S32)(sqrtf(radius)*lod_factor*4.f), 0, 3); + cur_detail = llclamp((S32) (sqrtf(radius)*LLVOVolume::sLODFactor*4.f), 0, 3); } return cur_detail; } @@ -1241,7 +1240,6 @@ BOOL LLVOVolume::calcLOD() F32 radius; F32 distance; - F32 lod_factor = LLVOVolume::sLODFactor; if (mDrawable->isState(LLDrawable::RIGGED)) { @@ -1253,27 +1251,22 @@ BOOL LLVOVolume::calcLOD() return FALSE; } - // 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 = getVolume() ? getVolume()->mLODScaleBias.scaledVec(getScale()).length() : getScale().length(); - radius = object_radius * LLVOVolume::sRiggedFactorMultiplier; - radius = llmin(radius, avatar_radius); + radius = avatar->getBinRadius(); } else { distance = mDrawable->mDistanceWRTCamera; radius = getVolume() ? getVolume()->mLODScaleBias.scaledVec(getScale()).length() : getScale().length(); } - + //hold onto unmodified distance for debugging //F32 debug_distance = distance; - + distance *= sDistanceFactor; - F32 rampDist = lod_factor * 2; - + F32 rampDist = LLVOVolume::sLODFactor * 2; + if (distance < rampDist) { // Boost LOD when you're REALLY close @@ -1286,8 +1279,7 @@ BOOL LLVOVolume::calcLOD() distance *= F_PI/3.f; cur_detail = computeLODDetail(ll_round(distance, 0.01f), - ll_round(radius, 0.01f), - lod_factor); + ll_round(radius, 0.01f)); if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_LOD_INFO) && diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index ca9917069b..a331908320 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -327,7 +327,7 @@ public: void clearRiggedVolume(); protected: - S32 computeLODDetail(F32 distance, F32 radius, F32 lod_factor); + S32 computeLODDetail(F32 distance, F32 radius); BOOL calcLOD(); LLFace* addFace(S32 face_index); void updateTEData(); @@ -379,7 +379,6 @@ private: public: static F32 sLODSlopDistanceFactor;// Changing this to zero, effectively disables the LOD transition slop static F32 sLODFactor; // LOD scale factor - static F32 sRiggedFactorMultiplier; // Worn rigged LOD scale factor multiplier static F32 sDistanceFactor; // LOD distance factor static LLPointer sObjectMediaClient; -- cgit v1.3 From 7b356a0011eab4fc282c35da4b25c66ed164663f Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Tue, 8 Nov 2016 03:26:25 +0200 Subject: Backed out changeset: fb2eb1a59be6 Reverting MAINT-6125 --- indra/newview/llvieweroctree.cpp | 2 +- indra/newview/llvovolume.cpp | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvieweroctree.cpp b/indra/newview/llvieweroctree.cpp index 86591ff4df..023f1b92ba 100644 --- a/indra/newview/llvieweroctree.cpp +++ b/indra/newview/llvieweroctree.cpp @@ -465,7 +465,7 @@ LLViewerOctreeGroup::LLViewerOctreeGroup(OctreeNode* node) { LLVector4a tmp; tmp.splat(0.f); - mExtents[0] = mExtents[1] = mObjectBounds[0] = mObjectBounds[1] = + mExtents[0] = mExtents[1] = mObjectBounds[0] = mObjectBounds[0] = mObjectBounds[1] = mObjectExtents[0] = mObjectExtents[1] = tmp; mBounds[0] = node->getCenter(); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index da1587d494..8c026bae21 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1753,10 +1753,7 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable) dirtySpatialGroup(drawable->isState(LLDrawable::IN_REBUILD_Q1)); compiled = TRUE; lodOrSculptChanged(drawable, compiled); - if (!mLODChanged) - { - genBBoxes(FALSE); - } + genBBoxes(FALSE); } // it has its own drawable (it's moved) or it has changed UVs or it has changed xforms from global<->local else -- cgit v1.3