diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 7aafed1f42..b193bf1f68 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13235,6 +13235,26 @@ Change of this parameter will affect the layout of buttons in notification toast Value 0 + FSImpostorAvatarExclude + + Comment + Allows for Animesh User or Control Avatars to be excluded from using impostor rendering. Values are: (0 - None, 1 - User, 2 - Control, 3 - Both). + Persist + 1 + Type + U32 + Value + 0 + SanityCheckType + Between + SanityValue + + 0 + 3 + + SanityComment + Setting this value lower than 0 or higher than 3 has no effect. + RenderAvatarComplexityMode Comment diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 135bbe14ed..28f32b5ec2 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -237,6 +237,17 @@ enum ERenderName RENDER_NAME_FADE }; +// [FIRE-35735] Imposter/Impostor Avatar Exclusions +// Different settings based on FSImpostorAvatarExclude +enum EImpostorAvatarExclude +{ + NONE, // Default, no avatar excluded + USER, // Check for mIsAnimesh only, exclude user Avatar's which are Animesh or have Animesh attachments + CONTROL, // Check for mIsControlAvatar only, exclude control avatars (avtars which don't have a user UUID assigned) + BOTH // Check both mIsAnimesh or mIsControlAvatar, exclude both User Amimesh and Control avatars. +}; +// [FIRE-35735] + #define JELLYDOLLS_SHOULD_IMPOSTOR //----------------------------------------------------------------------------- @@ -4643,6 +4654,9 @@ bool LLVOAvatar::isVisuallyMuted() { LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; // Tracy accounting for imposter testing. bool muted = false; + // [FIRE-35735] Imposter/Impostor Avatar Exclusions + static LLCachedControl impostor_avatar_exclude(gSavedSettings,"FSImpostorAvatarExclude", 0); + // [FIRE-35735] // FIRE-11783: Always visually mute avatars that are muted if (!isSelf() && isInMuteList()) @@ -4677,6 +4691,13 @@ bool LLVOAvatar::isVisuallyMuted() #else muted = false; #endif + // [FIRE-35735] Imposter/Impostor Avatar Exclusions + // If the avatar is set to be excluded, set the muted flag to false + if ((mIsControlAvatar && impostor_avatar_exclude >= EImpostorAvatarExclude::CONTROL) || (mIsAnimesh && (impostor_avatar_exclude & EImpostorAvatarExclude::USER))) + { + muted = false; + } + // [FIRE-35735] } // FIRE-11783: Always visually mute avatars that are muted //else if (isInMuteList()) @@ -4686,10 +4707,26 @@ bool LLVOAvatar::isVisuallyMuted() // else if (mIsControlAvatar) { + // [FIRE-35735] Imposter/Impostor Avatar Exclusions + // If the avatar is set to control or both, set the the meted flag to false + if (impostor_avatar_exclude >= EImpostorAvatarExclude::CONTROL) + { + muted = false; + } + else + // [FIRE-35735] muted = isTooSlow(); } else { + // [FIRE-35735] Imposter/Impostor Avatar Exclusions + // If the avatar is an animesh and the FSImpostorAvatarExclude is either a USER or BOTH (Can use & as both 1 and 3 have 1 set) + if ((impostor_avatar_exclude & EImpostorAvatarExclude::USER) && mIsAnimesh) + { + muted = false; + } + else + // [FIRE-35735] muted = isTooComplex(); // this should not trigger based on perfstats } } @@ -7585,6 +7622,10 @@ void LLVOAvatar::updateAttachmentOverrides() } } #endif + // [FIRE-35735] Imposter/Impostor Avatar Exclusions + // If either the main body of the avatar is animated, or there are any animated attachedments, then flag it as an Animesh. + mIsAnimesh = getNumAnimatedObjectAttachments() > 0 || isAnimatedObject(); + // [FIRE-35735] } void LLVOAvatar::notifyAttachmentMeshLoaded() @@ -8535,6 +8576,10 @@ const LLViewerJointAttachment *LLVOAvatar::attachObject(LLViewerObject *viewer_o updateMeshVisibility(); + // [FIRE-35735] Imposter/Impostor Avatar Exclusions + // If either the main body of the avatar is animated, or there are any animated attachedments, then flag it as an Animesh. + mIsAnimesh = getNumAnimatedObjectAttachments() > 0 || isAnimatedObject(); + // [FIRE-35735] return attachment; } @@ -8860,6 +8905,10 @@ bool LLVOAvatar::detachObject(LLViewerObject *viewer_object) } updateMeshVisibility(); + // [FIRE-35735] Imposter/Impostor Avatar Exclusions + // If either the main body of the avatar is animated, or there are any animated attachedments, then flag it as an Animesh. + mIsAnimesh = getNumAnimatedObjectAttachments() > 0 || isAnimatedObject(); + // [FIRE-35735] LL_DEBUGS() << "Detaching object " << viewer_object->mID << " from " << attachment->getName() << LL_ENDL; return true; @@ -8870,6 +8919,10 @@ bool LLVOAvatar::detachObject(LLViewerObject *viewer_object) if (iter != mPendingAttachment.end()) { mPendingAttachment.erase(iter); + // [FIRE-35735] Imposter/Impostor Avatar Exclusions + // If either the main body of the avatar is animated, or there are any animated attachedments, then flag it as an Animesh. + mIsAnimesh = getNumAnimatedObjectAttachments() > 0 || isAnimatedObject(); + // [FIRE-35735] return true; } @@ -9655,6 +9708,15 @@ bool LLVOAvatar::isTooComplex() const } else { + // [FIRE-35735] Imposter/Impostor Avatar Exclusions + static LLCachedControl impostor_avatar_exclude(gSavedSettings,"FSImpostorAvatarExclude", 0); + + // If the avatar is set to be excluded, return that the avatar is not too complex + if ((mIsControlAvatar && impostor_avatar_exclude >= EImpostorAvatarExclude::CONTROL) || (mIsAnimesh && (impostor_avatar_exclude & EImpostorAvatarExclude::USER))) + { + return false; + } + // [FIRE-35735] // Determine if visually muted or not static LLCachedControl max_render_cost(gSavedSettings, "RenderAvatarMaxComplexity", 0U); static LLCachedControl max_attachment_area(gSavedSettings, "RenderAutoMuteSurfaceAreaLimit", 1000.0f); @@ -12098,8 +12160,23 @@ bool LLVOAvatar::isImpostor() { // render time handling using tooSlow() // return isVisuallyMuted() || (sLimitNonImpostors && (mUpdatePeriod > 1)); + // [FIRE-35735] Imposter/Impostor Avatar Exclusions + static LLCachedControl impostor_avatar_exclude(gSavedSettings,"FSImpostorAvatarExclude", 0); + + // Store the result of is visually muted as used in possibly 2 places + bool is_visual_muted = isVisuallyMuted(); + + // If the avatar is set to be excluded, return that the avatar is not an Impostor + if ((mIsControlAvatar && impostor_avatar_exclude >= EImpostorAvatarExclude::CONTROL) || (mIsAnimesh && (impostor_avatar_exclude & EImpostorAvatarExclude::USER))) + { + return false; + } + // [FIRE-35735] return ( - isVisuallyMuted() || + // [FIRE-35735] Imposter/Impostor Avatar Exclusions + // isVisuallyMuted() || + is_visual_muted || // Save from calling isVisuallyMuted a second time + // [FIRE-35735] isTooSlowWithoutShadows() || (sLimitNonImpostors && (mUpdatePeriod > 1) ) ); @@ -12120,6 +12197,15 @@ bool LLVOAvatar::shouldImpostor(const F32 rank_factor) // return sLimitNonImpostors && (mVisibilityRank > sMaxNonImpostors * rank_factor); // static LLCachedControl render_jellys_As_imposters(gSavedSettings, "RenderJellyDollsAsImpostors"); + // [FIRE-35735] Imposter/Impostor Avatar Exclusions + static LLCachedControl impostor_avatar_exclude(gSavedSettings,"FSImpostorAvatarExclude", 0); + + // If the avatar is set to be excluded, return that the avatar should not be impostored + if ((mIsControlAvatar && impostor_avatar_exclude >= EImpostorAvatarExclude::CONTROL) || (mIsAnimesh && (impostor_avatar_exclude & EImpostorAvatarExclude::USER))) + { + return false; + } + // [FIRE-35735] if (isTooSlowWithoutShadows()) { return true; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 4cb80380fb..a4085e6a34 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -684,6 +684,7 @@ public: // [/RLVa:KB] // bool mNeedsImpostorUpdate; S32 mLastImpostorUpdateReason; + bool mIsAnimesh; // FIRE-35735: Imposter/Impostor Avatar Exclusions (Flag to track if avatar or attachments have Animated Mesh flagged) F32SecondsImplicit mLastImpostorUpdateFrameTime; const LLVector3* getLastAnimExtents() const { return mLastAnimExtents; } void setNeedsExtentUpdate(bool val) { mNeedsExtentUpdate = val; } diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index 366f59ef10..f20cc9f630 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -1423,6 +1423,43 @@ If you do not understand the distinction then leave this control alone." + + Exclude Animesh Impostor Avatar: + + + + + + +