diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-03-24 16:13:55 +0200 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-03-24 16:30:19 +0200 |
commit | ad3b60445eb25b1c8786dddd3056a192f6630156 (patch) | |
tree | 0268ae2f64270df55f9cf7a7f26ff2516adaa8e2 | |
parent | 5bb76d9164e8d73cdd14c9088459c584b94cb313 (diff) |
SL-12237 Invisible avatars don't need detailed updates
-rw-r--r-- | indra/newview/llvoavatar.cpp | 25 | ||||
-rw-r--r-- | indra/newview/llvoavatar.h | 2 | ||||
-rw-r--r-- | indra/newview/llvoavatarself.cpp | 5 |
3 files changed, 19 insertions, 13 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index f337b0ca35..ee9ca213d5 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2585,6 +2585,7 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time) if ((LLFrameTimer::getFrameCount() + mID.mData[0]) % compl_upd_freq == 0) { + LL_RECORD_BLOCK_TIME(FTM_AVATAR_UPDATE_COMPLEXITY); idleUpdateRenderComplexity(); } idleUpdateDebugInfo(); @@ -2898,7 +2899,10 @@ F32 LLVOAvatar::calcMorphAmount() void LLVOAvatar::idleUpdateLipSync(bool voice_enabled) { // Use the Lipsync_Ooh and Lipsync_Aah morphs for lip sync - if ( voice_enabled && (LLVoiceClient::getInstance()->lipSyncEnabled()) && LLVoiceClient::getInstance()->getIsSpeaking( mID ) ) + if ( voice_enabled + && mLastRezzedStatus > 0 // no point updating lip-sync for clouds + && (LLVoiceClient::getInstance()->lipSyncEnabled()) + && LLVoiceClient::getInstance()->getIsSpeaking( mID ) ) { F32 ooh_morph_amount = 0.0f; F32 aah_morph_amount = 0.0f; @@ -3896,15 +3900,16 @@ void LLVOAvatar::updateFootstepSounds() } //------------------------------------------------------------------------ -// computeUpdatePeriod() +// computeUpdatePeriodAndVisibility() // Factored out from updateCharacter() // Set new value for mUpdatePeriod based on distance and various other factors. +// Returs true if character needs an update //------------------------------------------------------------------------ -void LLVOAvatar::computeUpdatePeriod() +BOOL LLVOAvatar::computeUpdatePeriodAndVisibility() { bool visually_muted = isVisuallyMuted(); - if (mDrawable.notNull() - && isVisible() + BOOL is_visible = isVisible(); // includes drawable check + if ( is_visible && (!isSelf() || visually_muted) && !isUIAvatar() && sUseImpostors @@ -3932,6 +3937,11 @@ void LLVOAvatar::computeUpdatePeriod() { //background avatars are REALLY slow updating impostors mUpdatePeriod = 16; } + else if (mLastRezzedStatus <= 0) + { + // Don't update cloud avatars too often + mUpdatePeriod = 8; + } else if ( shouldImpostor(3) ) { //back 25% of max visible avatars are slow updating impostors mUpdatePeriod = 8; @@ -3945,10 +3955,12 @@ void LLVOAvatar::computeUpdatePeriod() //nearby avatars, update the impostors more frequently. mUpdatePeriod = 4; } + return (LLDrawable::getCurrentFrame() + mID.mData[0]) % mUpdatePeriod == 0 ? TRUE : FALSE; } else { mUpdatePeriod = 1; + return is_visible; } } @@ -4317,8 +4329,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // The rest should only be done occasionally for far away avatars. // Set mUpdatePeriod and visible based on distance and other criteria. //-------------------------------------------------------------------- - computeUpdatePeriod(); - visible = (LLDrawable::getCurrentFrame()+mID.mData[0])%mUpdatePeriod == 0 ? TRUE : FALSE; + visible = computeUpdatePeriodAndVisibility(); //-------------------------------------------------------------------- // Early out if not visible and not self diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 2f04288825..952c04a1ff 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -264,7 +264,7 @@ public: virtual void updateDebugText(); virtual BOOL updateCharacter(LLAgent &agent); void updateFootstepSounds(); - void computeUpdatePeriod(); + BOOL computeUpdatePeriodAndVisibility(); void updateOrientation(LLAgent &agent, F32 speed, F32 delta_time); void updateTimeStep(); void updateRootPositionAndRotation(LLAgent &agent, F32 speed, bool was_sit_ground_constrained); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 16b27fd144..aea12380e8 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2667,11 +2667,6 @@ void LLVOAvatarSelf::onCustomizeStart(bool disable_camera_switch) { gAgentCamera.changeCameraToCustomizeAvatar(); } - -#if 0 - gAgentAvatarp->clearVisualParamWeights(); - gAgentAvatarp->idleUpdateAppearanceAnimation(); -#endif gAgentAvatarp->invalidateAll(); // mark all bakes as dirty, request updates gAgentAvatarp->updateMeshTextures(); // make sure correct textures are applied to the avatar mesh. |