diff options
author | Oz Linden <oz@lindenlab.com> | 2015-08-25 17:51:35 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2015-08-25 17:51:35 -0400 |
commit | 206ef7a1562db19a4d8a41e55b7272c917f4b62c (patch) | |
tree | 269bacf70ea50e6242eecd2b9c9c55f84fe72c44 /indra/newview | |
parent | 75304b4ca81e3fdb9164ec607997a6c30616d8ca (diff) |
MAINT-5560: Correct imposter rendering flaws for avatars that have not had any attachments
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llavatarrenderinfoaccountant.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llavatarrendernotifier.cpp | 7 | ||||
-rwxr-xr-x | indra/newview/llspatialpartition.cpp | 6 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.cpp | 16 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.h | 18 | ||||
-rwxr-xr-x | indra/newview/llvovolume.cpp | 24 |
6 files changed, 36 insertions, 40 deletions
diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 595a5f0224..03204ea48f 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -267,9 +267,10 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio avatar->calculateUpdateRenderComplexity(); // Make sure the numbers are up-to-date LLSD info = LLSD::emptyMap(); - if (avatar->getVisualComplexity() > 0) + U32 avatar_complexity = avatar->getVisualComplexity(); + if (avatar_complexity > 0) { - info[KEY_WEIGHT] = avatar->getVisualComplexity(); + info[KEY_WEIGHT] = (S32)(avatar_complexity < S32_MAX ? avatar_complexity : S32_MAX); info[KEY_TOO_COMPLEX] = LLSD::Boolean(avatar->isTooComplex()); agents[avatar->getID().asString()] = info; diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index c7fdf4cce4..2596035f95 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -133,9 +133,10 @@ void LLAvatarRenderNotifier::updateNotification() // next 'over limit' update should be displayed as soon as possible if there is anything noteworthy mPopUpDelayTimer.resetWithExpiry(0); } - else if ((mPopUpDelayTimer.hasExpired() || is_visible) - && (mOverLimitPct > 0 || mLatestOverLimitPct > 0) - && abs(mOverLimitPct - mLatestOverLimitPct) > mLatestOverLimitPct * RENDER_ALLOWED_CHANGE_PCT) + else if ( (mPopUpDelayTimer.hasExpired() || is_visible) + && (mOverLimitPct > 0 || mLatestOverLimitPct > 0) + && std::abs(mOverLimitPct - mLatestOverLimitPct) > mLatestOverLimitPct * RENDER_ALLOWED_CHANGE_PCT + ) { // display in case of drop to/from zero and in case of significant (RENDER_ALLOWED_CHANGE_PCT) changes display_notification = true; diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 5e342099d7..11b619ba00 100755 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -862,10 +862,8 @@ void LLSpatialGroup::handleDestruction(const TreeNode* node) { if (bridge->mAvatar.notNull()) { - bridge->mAvatar->mAttachmentGeometryBytes -= mGeometryBytes; - bridge->mAvatar->mAttachmentGeometryBytes = llmax(bridge->mAvatar->mAttachmentGeometryBytes, 0); - bridge->mAvatar->mAttachmentSurfaceArea -= mSurfaceArea; - bridge->mAvatar->mAttachmentSurfaceArea = llmax(bridge->mAvatar->mAttachmentSurfaceArea, 0.f); + bridge->mAvatar->modifyAttachmentGeometryBytes( -mGeometryBytes ); + bridge->mAvatar->modifyAttachmentSurfaceArea( -mSurfaceArea ); } } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 86db3689c7..303b677dcf 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -182,7 +182,7 @@ const F32 NAMETAG_UPDATE_THRESHOLD = 0.3f; const F32 NAMETAG_VERTICAL_SCREEN_OFFSET = 25.f; const F32 NAMETAG_VERT_OFFSET_WEIGHT = 0.17f; -const S32 LLVOAvatar::VISUAL_COMPLEXITY_UNKNOWN = 0; +const U32 LLVOAvatar::VISUAL_COMPLEXITY_UNKNOWN = 0; enum ERenderName { @@ -668,8 +668,8 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, LLAvatarAppearance(&gAgentWearables), LLViewerObject(id, pcode, regionp), mSpecialRenderMode(0), - mAttachmentGeometryBytes(-1), - mAttachmentSurfaceArea(-1.f), + mAttachmentGeometryBytes(0), + mAttachmentSurfaceArea(0.f), mReportedVisualComplexity(VISUAL_COMPLEXITY_UNKNOWN), mTurning(FALSE), mLastSkeletonSerialNum( 0 ), @@ -8283,6 +8283,16 @@ void LLVOAvatar::idleUpdateRenderComplexity() } } +void LLVOAvatar::modifyAttachmentGeometryBytes(S32 delta) +{ + mAttachmentGeometryBytes = llmax(mAttachmentGeometryBytes + delta, 0); +} + +void LLVOAvatar::modifyAttachmentSurfaceArea(F32 delta) +{ + F32 newval = mAttachmentSurfaceArea + delta; + mAttachmentSurfaceArea = ( newval > 0.0 ? newval : 0.0 ); +} void LLVOAvatar::updateVisualComplexity() { diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index a49aa73035..5f690be4c5 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -253,15 +253,17 @@ public: void addNameTagLine(const std::string& line, const LLColor4& color, S32 style, const LLFontGL* font); void idleUpdateRenderComplexity(); void calculateUpdateRenderComplexity(); - static const S32 VISUAL_COMPLEXITY_UNKNOWN; + static const U32 VISUAL_COMPLEXITY_UNKNOWN; void updateVisualComplexity(); - S32 getVisualComplexity() { return mVisualComplexity; }; // Numbers calculated here by rendering AV + U32 getVisualComplexity() { return mVisualComplexity; }; // Numbers calculated here by rendering AV S32 getAttachmentGeometryBytes() { return mAttachmentGeometryBytes; }; // number of bytes in attached geometry + void modifyAttachmentGeometryBytes(S32 delta); F32 getAttachmentSurfaceArea() { return mAttachmentSurfaceArea; }; // estimated surface area of attachments + void modifyAttachmentSurfaceArea(F32 delta); - S32 getReportedVisualComplexity() { return mReportedVisualComplexity; }; // Numbers as reported by the SL server - void setReportedVisualComplexity(S32 value) { mReportedVisualComplexity = value; }; + U32 getReportedVisualComplexity() { return mReportedVisualComplexity; }; // Numbers as reported by the SL server + void setReportedVisualComplexity(U32 value) { mReportedVisualComplexity = value; }; S32 getUpdatePeriod() { return mUpdatePeriod; }; const LLColor4 & getMutedAVColor() { return mMutedAVColor; }; @@ -405,10 +407,10 @@ public: static void destroyGL(); static void restoreGL(); S32 mSpecialRenderMode; // special lighting + + private: S32 mAttachmentGeometryBytes; //number of bytes in attached geometry F32 mAttachmentSurfaceArea; //estimated surface area of attachments - -private: bool shouldAlphaMask(); BOOL mNeedsSkin; // avatar has been animated and verts have not been updated @@ -418,9 +420,9 @@ private: S32 mNumInitFaces; //number of faces generated when creating the avatar drawable, does not inculde splitted faces due to long vertex buffer. // the isTooComplex method uses these mutable values to avoid recalculating too frequently - mutable S32 mVisualComplexity; + mutable U32 mVisualComplexity; mutable bool mVisualComplexityStale; - S32 mReportedVisualComplexity; // from other viewers through the simulator + U32 mReportedVisualComplexity; // from other viewers through the simulator VisualMuteSettings mVisuallyMuteSetting; // Always or never visually mute this AV diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 0432f6f27c..160e2fbdb3 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4703,10 +4703,8 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (pAvatarVO) { - pAvatarVO->mAttachmentGeometryBytes -= group->mGeometryBytes; - pAvatarVO->mAttachmentGeometryBytes = llmax(pAvatarVO->mAttachmentGeometryBytes, 0); - pAvatarVO->mAttachmentSurfaceArea -= group->mSurfaceArea; - pAvatarVO->mAttachmentSurfaceArea = llmax(pAvatarVO->mAttachmentSurfaceArea, 0.f); + pAvatarVO->modifyAttachmentGeometryBytes( -group->mGeometryBytes ); + pAvatarVO->modifyAttachmentSurfaceArea( -group->mSurfaceArea ); } group->mGeometryBytes = 0; @@ -5260,24 +5258,10 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (pAvatarVO) { - if (pAvatarVO->mAttachmentGeometryBytes < 0) - { // First time through value is -1 - pAvatarVO->mAttachmentGeometryBytes = group->mGeometryBytes; - } - else - { - pAvatarVO->mAttachmentGeometryBytes += group->mGeometryBytes; - } - if (pAvatarVO->mAttachmentSurfaceArea < 0.f) - { // First time through value is -1 - pAvatarVO->mAttachmentSurfaceArea = group->mSurfaceArea; - } - else - { - pAvatarVO->mAttachmentSurfaceArea += group->mSurfaceArea; + pAvatarVO->modifyAttachmentGeometryBytes( group->mGeometryBytes ); + pAvatarVO->modifyAttachmentSurfaceArea( group->mSurfaceArea ); } } -} static LLTrace::BlockTimerStatHandle FTM_REBUILD_MESH_FLUSH("Flush Mesh"); |