From 345733173f0ba87ba00964d8468c230af667971d Mon Sep 17 00:00:00 2001 From: Runitai Linden Date: Mon, 24 Jan 2022 14:54:52 -0600 Subject: SL-16594 Fix for occasional single-frame culling of rigged attachments --- indra/newview/llvoavatar.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index e40fdff751..13ae43c7d6 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2839,13 +2839,21 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update) attached_object->mDrawable->makeActive(); attached_object->mDrawable->updateXform(TRUE); - if (!rigged) + if (bridge) { - if (bridge) + if (!rigged) { gPipeline.updateMoveNormalAsync(bridge); } + else + { + //specialized impl of updateMoveNormalAsync just for rigged attachment SpatialBridge + bridge->setState(LLDrawable::MOVE_UNDAMPED); + bridge->updateMove(); + bridge->setState(LLDrawable::EARLY_MOVE); + } } + attached_object->updateText(); } } -- cgit v1.3 From 3dd841277e88be5c124605153fef0d13dfcd5767 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 27 Jan 2022 00:11:37 +0200 Subject: SL-16056 Avatar gas cloud adaptive delay #2 Reset avatar 'loaded' timer after getting new mesh data --- indra/newview/llvoavatar.cpp | 20 ++++++++++++++++++-- indra/newview/llvoavatar.h | 4 ++-- indra/newview/llvovolume.cpp | 12 ++++++++---- 3 files changed, 28 insertions(+), 8 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 13ae43c7d6..56a895bd1f 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -127,6 +127,9 @@ const F32 MIN_HOVER_Z = -2.0; const F32 MIN_ATTACHMENT_COMPLEXITY = 0.f; const F32 DEFAULT_MAX_ATTACHMENT_COMPLEXITY = 1.0e6f; +// Unlike with 'self' avatar, server doesn't inform viewer about +// expected attachments so viewer has to wait to see if anything +// else will arrive const F32 FIRST_APPEARANCE_CLOUD_MIN_DELAY = 3.f; // seconds const F32 FIRST_APPEARANCE_CLOUD_MAX_DELAY = 45.f; @@ -746,7 +749,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mCurrentGesticulationLevel = 0; - mFirstSeenTimer.reset(); + mFirstAppearanceMessageTimer.reset(); mRuthTimer.reset(); mRuthDebugTimer.reset(); mDebugExistenceTimer.reset(); @@ -6434,6 +6437,16 @@ void LLVOAvatar::updateAttachmentOverrides() #endif } +void LLVOAvatar::notifyAttachmentMeshLoaded() +{ + if (!isFullyLoaded()) + { + // We just received mesh or skin info + // Reset timer to wait for more potential meshes or changes + mFullyLoadedTimer.reset(); + } +} + //----------------------------------------------------------------------------- // addAttachmentOverridesForObject //----------------------------------------------------------------------------- @@ -8156,7 +8169,7 @@ BOOL LLVOAvatar::processFullyLoadedChange(bool loading) // Note that textures can causes 60s delay on thier own // so this delay might end up on top of textures' delay mFirstUseDelaySeconds = llclamp( - mFirstSeenTimer.getElapsedTimeF32(), + mFirstAppearanceMessageTimer.getElapsedTimeF32(), FIRST_APPEARANCE_CLOUD_MIN_DELAY, FIRST_APPEARANCE_CLOUD_MAX_DELAY); @@ -8926,6 +8939,9 @@ void LLVOAvatar::onFirstTEMessageReceived() mMeshTexturesDirty = TRUE; gPipeline.markGLRebuild(this); + + mFirstAppearanceMessageTimer.reset(); + mFullyLoadedTimer.reset(); } } diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index ab2a2daf49..7c2d71802e 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -206,7 +206,7 @@ public: inline LLJoint* getSkeletonJoint(S32 joint_num) { return mSkeleton[joint_num]; } inline size_t getSkeletonJointCount() const { return mSkeleton.size(); } - + void notifyAttachmentMeshLoaded(); void addAttachmentOverridesForObject(LLViewerObject *vo, std::set* meshes_seen = NULL, bool recursive = true); void removeAttachmentOverridesForObject(const LLUUID& mesh_id); void removeAttachmentOverridesForObject(LLViewerObject *vo); @@ -379,7 +379,7 @@ protected: private: BOOL mFirstFullyVisible; F32 mFirstUseDelaySeconds; - LLFrameTimer mFirstSeenTimer; + LLFrameTimer mFirstAppearanceMessageTimer; BOOL mFullyLoaded; BOOL mPreviousFullyLoaded; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index e8bc015d78..8bc570311c 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1170,13 +1170,17 @@ void LLVOVolume::notifyMeshLoaded() mSculptChanged = TRUE; gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_GEOMETRY, TRUE); - if (getAvatar() && !isAnimatedObject()) + LLVOAvatar *av = getAvatar(); + if (av && !isAnimatedObject()) { - getAvatar()->addAttachmentOverridesForObject(this); + av->addAttachmentOverridesForObject(this); + av->notifyAttachmentMeshLoaded(); } - if (getControlAvatar() && isAnimatedObject()) + LLControlAvatar *cav = getControlAvatar(); + if (cav && isAnimatedObject()) { - getControlAvatar()->addAttachmentOverridesForObject(this); + cav->addAttachmentOverridesForObject(this); + cav->notifyAttachmentMeshLoaded(); } updateVisualComplexity(); } -- cgit v1.3 From af830e5fc5840194be95140f644a27011b9b7e06 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 28 Jan 2022 00:32:33 +0200 Subject: SL-16721 Crash at LLVOAvatar::idleUpdateMisc bridge in state 24 (dead) --- indra/newview/llvoavatar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 56a895bd1f..2d34e28b93 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2825,7 +2825,7 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update) //override rigged attachments' octree spatial extents with this avatar's bounding box LLSpatialBridge* bridge = attached_object->mDrawable->getSpatialBridge(); bool rigged = false; - if (bridge) + if (bridge && !bridge->isDead()) { //transform avatar bounding box into attachment's coordinate frame LLVector4a extents[2]; @@ -2842,7 +2842,7 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update) attached_object->mDrawable->makeActive(); attached_object->mDrawable->updateXform(TRUE); - if (bridge) + if (bridge && !bridge->isDead()) { if (!rigged) { -- cgit v1.3 From 4e31ff1d7e05ff376fc1c66156eb76cccbdd5f38 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 21 Feb 2022 23:11:17 +0200 Subject: SL-16056 Load cloud texture only once --- indra/newview/llvoavatar.cpp | 5 +++-- indra/newview/llvoavatar.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 2d34e28b93..31035f666d 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -619,6 +619,7 @@ F32 LLVOAvatar::sUnbakedTime = 0.f; F32 LLVOAvatar::sUnbakedUpdateTime = 0.f; F32 LLVOAvatar::sGreyTime = 0.f; F32 LLVOAvatar::sGreyUpdateTime = 0.f; +LLPointer LLVOAvatar::sCloudTexture = NULL; //----------------------------------------------------------------------------- // Helper functions @@ -1136,6 +1137,7 @@ void LLVOAvatar::initClass() LLControlAvatar::sRegionChangedSlot = gAgent.addRegionChangedCallback(&LLControlAvatar::onRegionChanged); + sCloudTexture = LLViewerTextureManager::getFetchedTextureFromFile("cloud-particle.j2c"); } @@ -3080,8 +3082,7 @@ void LLVOAvatar::idleUpdateLoadingEffect() particle_parameters.mPartData.mStartColor = LLColor4(1, 1, 1, 0.5f); particle_parameters.mPartData.mEndColor = LLColor4(1, 1, 1, 0.0f); particle_parameters.mPartData.mStartScale.mV[VX] = 0.8f; - LLViewerTexture* cloud = LLViewerTextureManager::getFetchedTextureFromFile("cloud-particle.j2c"); - particle_parameters.mPartImageID = cloud->getID(); + particle_parameters.mPartImageID = sCloudTexture->getID(); particle_parameters.mMaxAge = 0.f; particle_parameters.mPattern = LLPartSysData::LL_PART_SRC_PATTERN_ANGLE_CONE; particle_parameters.mInnerAngle = F_PI; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 7c2d71802e..ba67007fa9 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -336,7 +336,8 @@ public: static F32 sLODFactor; // user-settable LOD factor static F32 sPhysicsLODFactor; // user-settable physics LOD factor static BOOL sJointDebug; // output total number of joints being touched for each avatar - static BOOL sDebugAvatarRotation; + + static LLPointer sCloudTexture; //-------------------------------------------------------------------- // Region state -- cgit v1.3