From 5c7e91f62fb8d76f437a751503c4e40f0c0fedf1 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 8 Apr 2020 14:40:01 +0100 Subject: SL-12996 - replace checks of VisualMuteSettings with OverallAppearance --- indra/newview/pipeline.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/pipeline.cpp') diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index bec33790bd..bfcc74dc70 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -3125,7 +3125,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; } -- cgit v1.3 From 98d93bcacfe21530f44346674966a36ad6a80251 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 13 May 2020 15:10:04 +0100 Subject: SL-13000 - jellydoll param management --- indra/newview/llvoavatar.cpp | 47 +++++++++++++++++++++++++++++++++++++++++++- indra/newview/llvoavatar.h | 1 + indra/newview/pipeline.cpp | 7 ++++--- 3 files changed, 51 insertions(+), 4 deletions(-) (limited to 'indra/newview/pipeline.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index a56862718f..12ab8e9964 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2012,6 +2012,42 @@ void LLVOAvatar::resetVisualParams() } } +void LLVOAvatar::applyDefaultParams() +{ + // force params to intermediate vals + S32 num_blocks = 253; + LLVisualParam* param = getFirstVisualParam(); + llassert(param); // if this ever fires, we should do the same as when num_blocks<=1 + if (!param) + { + LL_WARNS() << "No visual params!" << LL_ENDL; + } + else + { + for( S32 i = 0; i < num_blocks; i++ ) + { + while( param && ((param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE) && + (param->getGroup() != VISUAL_PARAM_GROUP_TRANSMIT_NOT_TWEAKABLE)) ) // should not be any of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT + { + param = getNextVisualParam(); + } + + if( !param ) + { + // more visual params supplied than expected - just process what we know about + break; + } + + U8 value = 127; + F32 newWeight = U8_to_F32(value, param->getMinWeight(), param->getMaxWeight()); + param->setWeight(newWeight); + + param = getNextVisualParam(); + } + } + +} + //----------------------------------------------------------------------------- // resetSkeleton() //----------------------------------------------------------------------------- @@ -2082,6 +2118,10 @@ void LLVOAvatar::resetSkeleton(bool reset_animations) applyParsedAppearanceMessage(*mLastProcessedAppearance, slam_params); } } + else + { + applyDefaultParams(); + } updateVisualParams(); // Restore attachment pos overrides @@ -8998,7 +9038,11 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) mLastProcessedAppearance = contents; bool slam_params = false; - applyParsedAppearanceMessage(*contents, slam_params); + applyParsedAppearanceMessage(*contents, slam_params); + if (getOverallAppearance() != AOA_NORMAL) + { + resetSkeleton(false); + } } void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& contents, bool slam_params) @@ -10574,6 +10618,7 @@ void LLVOAvatar::setOverallAppearanceNormal() void LLVOAvatar::setOverallAppearanceJellyDoll() { resetSkeleton(false); + // stop current animations { for ( LLVOAvatar::AnimIterator anim_it= mPlayingAnimations.begin(); diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index ee7f3d6dca..28db007d56 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -407,6 +407,7 @@ public: void initAttachmentPoints(bool ignore_hud_joints = false); /*virtual*/ void buildCharacter(); void resetVisualParams(); + void applyDefaultParams(); void resetSkeleton(bool reset_animations); LLVector3 mCurRootToHeadOffset; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 30c2cbeb95..eb8da6e3ce 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -3084,9 +3084,10 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) if (vobj) // this test may not be needed, see above { LLVOAvatar* av = vobj->asAvatar(); - if (av && (av->isImpostor() - || av->isInMuteList() - || (LLVOAvatar::AOA_NORMAL != av->getOverallAppearance() && !av->needsImpostorUpdate()) )) + if (av && + (av->isImpostor() + || av->isInMuteList() + || (LLVOAvatar::AOA_JELLYDOLL == av->getOverallAppearance() && !av->needsImpostorUpdate()) )) { return; } -- cgit v1.3 From 00ab8eb6e6f1958a41ec9d6cfbdda0dd85f1dd8a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 15 Oct 2020 18:34:15 +0100 Subject: SL-14130 - WIP, notes on impostor state management --- indra/newview/llvoavatar.cpp | 11 +++++++++-- indra/newview/pipeline.cpp | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'indra/newview/pipeline.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index f45c3c86a1..cbadf4bcda 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2763,6 +2763,9 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update) BOOL visible = isVisible() || mNeedsAnimUpdate; // update attachments positions + // FIXME what does sUseImpostors do + // here? Shouldn't behavior be based on state of this avatar, + // rather than some piece of global state? if (detailed_update || !sUseImpostors) { LL_RECORD_BLOCK_TIME(FTM_ATTACHMENT_UPDATE); @@ -3995,7 +3998,7 @@ void LLVOAvatar::computeUpdatePeriod() && isVisible() && (!isSelf() || visually_muted) && !isUIAvatar() - && sUseImpostors + && sUseImpostors // FIXME && !mNeedsAnimUpdate && !sFreezeCounter) { @@ -10240,6 +10243,7 @@ void LLVOAvatar::updateImpostors() for (std::vector::iterator iter = instances_copy.begin(); iter != instances_copy.end(); ++iter) { + // FIXME state spaghetti! Can we just use shouldImpostor() here? LLVOAvatar* avatar = (LLVOAvatar*) *iter; if (!avatar->isDead() && avatar->isVisible() @@ -10257,11 +10261,14 @@ void LLVOAvatar::updateImpostors() // virtual BOOL LLVOAvatar::isImpostor() { - return sUseImpostors && (isVisuallyMuted() || (mUpdatePeriod >= IMPOSTOR_PERIOD)) ? TRUE : FALSE; + // FIXME this doesn't seem to actually mean that the avatar is currently shown as an impostor, or should be. + // un-impostored avs have mUpdatePeriod 1. IMPOSTOR_PERIOD is 2. + return sUseImpostors && (isVisuallyMuted() || (mUpdatePeriod >= IMPOSTOR_PERIOD)); } BOOL LLVOAvatar::shouldImpostor(const U32 rank_factor) const { + // FIXME sUseImpostors question return (!isSelf() && sUseImpostors && mVisibilityRank > (sMaxNonImpostors * rank_factor)); } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 82ae99309d..05f9f7800d 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -10920,6 +10920,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) { LL_RECORD_BLOCK_TIME(FTM_IMPOSTOR_MARK_VISIBLE); markVisible(avatar->mDrawable, *viewer_camera); + // FIXME temporarily hacked during impostor generation?? LLVOAvatar::sUseImpostors = false; // @TODO ??? LLVOAvatar::attachment_map_t::iterator iter; @@ -11160,6 +11161,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) avatar->setImpostorDim(tdim); + // FIXME restored here. Where is this temp hack used?? LLVOAvatar::sUseImpostors = (0 != LLVOAvatar::sMaxNonImpostors); sUseOcclusion = occlusion; sReflectionRender = false; -- cgit v1.3 From 9618df484b7659ed84285a9c16939b384dbe616c Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 16 Oct 2020 20:47:00 +0300 Subject: SL-14130 Jellydolls have wrong appearance when non-impostors is uncapped --- indra/newview/lldrawable.cpp | 5 +++-- indra/newview/lldrawpoolavatar.cpp | 4 ++-- indra/newview/llvoavatar.cpp | 14 +++++++------- indra/newview/llvoavatar.h | 4 ++-- indra/newview/pipeline.cpp | 7 ++++--- indra/newview/pipeline.h | 1 + 6 files changed, 19 insertions(+), 16 deletions(-) (limited to 'indra/newview/pipeline.cpp') diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 2219f20272..c65cfe91be 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -1485,7 +1485,7 @@ void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector* LLVOAvatar* avatarp = (LLVOAvatar*) objparent; if (avatarp->isVisible()) { - impostor = objparent->isAvatar() && ((LLVOAvatar*) objparent)->isImpostor(); + impostor = objparent->isAvatar() && !LLPipeline::sImpostorRenderAVVO && ((LLVOAvatar*) objparent)->isImpostor(); loaded = objparent->isAvatar() && ((LLVOAvatar*) objparent)->isFullyLoaded(); } else @@ -1569,7 +1569,8 @@ void LLSpatialBridge::updateDistance(LLCamera& camera_in, bool force_update) if (mDrawable->getVObj()) { - if (mDrawable->getVObj()->isAttachment()) + // Don't update if we are part of impostor, unles it's an impostor pass + if (!LLPipeline::sImpostorRenderAVVO && mDrawable->getVObj()->isAttachment()) { LLDrawable* parent = mDrawable->getParent(); if (parent && parent->getVObj()) diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 11f7809574..8abec252a1 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -574,7 +574,7 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) return; } LLVOAvatar::AvatarOverallAppearance oa = avatarp->getOverallAppearance(); - BOOL impostor = avatarp->isImpostor(); + BOOL impostor = !LLPipeline::sImpostorRenderAVVO && avatarp->isImpostor(); if (oa == LLVOAvatar::AOA_INVISIBLE || (impostor && oa == LLVOAvatar::AOA_JELLYDOLL)) { @@ -1511,7 +1511,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) return; } - BOOL impostor = avatarp->isImpostor() && !single_avatar; + BOOL impostor = !LLPipeline::sImpostorRenderAVVO && avatarp->isImpostor() && !single_avatar; if (( avatarp->isInMuteList() || impostor diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index f45c3c86a1..9ac52120d3 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2763,7 +2763,7 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update) BOOL visible = isVisible() || mNeedsAnimUpdate; // update attachments positions - if (detailed_update || !sUseImpostors) + if (detailed_update) { LL_RECORD_BLOCK_TIME(FTM_ATTACHMENT_UPDATE); for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); @@ -3608,7 +3608,7 @@ bool LLVOAvatar::isVisuallyMuted() { muted = true; } - else + else if (sUseImpostors) { muted = isTooComplex(); } @@ -3995,7 +3995,7 @@ void LLVOAvatar::computeUpdatePeriod() && isVisible() && (!isSelf() || visually_muted) && !isUIAvatar() - && sUseImpostors + && (sUseImpostors || visually_muted) && !mNeedsAnimUpdate && !sFreezeCounter) { @@ -10050,7 +10050,7 @@ BOOL LLVOAvatar::updateLOD() return FALSE; } - if (isImpostor() && 0 != mDrawable->getNumFaces() && mDrawable->getFace(0)->hasGeometry()) + if (!LLPipeline::sImpostorRenderAVVO && isImpostor() && 0 != mDrawable->getNumFaces() && mDrawable->getFace(0)->hasGeometry()) { return TRUE; } @@ -10257,12 +10257,12 @@ void LLVOAvatar::updateImpostors() // virtual BOOL LLVOAvatar::isImpostor() { - return sUseImpostors && (isVisuallyMuted() || (mUpdatePeriod >= IMPOSTOR_PERIOD)) ? TRUE : FALSE; + return (isVisuallyMuted() || (sUseImpostors && (mUpdatePeriod >= IMPOSTOR_PERIOD))) ? TRUE : FALSE; } -BOOL LLVOAvatar::shouldImpostor(const U32 rank_factor) const +BOOL LLVOAvatar::shouldImpostor(const U32 rank_factor) { - return (!isSelf() && sUseImpostors && mVisibilityRank > (sMaxNonImpostors * rank_factor)); + return (!isSelf() && (sUseImpostors || isVisuallyMuted()) && mVisibilityRank > (sMaxNonImpostors * rank_factor)); } BOOL LLVOAvatar::needsImpostorUpdate() const diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 8d23d955e3..af65e5750f 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -320,7 +320,7 @@ public: static U32 sMaxNonImpostors; //(affected by control "RenderAvatarMaxNonImpostors") static F32 sRenderDistance; //distance at which avatars will render. static BOOL sShowAnimationDebug; // show animation debug info - static bool sUseImpostors; //use impostors for far away avatars + static bool sUseImpostors; //use impostors for far away avatars, impostors are always on for 'mute' list static BOOL sShowFootPlane; // show foot collision plane reported by server static BOOL sShowCollisionVolumes; // show skeletal collision volumes static BOOL sVisibleInFirstPerson; @@ -554,7 +554,7 @@ private: //-------------------------------------------------------------------- public: virtual BOOL isImpostor(); - BOOL shouldImpostor(const U32 rank_factor = 1) const; + BOOL shouldImpostor(const U32 rank_factor = 1); BOOL needsImpostorUpdate() const; const LLVector3& getImpostorOffset() const; const LLVector2& getImpostorDim() const; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 82ae99309d..3fa40c4ecf 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -340,6 +340,7 @@ bool LLPipeline::sRenderGlow = false; bool LLPipeline::sReflectionRender = false; bool LLPipeline::sDistortionRender = false; bool LLPipeline::sImpostorRender = false; +bool LLPipeline::sImpostorRenderAVVO = false; bool LLPipeline::sImpostorRenderAlphaDepthPass = false; bool LLPipeline::sUnderWaterRender = false; bool LLPipeline::sTextureBindTest = false; @@ -3076,7 +3077,7 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) { LLVOAvatar* av = vobj->asAvatar(); if (av && - (av->isImpostor() + ((!sImpostorRenderAVVO && av->isImpostor()) //ignore impostor flag during impostor pass || av->isInMuteList() || (LLVOAvatar::AOA_JELLYDOLL == av->getOverallAppearance() && !av->needsImpostorUpdate()) )) { @@ -10920,7 +10921,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) { LL_RECORD_BLOCK_TIME(FTM_IMPOSTOR_MARK_VISIBLE); markVisible(avatar->mDrawable, *viewer_camera); - LLVOAvatar::sUseImpostors = false; // @TODO ??? + sImpostorRenderAVVO = true; LLVOAvatar::attachment_map_t::iterator iter; for (iter = avatar->mAttachmentPoints.begin(); @@ -11160,7 +11161,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) avatar->setImpostorDim(tdim); - LLVOAvatar::sUseImpostors = (0 != LLVOAvatar::sMaxNonImpostors); + sImpostorRenderAVVO = false; sUseOcclusion = occlusion; sReflectionRender = false; sImpostorRender = false; diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 600bdd9d06..397c5ef9ff 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -590,6 +590,7 @@ public: static bool sReflectionRender; static bool sDistortionRender; static bool sImpostorRender; + static bool sImpostorRenderAVVO; static bool sImpostorRenderAlphaDepthPass; static bool sUnderWaterRender; static bool sRenderGlow; -- cgit v1.3 From caea7260c73eb606bb8b349debadf6682dbdb3a8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 20 Oct 2020 13:51:58 +0100 Subject: SL-14142 - impostor management cleanup --- indra/llappearance/llavatarappearancedefines.cpp | 1 - indra/llappearance/llavatarappearancedefines.h | 1 - indra/newview/lldrawable.cpp | 4 +-- indra/newview/lldrawpoolavatar.cpp | 4 +-- indra/newview/llfloaterpreference.cpp | 4 +-- indra/newview/llvoavatar.cpp | 32 +++++++++++++----------- indra/newview/llvoavatar.h | 6 ++--- indra/newview/pipeline.cpp | 5 +--- indra/newview/pipeline.h | 1 - 9 files changed, 27 insertions(+), 31 deletions(-) (limited to 'indra/newview/pipeline.cpp') diff --git a/indra/llappearance/llavatarappearancedefines.cpp b/indra/llappearance/llavatarappearancedefines.cpp index c72943bb82..0109ff7dd7 100644 --- a/indra/llappearance/llavatarappearancedefines.cpp +++ b/indra/llappearance/llavatarappearancedefines.cpp @@ -30,7 +30,6 @@ const S32 LLAvatarAppearanceDefines::SCRATCH_TEX_WIDTH = 1024; const S32 LLAvatarAppearanceDefines::SCRATCH_TEX_HEIGHT = 1024; -const S32 LLAvatarAppearanceDefines::IMPOSTOR_PERIOD = 2; using namespace LLAvatarAppearanceDefines; diff --git a/indra/llappearance/llavatarappearancedefines.h b/indra/llappearance/llavatarappearancedefines.h index 5663d24293..aae56d7bd4 100644 --- a/indra/llappearance/llavatarappearancedefines.h +++ b/indra/llappearance/llavatarappearancedefines.h @@ -39,7 +39,6 @@ namespace LLAvatarAppearanceDefines extern const S32 SCRATCH_TEX_WIDTH; extern const S32 SCRATCH_TEX_HEIGHT; -extern const S32 IMPOSTOR_PERIOD; static const U32 AVATAR_HOVER = 11001; diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index c65cfe91be..5034bd1c5e 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -1485,7 +1485,7 @@ void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector* LLVOAvatar* avatarp = (LLVOAvatar*) objparent; if (avatarp->isVisible()) { - impostor = objparent->isAvatar() && !LLPipeline::sImpostorRenderAVVO && ((LLVOAvatar*) objparent)->isImpostor(); + impostor = objparent->isAvatar() && !LLPipeline::sImpostorRender && ((LLVOAvatar*) objparent)->isImpostor(); loaded = objparent->isAvatar() && ((LLVOAvatar*) objparent)->isFullyLoaded(); } else @@ -1570,7 +1570,7 @@ void LLSpatialBridge::updateDistance(LLCamera& camera_in, bool force_update) if (mDrawable->getVObj()) { // Don't update if we are part of impostor, unles it's an impostor pass - if (!LLPipeline::sImpostorRenderAVVO && mDrawable->getVObj()->isAttachment()) + if (!LLPipeline::sImpostorRender && mDrawable->getVObj()->isAttachment()) { LLDrawable* parent = mDrawable->getParent(); if (parent && parent->getVObj()) diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 8abec252a1..ff036e1934 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -574,7 +574,7 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) return; } LLVOAvatar::AvatarOverallAppearance oa = avatarp->getOverallAppearance(); - BOOL impostor = !LLPipeline::sImpostorRenderAVVO && avatarp->isImpostor(); + BOOL impostor = !LLPipeline::sImpostorRender && avatarp->isImpostor(); if (oa == LLVOAvatar::AOA_INVISIBLE || (impostor && oa == LLVOAvatar::AOA_JELLYDOLL)) { @@ -1511,7 +1511,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) return; } - BOOL impostor = !LLPipeline::sImpostorRenderAVVO && avatarp->isImpostor() && !single_avatar; + BOOL impostor = !LLPipeline::sImpostorRender && avatarp->isImpostor() && !single_avatar; if (( avatarp->isInMuteList() || impostor diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 96094dcf14..c1f1fc5783 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1473,7 +1473,7 @@ void LLAvatarComplexityControls::setIndirectMaxNonImpostors() { U32 max_non_impostors = gSavedSettings.getU32("RenderAvatarMaxNonImpostors"); // for this one, we just need to make zero, which means off, the max value of the slider - U32 indirect_max_non_impostors = (0 == max_non_impostors) ? LLVOAvatar::IMPOSTORS_OFF : max_non_impostors; + U32 indirect_max_non_impostors = (0 == max_non_impostors) ? LLVOAvatar::NON_IMPOSTORS_MAX_SLIDER : max_non_impostors; gSavedSettings.setU32("IndirectMaxNonImpostors", indirect_max_non_impostors); } @@ -1973,7 +1973,7 @@ void LLFloaterPreferenceGraphicsAdvanced::updateMaxNonImpostors() LLSliderCtrl* ctrl = getChild("IndirectMaxNonImpostors",true); U32 value = ctrl->getValue().asInteger(); - if (0 == value || LLVOAvatar::IMPOSTORS_OFF <= value) + if (0 == value || LLVOAvatar::NON_IMPOSTORS_MAX_SLIDER <= value) { value=0; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 6ade882258..e2a42a5dd3 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -4029,7 +4029,7 @@ void LLVOAvatar::computeUpdatePeriod() // impostor camera near clip plane mUpdatePeriod = 1; } - else if ( shouldImpostor(4) ) + else if ( shouldImpostor(4.0) ) { //background avatars are REALLY slow updating impostors mUpdatePeriod = 16; } @@ -4038,7 +4038,7 @@ void LLVOAvatar::computeUpdatePeriod() // Don't update cloud avatars too often mUpdatePeriod = 8; } - else if ( shouldImpostor(3) ) + else if ( shouldImpostor(3.0) ) { //back 25% of max visible avatars are slow updating impostors mUpdatePeriod = 8; } @@ -4046,7 +4046,7 @@ void LLVOAvatar::computeUpdatePeriod() { // stuff in between gets an update period based on pixel area mUpdatePeriod = llclamp((S32) sqrtf(impostor_area*4.f/mImpostorPixelArea), 2, 8); } - else + else // shouldImpostor() at some rank in range (1.0-3.0) { //nearby avatars, update the impostors more frequently. mUpdatePeriod = 4; @@ -10063,7 +10063,7 @@ BOOL LLVOAvatar::updateLOD() return FALSE; } - if (!LLPipeline::sImpostorRenderAVVO && isImpostor() && 0 != mDrawable->getNumFaces() && mDrawable->getFace(0)->hasGeometry()) + if (!LLPipeline::sImpostorRender && isImpostor() && 0 != mDrawable->getNumFaces() && mDrawable->getFace(0)->hasGeometry()) { return TRUE; } @@ -10253,7 +10253,6 @@ void LLVOAvatar::updateImpostors() for (std::vector::iterator iter = instances_copy.begin(); iter != instances_copy.end(); ++iter) { - // FIXME state spaghetti! Can we just use shouldImpostor() here? LLVOAvatar* avatar = (LLVOAvatar*) *iter; if (!avatar->isDead() && avatar->isVisible() @@ -10271,17 +10270,20 @@ void LLVOAvatar::updateImpostors() // virtual BOOL LLVOAvatar::isImpostor() { - // FIXME this doesn't seem to actually mean that the avatar is currently shown as an impostor, or should be. - // un-impostored avs have mUpdatePeriod 1. IMPOSTOR_PERIOD is 2. - //return sUseImpostors && (isVisuallyMuted() || (mUpdatePeriod >= IMPOSTOR_PERIOD)); - return (isVisuallyMuted() || (sUseImpostors && (mUpdatePeriod >= IMPOSTOR_PERIOD))) ? TRUE : FALSE; + return isVisuallyMuted() || (sUseImpostors && (mUpdatePeriod > 1)); } -BOOL LLVOAvatar::shouldImpostor(const U32 rank_factor) +BOOL LLVOAvatar::shouldImpostor(const F32 rank_factor) { - // FIXME sUseImpostors question - //return (!isSelf() && sUseImpostors && mVisibilityRank > (sMaxNonImpostors * rank_factor)); - return (!isSelf() && (sUseImpostors || isVisuallyMuted()) && mVisibilityRank > (sMaxNonImpostors * rank_factor)); + if (isSelf()) + { + return false; + } + if (isVisuallyMuted()) + { + return true; + } + return sUseImpostors && (mVisibilityRank > (sMaxNonImpostors * rank_factor)); } BOOL LLVOAvatar::needsImpostorUpdate() const @@ -10324,7 +10326,7 @@ void LLVOAvatar::getImpostorValues(LLVector4a* extents, LLVector3& angle, F32& d } // static -const U32 LLVOAvatar::IMPOSTORS_OFF = 66; /* Must equal the maximum allowed the RenderAvatarMaxNonImpostors +const U32 LLVOAvatar::NON_IMPOSTORS_MAX_SLIDER = 66; /* Must equal the maximum allowed the RenderAvatarMaxNonImpostors * slider in panel_preferences_graphics1.xml */ // static @@ -10333,7 +10335,7 @@ void LLVOAvatar::updateImpostorRendering(U32 newMaxNonImpostorsValue) U32 oldmax = sMaxNonImpostors; bool oldflg = sUseImpostors; - if (IMPOSTORS_OFF <= newMaxNonImpostorsValue) + if (NON_IMPOSTORS_MAX_SLIDER <= newMaxNonImpostorsValue) { sMaxNonImpostors = 0; } diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 7f816d6a2e..b76d6abacd 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -315,8 +315,8 @@ public: public: static S32 sRenderName; static BOOL sRenderGroupTitles; - static const U32 IMPOSTORS_OFF; /* Must equal the maximum allowed the RenderAvatarMaxNonImpostors - * slider in panel_preferences_graphics1.xml */ + static const U32 NON_IMPOSTORS_MAX_SLIDER; /* Must equal the maximum allowed the RenderAvatarMaxNonImpostors + * slider in panel_preferences_graphics1.xml */ static U32 sMaxNonImpostors; //(affected by control "RenderAvatarMaxNonImpostors") static F32 sRenderDistance; //distance at which avatars will render. static BOOL sShowAnimationDebug; // show animation debug info @@ -554,7 +554,7 @@ private: //-------------------------------------------------------------------- public: virtual BOOL isImpostor(); - BOOL shouldImpostor(const U32 rank_factor = 1); + BOOL shouldImpostor(const F32 rank_factor = 1.0); BOOL needsImpostorUpdate() const; const LLVector3& getImpostorOffset() const; const LLVector2& getImpostorDim() const; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 4cbe5a29be..f518a2d466 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -340,7 +340,6 @@ bool LLPipeline::sRenderGlow = false; bool LLPipeline::sReflectionRender = false; bool LLPipeline::sDistortionRender = false; bool LLPipeline::sImpostorRender = false; -bool LLPipeline::sImpostorRenderAVVO = false; bool LLPipeline::sImpostorRenderAlphaDepthPass = false; bool LLPipeline::sUnderWaterRender = false; bool LLPipeline::sTextureBindTest = false; @@ -3077,7 +3076,7 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) { LLVOAvatar* av = vobj->asAvatar(); if (av && - ((!sImpostorRenderAVVO && av->isImpostor()) //ignore impostor flag during impostor pass + ((!sImpostorRender && av->isImpostor()) //ignore impostor flag during impostor pass || av->isInMuteList() || (LLVOAvatar::AOA_JELLYDOLL == av->getOverallAppearance() && !av->needsImpostorUpdate()) )) { @@ -10921,7 +10920,6 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) { LL_RECORD_BLOCK_TIME(FTM_IMPOSTOR_MARK_VISIBLE); markVisible(avatar->mDrawable, *viewer_camera); - sImpostorRenderAVVO = true; LLVOAvatar::attachment_map_t::iterator iter; for (iter = avatar->mAttachmentPoints.begin(); @@ -11161,7 +11159,6 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) avatar->setImpostorDim(tdim); - sImpostorRenderAVVO = false; sUseOcclusion = occlusion; sReflectionRender = false; sImpostorRender = false; diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 397c5ef9ff..600bdd9d06 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -590,7 +590,6 @@ public: static bool sReflectionRender; static bool sDistortionRender; static bool sImpostorRender; - static bool sImpostorRenderAVVO; static bool sImpostorRenderAlphaDepthPass; static bool sUnderWaterRender; static bool sRenderGlow; -- cgit v1.3