diff options
-rw-r--r-- | indra/newview/lldrawpoolavatar.cpp | 10 | ||||
-rw-r--r-- | indra/newview/llviewerpartsource.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llvoavatar.cpp | 59 | ||||
-rw-r--r-- | indra/newview/llvoavatar.h | 31 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 2 |
5 files changed, 87 insertions, 17 deletions
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 789a254389..e19a62625e 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -585,9 +585,9 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) BOOL impostor = avatarp->isImpostor(); if (impostor - && LLVOAvatar::AV_DO_NOT_RENDER != avatarp->getVisualMuteSettings() - && LLVOAvatar::AV_ALWAYS_RENDER != avatarp->getVisualMuteSettings()) + && LLVOAvatar::AOA_NORMAL != avatarp->getOverallAppearance()) { + // No shadows for jellydolled or invisible avs. return; } @@ -1524,7 +1524,8 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) if (( avatarp->isInMuteList() || impostor - || (LLVOAvatar::AV_DO_NOT_RENDER == avatarp->getVisualMuteSettings() && !avatarp->needsImpostorUpdate()) ) && pass != 0) + || (LLVOAvatar::AOA_NORMAL != avatarp->getOverallAppearance() && !avatarp->needsImpostorUpdate()) ) && pass != 0) +// || (LLVOAvatar::AV_DO_NOT_RENDER == avatarp->getVisualMuteSettings() && !avatarp->needsImpostorUpdate()) ) && pass != 0) { //don't draw anything but the impostor for impostored avatars return; } @@ -1541,7 +1542,8 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) LLVOAvatar::sNumVisibleAvatars++; } - if (impostor || (LLVOAvatar::AV_DO_NOT_RENDER == avatarp->getVisualMuteSettings() && !avatarp->needsImpostorUpdate())) +// if (impostor || (LLVOAvatar::AV_DO_NOT_RENDER == avatarp->getVisualMuteSettings() && !avatarp->needsImpostorUpdate())) + if (impostor || (LLVOAvatar::AOA_NORMAL != avatarp->getOverallAppearance() && !avatarp->needsImpostorUpdate())) { if (LLPipeline::sRenderDeferred && !LLPipeline::sReflectionRender && avatarp->mImpostor.isComplete()) { diff --git a/indra/newview/llviewerpartsource.cpp b/indra/newview/llviewerpartsource.cpp index 998ae52fe0..f042040e98 100644 --- a/indra/newview/llviewerpartsource.cpp +++ b/indra/newview/llviewerpartsource.cpp @@ -136,7 +136,7 @@ void LLViewerPartSourceScript::update(const F32 dt) { mOwnerAvatarp = find_avatar(mOwnerUUID); } - if (mOwnerAvatarp.notNull() && LLVOAvatar::AV_DO_NOT_RENDER == mOwnerAvatarp->getVisualMuteSettings()) + if (mOwnerAvatarp.notNull() && LLVOAvatar::AOA_NORMAL != mOwnerAvatarp->getOverallAppearance()) { return; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7579eb1a90..8215563687 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() @@ -4809,7 +4809,8 @@ U32 LLVOAvatar::renderSkinned() { if (!isSelf() || gAgent.needsRenderHead() || LLPipeline::sShadowRender) { - if (isTextureVisible(TEX_HEAD_BAKED) || isUIAvatar()) + + if (isTextureVisible(TEX_HEAD_BAKED) || (getOverallAppearance() == AOA_JELLYDOLL && !isControlAvatar()) || isUIAvatar()) { LLViewerJoint* head_mesh = getViewerJoint(MESH_ID_HEAD); if (head_mesh) @@ -4819,7 +4820,7 @@ U32 LLVOAvatar::renderSkinned() first_pass = FALSE; } } - if (isTextureVisible(TEX_UPPER_BAKED) || isUIAvatar()) + if (isTextureVisible(TEX_UPPER_BAKED) || (getOverallAppearance() == AOA_JELLYDOLL && !isControlAvatar()) || isUIAvatar()) { LLViewerJoint* upper_mesh = getViewerJoint(MESH_ID_UPPER_BODY); if (upper_mesh) @@ -4829,7 +4830,7 @@ U32 LLVOAvatar::renderSkinned() first_pass = FALSE; } - if (isTextureVisible(TEX_LOWER_BAKED) || isUIAvatar()) + if (isTextureVisible(TEX_LOWER_BAKED) || (getOverallAppearance() == AOA_JELLYDOLL && !isControlAvatar()) || isUIAvatar()) { LLViewerJoint* lower_mesh = getViewerJoint(MESH_ID_LOWER_BODY); if (lower_mesh) @@ -4934,7 +4935,7 @@ U32 LLVOAvatar::renderRigid() gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); } - if (isTextureVisible(TEX_EYES_BAKED) || isUIAvatar()) + if (isTextureVisible(TEX_EYES_BAKED) || (getOverallAppearance() == AOA_JELLYDOLL && !isControlAvatar()) || isUIAvatar()) { LLViewerJoint* eyeball_left = getViewerJoint(MESH_ID_EYEBALL_LEFT); LLViewerJoint* eyeball_right = getViewerJoint(MESH_ID_EYEBALL_RIGHT); @@ -7557,9 +7558,15 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color) } // virtual +// Do rigged mesh attachments display with this av? bool LLVOAvatar::shouldRenderRigged() const { - return true; + if (getOverallAppearance() == AOA_NORMAL) + { + return true; + } + // TBD - render for AOA_JELLYDOLL? + return false; } // FIXME: We have an mVisible member, set in updateVisibility(), but this @@ -10440,6 +10447,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..2239e7b23e 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -91,6 +91,7 @@ class LLVOAvatar : public: friend class LLVOAvatarSelf; + friend class LLAvatarCheckImpostorMode; /******************************************************************************** ** ** @@ -426,9 +427,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, @@ -436,8 +440,27 @@ public: AV_ALWAYS_RENDER = 2 }; void setVisualMuteSettings(VisualMuteSettings set); + +protected: + // If you think you need to access this outside LLVOAvatar, you probably want getOverallAppearance() VisualMuteSettings getVisualMuteSettings() { return mVisuallyMuteSetting; }; +public: + + // 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; } @@ -450,7 +473,7 @@ public: static void restoreGL(); S32 mSpecialRenderMode; // special lighting - private: +private: F32 mAttachmentSurfaceArea; //estimated surface area of attachments U32 mAttachmentVisibleTriangleCount; F32 mAttachmentEstTriangleCount; @@ -467,8 +490,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 diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index f0ed303f66..7d47d59af8 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -3086,7 +3086,7 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) LLVOAvatar* av = vobj->asAvatar(); if (av && (av->isImpostor() || av->isInMuteList() - || (LLVOAvatar::AV_DO_NOT_RENDER == av->getVisualMuteSettings() && !av->needsImpostorUpdate()) )) + || (LLVOAvatar::AOA_NORMAL != av->getOverallAppearance() && !av->needsImpostorUpdate()) )) { return; } |