summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2020-04-07 21:28:44 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2020-04-07 21:28:44 +0100
commitb5b2d253f6306f20b67083258bd143c846c809a9 (patch)
tree09c277b3f8cd8e7a880b18491dc23e1eada89a9c /indra
parent328329fceab6b18dd7dda6f7ce9a3d4788fd7c54 (diff)
SL-12996 - adding OverallAppearance state for avatars
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llvoavatar.cpp42
-rw-r--r--indra/newview/llvoavatar.h23
2 files changed, 60 insertions, 5 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index b524db478e..ac28d6aa37 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -3524,7 +3524,7 @@ bool LLVOAvatar::isVisuallyMuted()
return muted;
}
-bool LLVOAvatar::isInMuteList()
+bool LLVOAvatar::isInMuteList() const
{
bool muted = false;
F64 now = LLFrameTimer::getTotalSeconds();
@@ -3882,7 +3882,7 @@ void LLVOAvatar::computeUpdatePeriod()
F32 impostor_area = 256.f*512.f*(8.125f - LLVOAvatar::sLODFactor*8.f);
if (visually_muted)
- { // visually muted avatars update at 16 hz
+ { // visually muted avatars update at every 16 frames
mUpdatePeriod = 16;
}
else if (! shouldImpostor()
@@ -10440,6 +10440,44 @@ void LLVOAvatar::setVisualMuteSettings(VisualMuteSettings set)
LLRenderMuteList::getInstance()->saveVisualMuteSetting(getID(), S32(set));
}
+// Based on isVisuallyMuted(), but has 3 possible results.
+LLVOAvatar::AvatarOverallAppearance LLVOAvatar::getOverallAppearance() const
+{
+ AvatarOverallAppearance result = AOA_NORMAL;
+
+ // Priority order (highest priority first)
+ // * own avatar is always drawn normally
+ // * if on the "always draw normally" list, draw them normally
+ // * if on the "always visually mute" list, show as jellydoll
+ // * if explicitly muted (blocked), show as invisible
+ // * check against the render cost and attachment limits - if too complex, show as jellydoll
+ if (isSelf())
+ {
+ result = AOA_NORMAL;
+ }
+ else // !isSelf()
+ {
+ if (mVisuallyMuteSetting == AV_ALWAYS_RENDER)
+ {
+ result = AOA_NORMAL;
+ }
+ else if (mVisuallyMuteSetting == AV_DO_NOT_RENDER)
+ { // Always want to see this AV as an impostor
+ result = AOA_JELLYDOLL;
+ }
+ else if (isInMuteList())
+ {
+ result = AOA_INVISIBLE;
+ }
+ else if (isTooComplex())
+ {
+ result = AOA_JELLYDOLL;
+ }
+ }
+
+ return result;
+}
+
void LLVOAvatar::calcMutedAVColor()
{
LLColor4 new_color(mMutedAVColor);
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 00dccc5d12..ed0fc5a9d4 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -426,9 +426,12 @@ public:
public:
U32 renderImpostor(LLColor4U color = LLColor4U(255,255,255,255), S32 diffuse_channel = 0);
bool isVisuallyMuted();
- bool isInMuteList();
+ bool isInMuteList() const;
void forceUpdateVisualMuteSettings();
+ // Visual Mute Setting is an input. Does not necessarily determine
+ // what the avatar looks like, because it interacts with other
+ // settings like muting, complexity threshold. Should be private or protected.
enum VisualMuteSettings
{
AV_RENDER_NORMALLY = 0,
@@ -438,6 +441,20 @@ public:
void setVisualMuteSettings(VisualMuteSettings set);
VisualMuteSettings getVisualMuteSettings() { return mVisuallyMuteSetting; };
+ // Overall Appearance is an output. Depending on whether the
+ // avatar is blocked/muted, whether it exceeds the complexity
+ // threshold, etc, avatar will want to be displayed in one of
+ // these ways. Rendering code that wants to know how to display an
+ // avatar should be looking at this value, NOT the visual mute
+ // settings
+ enum AvatarOverallAppearance
+ {
+ AOA_NORMAL,
+ AOA_JELLYDOLL,
+ AOA_INVISIBLE
+ };
+ AvatarOverallAppearance getOverallAppearance() const;
+
U32 renderRigid();
U32 renderSkinned();
F32 getLastSkinTime() { return mLastSkinTime; }
@@ -467,8 +484,8 @@ public:
mutable bool mVisualComplexityStale;
U32 mReportedVisualComplexity; // from other viewers through the simulator
- bool mCachedInMuteList;
- F64 mCachedMuteListUpdateTime;
+ mutable bool mCachedInMuteList;
+ mutable F64 mCachedMuteListUpdateTime;
VisualMuteSettings mVisuallyMuteSetting; // Always or never visually mute this AV