diff options
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r-- | indra/newview/llvoavatar.cpp | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7079adbd14..32723dfe3d 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3190,26 +3190,29 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) { // muted avatars update at 16 hz mUpdatePeriod = 16; } - else if (mVisibilityRank <= LLVOAvatar::sMaxVisible) + else if (visible && mVisibilityRank <= LLVOAvatar::sMaxVisible) { //first 25% of max visible avatars are not impostored mUpdatePeriod = 1; } - else if (mVisibilityRank > LLVOAvatar::sMaxVisible * 4) + else if (visible && mVisibilityRank > LLVOAvatar::sMaxVisible * 4) { //background avatars are REALLY slow updating impostors mUpdatePeriod = 16; } - else if (mVisibilityRank > LLVOAvatar::sMaxVisible * 3) + else if (visible && mVisibilityRank > LLVOAvatar::sMaxVisible * 3) { //back 25% of max visible avatars are slow updating impostors mUpdatePeriod = 8; } - else if (mImpostorPixelArea <= impostor_area) + else if (visible && mImpostorPixelArea <= impostor_area) { // stuff in between gets an update period based on pixel area mUpdatePeriod = llclamp((S32) sqrtf(impostor_area*4.f/mImpostorPixelArea), 2, 8); } + else if (visible && mVisibilityRank > LLVOAvatar::sMaxVisible) + { // force nearby impostors in ultra crowded areas + mUpdatePeriod = 2; + } else - { - //nearby avatars, update the impostors more frequently. - mUpdatePeriod = 4; + { // not impostored + mUpdatePeriod = 1; } visible = (LLDrawable::getCurrentFrame()+mID.mData[0])%mUpdatePeriod == 0 ? TRUE : FALSE; @@ -4187,7 +4190,7 @@ void LLVOAvatar::updateTextures() } } } - if (isIndexBakedTexture((ETextureIndex) texture_index)) + if (isIndexBakedTexture((ETextureIndex) texture_index) && render_avatar) { const S32 boost_level = getAvatarBakedBoostLevel(); imagep = LLViewerTextureManager::staticCastToFetchedTexture(getImage(texture_index,0), TRUE); @@ -4252,7 +4255,7 @@ void LLVOAvatar::checkTextureLoading() { return ; //have not been invisible for enough time. } - + for(LLLoadedCallbackEntry::source_callback_list_t::iterator iter = mCallbackTextureList.begin(); iter != mCallbackTextureList.end(); ++iter) { @@ -4269,7 +4272,10 @@ void LLVOAvatar::checkTextureLoading() } else//unpause { - tex->unpauseLoadedCallbacks(&mCallbackTextureList) ; + static const F32 START_AREA = 100.f ; + + tex->unpauseLoadedCallbacks(&mCallbackTextureList) ; + tex->addTextureStats(START_AREA); //jump start the fetching again } } } @@ -4282,14 +4288,12 @@ void LLVOAvatar::checkTextureLoading() return ; } -const F32 SELF_ADDITIONAL_PRI = 0.75f ; -const F32 ADDITIONAL_PRI = 0.5f; void LLVOAvatar::addBakedTextureStats( LLViewerFetchedTexture* imagep, F32 pixel_area, F32 texel_area_ratio, S32 boost_level) { //Note: //if this function is not called for the last MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL frames, //the texture pipeline will stop fetching this texture. - + imagep->resetTextureStats(); imagep->setCanUseHTTP(false) ; //turn off http fetching for baked textures. imagep->setMaxVirtualSizeResetInterval(MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL); @@ -4299,14 +4303,9 @@ void LLVOAvatar::addBakedTextureStats( LLViewerFetchedTexture* imagep, F32 pixel mMinPixelArea = llmin(pixel_area, mMinPixelArea); imagep->addTextureStats(pixel_area / texel_area_ratio); imagep->setBoostLevel(boost_level); - - if(boost_level != LLViewerTexture::BOOST_AVATAR_BAKED_SELF) - { - imagep->setAdditionalDecodePriority(ADDITIONAL_PRI) ; - } - else + if(boost_level == LLViewerTexture::BOOST_AVATAR_BAKED_SELF) { - imagep->setAdditionalDecodePriority(SELF_ADDITIONAL_PRI) ; + imagep->setAdditionalDecodePriority(1.0f) ; } } @@ -6220,7 +6219,7 @@ void LLVOAvatar::updateMeshTextures() } } - const BOOL self_customizing = isSelf() && !gAgentAvatarp->isUsingBakedTextures(); // During face edit mode, we don't use baked textures + const BOOL self_customizing = isSelf() && gAgentCamera.cameraCustomizeAvatar(); // During face edit mode, we don't use baked textures const BOOL other_culled = !isSelf() && mCulled; LLLoadedCallbackEntry::source_callback_list_t* src_callback_list = NULL ; BOOL paused = FALSE; @@ -7313,7 +7312,7 @@ void LLVOAvatar::cullAvatarsByPixelArea() std::sort(LLCharacter::sInstances.begin(), LLCharacter::sInstances.end(), CompareScreenAreaGreater()); // Update the avatars that have changed status - U32 rank = 2; //1 is reserved for self. + U32 rank = 0; for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin(); iter != LLCharacter::sInstances.end(); ++iter) { @@ -7337,7 +7336,7 @@ void LLVOAvatar::cullAvatarsByPixelArea() if (inst->isSelf()) { - inst->setVisibilityRank(1); + inst->setVisibilityRank(0); } else if (inst->mDrawable.notNull() && inst->mDrawable->isVisible()) { |