diff --git a/indra/llrender/llgltexture.cpp b/indra/llrender/llgltexture.cpp index 89f2a75002..5f645b9d76 100644 --- a/indra/llrender/llgltexture.cpp +++ b/indra/llrender/llgltexture.cpp @@ -104,6 +104,12 @@ void LLGLTexture::setBoostLevel(S32 level) if(mBoostLevel != LLGLTexture::BOOST_NONE && mBoostLevel != LLGLTexture::BOOST_ICON && mBoostLevel != LLGLTexture::BOOST_THUMBNAIL + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Add the new grass, light and tree boosts + && mBoostLevel != LLGLTexture::BOOST_GRASS + && mBoostLevel != LLGLTexture::BOOST_LIGHT + && mBoostLevel != LLGLTexture::BOOST_TREE + // [FIRE-35081] && mBoostLevel != LLGLTexture::BOOST_TERRAIN) { setNoDelete() ; diff --git a/indra/llrender/llgltexture.h b/indra/llrender/llgltexture.h index 3cf97d5c6b..65911e92a7 100644 --- a/indra/llrender/llgltexture.h +++ b/indra/llrender/llgltexture.h @@ -53,6 +53,11 @@ public: BOOST_AVATAR_BAKED , BOOST_TERRAIN , // Needed for minimap generation for now. Lower than BOOST_HIGH so the texture stats don't get forced, i.e. texture stats are manually managed by minimap/terrain instead. + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + BOOST_GRASS , // Grass has a alternative calculation for virtual and face sizes. + BOOST_TREE , // Tree has a alternative calculation for virtual and face sizes. + BOOST_LIGHT , // Light textures has a alternative calculation for virtual and face sizes. + // [FIRE-35081] BOOST_HIGH = 10, BOOST_SCULPTED , BOOST_BUMP , diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 42a3fdd5de..d27c8432f6 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -5955,8 +5955,8 @@ void LLAppViewer::idle() // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer // Added a max time limit to the object list updates as these updates do affect the texture system //gObjectList.updateApparentAngles(gAgent); - F32 max_update_apparent_angles = 0.0020f * gFrameIntervalSeconds.value(); // 20 ms/second decode time - max_update_apparent_angles = llclamp(max_update_apparent_angles, 0.00005f, 0.0002f); // min 2ms/frame, max 5ms/frame) + F32 max_update_apparent_angles = 0.025f * gFrameIntervalSeconds.value(); // 20 ms/second decode time + max_update_apparent_angles = llclamp(max_update_apparent_angles, 0.002f, 0.005f); // min 2ms/frame, max 5ms/frame) gObjectList.updateApparentAngles(gAgent, max_update_apparent_angles); // [FIRE-35081] } diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 4f95125c5c..5ffcc1a059 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -179,9 +179,9 @@ void LLFace::init(LLDrawable* drawablep, LLViewerObject* objp) mFaceColor = LLColor4(1,0,0,1); - mImportanceToCamera = 0.f ; + mImportanceToCamera = 1.f ; // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - mCloseToCamera = 0.0f; + mCloseToCamera = 1.0f; // [FIRE-35081] mBoundingSphereRadius = 0.0f ; @@ -386,6 +386,11 @@ void LLFace::switchTexture(U32 ch, LLViewerTexture* new_texture) return; } + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Need to update the new textures to the old textures boost and max virtual size, so they won't + new_texture->setBoostLevel(mTexture[ch]->getBoostLevel()); + new_texture->addTextureStats(mTexture[ch]->getMaxVirtualSize()); + // [FIRE-35081] if (ch == LLRender::DIFFUSE_MAP) { if (getViewerObject()) @@ -2332,6 +2337,10 @@ F32 LLFace::getTextureVirtualSize() } face_area = LLFace::adjustPixelArea(mImportanceToCamera, face_area); + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Remove the face area being affected by being partial off screen as close to screen textures can then become scaled down along with + // animated textures. + /* if(face_area > LLViewerTexture::sMinLargeImageSize) //if is large image, shrink face_area by considering the partial overlapping. { if(mImportanceToCamera > LEAST_IMPORTANCE_FOR_LARGE_IMAGE && mTexture[LLRender::DIFFUSE_MAP].notNull() && mTexture[LLRender::DIFFUSE_MAP]->isLargeImage()) @@ -2339,12 +2348,8 @@ F32 LLFace::getTextureVirtualSize() face_area *= adjustPartialOverlapPixelArea(cos_angle_to_view_dir, radius ); } } - - // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - // Remove the aspect ratio and FOV from the area of the face to remove the changes to the window size from affecting the calculations. - // So that textures are in the same space as the face. - //face_area = face_area * LLViewerCamera::getInstance()->getInverseAspect(); - // [FIRE-35081] + */ + // [FIRE-35081] setVirtualSize(face_area) ; return face_area; @@ -2483,7 +2488,10 @@ bool LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius) // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer // Added close to camera (based upon the mImportanceToCamera) where any object that is within the FACE_IMPORTANCE_TO_CAMERA_OVER_DISTANCE (16.1f) // gets an extra texture scaling up. - mCloseToCamera = dist <= FACE_IMPORTANCE_TO_CAMERA_OVER_DISTANCE[0][0] * camera->getDrawDistanceMultiplier() ? 1.0f : 0.0f; + // Use positive distance to the camera and apply the multiplier based upon the texture scaled for increase in the default draw distance + mCloseToCamera = (dist >= 0.0f && dist <= FACE_IMPORTANCE_TO_CAMERA_OVER_DISTANCE[0][0] * camera->getDrawDistanceMultiplier()) ? 1.0f : 0.0f; + // Check if the object is positive distance to the far plane and positive cos angle is in frustum + mInFrustum = (dist >= 0 && dist <= camera->getFar() && cos_angle_to_view_dir > 0.0f); // [FIRE-35081] //if has media, check if the face is out of the view frustum. @@ -2526,9 +2534,6 @@ bool LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius) else { mImportanceToCamera = LLFace::calcImportanceToCamera(cos_angle_to_view_dir, dist) ; - // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - mInFrustum = bool(mImportanceToCamera); // If the face is important to the camera, it is in the frustum - // [FIRE-35081] } return true ; @@ -2568,11 +2573,16 @@ F32 LLFace::calcImportanceToCamera(F32 cos_angle_to_view_dir, F32 dist) { LL_PROFILE_ZONE_SCOPED_CATEGORY_FACE; F32 importance = 0.f ; + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Move camera out to use for the inital check for the distance to the face importance with the multiplier + LLViewerCamera* camera = LLViewerCamera::getInstance(); - if(cos_angle_to_view_dir > LLViewerCamera::getInstance()->getCosHalfFov() && - dist < FACE_IMPORTANCE_TO_CAMERA_OVER_DISTANCE[FACE_IMPORTANCE_LEVEL - 1][0]) + if(cos_angle_to_view_dir > LLViewerCamera::getInstance()->getCosHalfFov() && + //dist < FACE_IMPORTANCE_TO_CAMERA_OVER_DISTANCE[FACE_IMPORTANCE_LEVEL - 1][0]) + dist < FACE_IMPORTANCE_TO_CAMERA_OVER_DISTANCE[FACE_IMPORTANCE_LEVEL - 1][0] * camera->getDrawDistanceMultiplier()) { - LLViewerCamera* camera = LLViewerCamera::getInstance(); + //LLViewerCamera* camera = LLViewerCamera::getInstance(); + // [FIRE-35081] F32 camera_moving_speed = camera->getAverageSpeed() ; F32 camera_angular_speed = camera->getAverageAngularSpeed(); diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 6afa641790..d0e7e7c071 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -3113,6 +3113,7 @@ LLViewerMediaTexture* LLViewerMediaImpl::updateMediaImage() int discard_level = 0; media_tex->createGLTexture(discard_level, raw); + //media_tex->setBoostLevel(LLViewerTexture::BOOST_HIGH); // MEDIAOPT: set this dynamically on play/stop // FIXME diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 1951df6a9c..e4890a4bd2 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -762,6 +762,12 @@ void LLViewerTexture::setBoostLevel(S32 level) mBoostLevel = level; if(mBoostLevel != LLViewerTexture::BOOST_NONE && mBoostLevel != LLViewerTexture::BOOST_SELECTED && + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Added the new boost levels + mBoostLevel != LLViewerTexture::BOOST_GRASS && + mBoostLevel != LLViewerTexture::BOOST_LIGHT && + mBoostLevel != LLViewerTexture::BOOST_TREE && + // [FIRE-35081] mBoostLevel != LLViewerTexture::BOOST_ICON && mBoostLevel != LLViewerTexture::BOOST_THUMBNAIL) { @@ -773,6 +779,13 @@ void LLViewerTexture::setBoostLevel(S32 level) if (mBoostLevel >= LLViewerTexture::BOOST_HIGH) { mMaxVirtualSize = 2048.f * 2048.f; + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Add additional for the important to camera and in frustum + static LLCachedControl texture_camera_boost(gSavedSettings, "TextureCameraBoost", 7.f); + mMaxVirtualSize = mMaxVirtualSize + (mMaxVirtualSize * 1.0f * texture_camera_boost); + // Apply second boost based upon if the texture is close to the camera (< 16.1 meters * draw distance multiplier) + mMaxVirtualSize = mMaxVirtualSize + (mMaxVirtualSize * 1.0f * texture_camera_boost); + // [FIRE-35081] } } @@ -1179,7 +1192,7 @@ void LLViewerFetchedTexture::init(bool firstinit) mLastCallBackActiveTime = 0.f; mForceCallbackFetch = false; // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - mCloseToCamera = 0.0f; // Store if the camera is close to the camera (0.0f or 1.0f) + mCloseToCamera = 1.0f; // Store if the camera is close to the camera (0.0f or 1.0f) // [FIRE-35081] mFTType = FTT_UNKNOWN; @@ -3062,6 +3075,17 @@ void LLViewerLODTexture::processTextureStats() mDesiredDiscardLevel = llmin(mMinDesiredDiscardLevel, (S8)(MAX_DISCARD_LEVEL)); // [FIRE-35081] mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, (S32)mLoadedCallbackDesiredDiscardLevel); + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Add scale down here as the textures off screen were not getting scaled down properly + S32 current_discard = getDiscardLevel(); + if (mBoostLevel < LLGLTexture::BOOST_AVATAR_BAKED) + { + if (current_discard < mDesiredDiscardLevel && !mForceToSaveRawImage) + { // should scale down + scaleDown(); + } + } + // [FIRE-35081] } else if (!mFullWidth || !mFullHeight) { @@ -3415,11 +3439,23 @@ void LLViewerMediaTexture::initVirtualSize() { return; } - + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Add camera importance to the media textures as well + static LLCachedControl texture_camera_boost(gSavedSettings, "TextureCameraBoost", 7.f); + F32 vsize = 0.0f; + // [FIRE-35081] findFaces(); for(std::list< LLFace* >::iterator iter = mMediaFaceList.begin(); iter!= mMediaFaceList.end(); ++iter) { - addTextureStats((*iter)->getVirtualSize()); + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + //addTextureStats((*iter)->getVirtualSize()); + // Add camera importance to the media textures as well + vsize = (*iter)->getVirtualSize(); + vsize = vsize + (vsize * (*iter)->getImportanceToCamera() * texture_camera_boost); + // Apply second boost based upon if the texture is close to the camera (< 16.1 meters * draw distance multiplier) + vsize = vsize + (vsize * (*iter)->getCloseToCamera() * texture_camera_boost); + addTextureStats(vsize); + // [FIRE-35081] } } @@ -3479,6 +3515,10 @@ void LLViewerMediaTexture::addFace(U32 ch, LLFace* facep) } // [/SL:KB] + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Try to set the boost level to MEDIA to try to force the media to high quality + tex->setBoostLevel(LLViewerTexture::MEDIA); + // [FIRE-35081] mTextureList.push_back(tex);//increase the reference number by one for tex to avoid deleting it. return; } @@ -3720,7 +3760,10 @@ F32 LLViewerMediaTexture::getMaxVirtualSize() { addTextureStats(0.f, false);//reset } - + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + static LLCachedControl texture_camera_boost(gSavedSettings, "TextureCameraBoost", 7.f); + F32 vsize = 0.0f; + // [FIRE-35081] if(mIsPlaying) //media is playing { for (U32 ch = 0; ch < LLRender::NUM_TEXTURE_CHANNELS; ++ch) @@ -3730,8 +3773,16 @@ F32 LLViewerMediaTexture::getMaxVirtualSize() { LLFace* facep = mFaceList[ch][i]; if(facep->getDrawable()->isRecentlyVisible()) - { - addTextureStats(facep->getVirtualSize()); + { + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + //addTextureStats(facep->getVirtualSize()); + // Add the importance to camera and close to camera to the media texture + vsize = facep->getVirtualSize(); + vsize = vsize + (vsize * facep->getImportanceToCamera() * texture_camera_boost); + // Apply second boost based upon if the texture is close to the camera (< 16.1 meters * draw distance multiplier) + vsize = vsize + (vsize * facep->getCloseToCamera() * texture_camera_boost); + addTextureStats(vsize); + // [FIRE-35081] } } } @@ -3747,7 +3798,15 @@ F32 LLViewerMediaTexture::getMaxVirtualSize() LLFace* facep = *iter; if(facep->getDrawable()->isRecentlyVisible()) { - addTextureStats(facep->getVirtualSize()); + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + //addTextureStats(facep->getVirtualSize()); + // Add the importance to camera and close to camera to the media texture + vsize = facep->getVirtualSize(); + vsize = vsize + (vsize * facep->getImportanceToCamera() * texture_camera_boost); + // Apply second boost based upon if the texture is close to the camera (< 16.1 meters * draw distance multiplier) + vsize = vsize + (vsize * facep->getCloseToCamera() * texture_camera_boost); + addTextureStats(vsize); + // [FIRE-35081] } } } diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 2bd3f3738f..6903e1ec6a 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -396,6 +396,19 @@ void LLViewerTextureList::dump() for (image_list_t::iterator it = mImageList.begin(); it != mImageList.end(); ++it) { LLViewerFetchedTexture* image = *it; + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + std::string face_counts = ""; + std::string volume_counts = ""; + for (S32 index = 0; index < LLRender::NUM_TEXTURE_CHANNELS; index++) + { + face_counts += std::to_string(image->getNumFaces(index)) + " "; + } + + for (S32 index = 0; index < LLRender::NUM_VOLUME_TEXTURE_CHANNELS; index++) + { + volume_counts += std::to_string(image->getNumVolumes(index)) + " "; + } + // [FIRE-35081] LL_INFOS() << "priority " << image->getMaxVirtualSize() << " boost " << image->getBoostLevel() @@ -405,7 +418,10 @@ void LLViewerTextureList::dump() // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer << " close to camera " << (image->getCloseToCamera() > 0.0f ? "Y" : "N") // Display the close to camera flag << " FFType " << fttype_to_string(image->getFTType()) // Display the FFType of the camera - << " Type " << (S32)image->getType() // Display the type of the image (LOCAL_TEXTURE = 0, MEDIA_TEXTURE = 1, DYNAMIC_TEXTURE = 2, FETCHED_TEXTURE = 3,LOD_TEXTURE = 4) + << " Type " << (S32)image->getType() // Display the type of the image (LOCAL_TEXTURE = 0, MEDIA_TEXTURE = 1, DYNAMIC_TEXTURE = 2, FETCHED_TEXTURE = 3,LOD_TEXTURE = 4) + << " Sculpted " << (image->forSculpt() ? "Y" : "N") + << " # of Faces " << face_counts + << " # of Volumes " << volume_counts // [FIRE-35081] << " http://asset.siva.lindenlab.com/" << image->getID() << ".texture" << LL_ENDL; @@ -1024,6 +1040,8 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag important_to_camera = face->mImportanceToCamera; // Store so we don't have to do 2 indirects later on // If the face/texture is animated, then set the boost level to high, so that it will ways be the best quality animated += S64(face->mTextureMatrix); + animated += S64(face->hasMedia()); // Add has media for both local and parcel media + animated += S64(imagep->hasParcelMedia()); // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer (It is) /* @@ -1070,7 +1088,7 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag vsize = vsize + (vsize * face->mCloseToCamera * texture_camera_boost); // Update the max on screen vsize based upon the on screen vsize close_to_camera += face->mCloseToCamera; - LL_DEBUGS() << "" << imagep->getID() << " " << imagep->getNumFaces(i) << " OS Vsize: " << vsize << " Vsize: " << (vsize * bias) << " CTC: " << face->mCloseToCamera << LL_ENDL; + LL_DEBUGS() << face->getViewerObject()->getID() << " TID " << imagep->getID() << " #F " << imagep->getNumFaces(i) << " OS Vsize: " << vsize << " Vsize: " << (vsize * bias) << " CTC: " << face->mCloseToCamera << " Channel " << i << " Face Index " << fi << LL_ENDL; max_on_screen_vsize = llmax(max_on_screen_vsize, vsize); max_vsize = llmax(max_vsize, vsize * bias); // [FIRE-35081] @@ -1121,7 +1139,7 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag imagep->addTextureStats(max_on_screen_vsize); } // If the boost level just became high, or the texture is (Local, Media Dynamic) - else if (imagep->getBoostLevel() == LLViewerTexture::BOOST_HIGH || imagep->getType() < LLViewerTexture::FETCHED_TEXTURE || close_to_camera) + else if (imagep->getBoostLevel() >= LLViewerTexture::BOOST_HIGH || imagep->getType() < LLViewerTexture::FETCHED_TEXTURE || close_to_camera) { // Always use the best quality of the texture imagep->addTextureStats(max_on_screen_vsize); @@ -1131,15 +1149,6 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag { imagep->addTextureStats(max_vsize); } - U32 max_tex_res = LLGLTexture::MAX_IMAGE_SIZE_DEFAULT; - if (imagep->getBoostLevel() < LLGLTexture::BOOST_HIGH) - { - // restrict texture resolution to download based on RenderMaxTextureResolution - static LLCachedControl max_texture_resolution(gSavedSettings, "RenderMaxTextureResolution", 2048); - // sanity clamp debug setting to avoid settings hack shenanigans - max_tex_res = (U32)llclamp((U32)max_texture_resolution, 512, LLGLTexture::MAX_IMAGE_SIZE_DEFAULT); - imagep->mMaxVirtualSize = llmin(imagep->mMaxVirtualSize, (F32)(max_tex_res * max_tex_res)); - } // [FIRE-35081] } @@ -1241,7 +1250,11 @@ F32 LLViewerTextureList::updateImagesCreateTextures(F32 max_time) mCreateTextureList.pop(); if (imagep->hasGLTexture() && imagep->getDiscardLevel() < imagep->getDesiredDiscardLevel() && - (imagep->getDesiredDiscardLevel() <= MAX_DISCARD_LEVEL)) + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + //(imagep->getDesiredDiscardLevel() <= MAX_DISCARD_LEVEL)) + // Add additional restrictions on scaling down (only BOOST_NONE LOD Textures (Also skip media) + (imagep->getDesiredDiscardLevel() <= MAX_DISCARD_LEVEL) && imagep->getBoostLevel() == LLViewerTexture::BOOST_NONE && imagep->getType() == LLViewerTexture::LOD_TEXTURE && !imagep->hasParcelMedia() && !imagep->isViewerMediaTexture()) + // [FIRE-35081] { // NOTE: this may happen if the desired discard reduces while a decode is in progress and does not // necessarily indicate a problem, but if log occurrences excede that of dsiplay_stats: FPS, diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 35d116589f..a5ccda085c 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -10742,7 +10742,11 @@ void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& conte //LL_DEBUGS("Avatar") << avString() << " baked_index " << (S32) baked_index << " using mLastTextureID " << mBakedTextureDatas[baked_index].mLastTextureID << LL_ENDL; LL_DEBUGS("Avatar") << avString() << "sb " << (S32) isUsingServerBakes() << " baked_index " << (S32) baked_index << " using mLastTextureID " << mBakedTextureDatas[baked_index].mLastTextureID << LL_ENDL; setTEImage(mBakedTextureDatas[baked_index].mTextureIndex, - LLViewerTextureManager::getFetchedTexture(mBakedTextureDatas[baked_index].mLastTextureID, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + //LLViewerTextureManager::getFetchedTexture(mBakedTextureDatas[baked_index].mLastTextureID, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); + //Texture will use baked textures, so it should also use that for the boost. + LLViewerTextureManager::getFetchedTexture(mBakedTextureDatas[baked_index].mLastTextureID, FTT_DEFAULT, true, LLGLTexture::BOOST_AVATAR_BAKED, LLViewerTexture::LOD_TEXTURE)); + // [FIRE-35081] } else { diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index db37563e14..ccdc38a332 100644 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -99,7 +99,11 @@ void LLVOGrass::updateSpecies() SpeciesMap::const_iterator it = sSpeciesTable.begin(); mSpecies = (*it).first; } - setTEImage(0, LLViewerTextureManager::getFetchedTexture(sSpeciesTable[mSpecies]->mTextureID, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + //setTEImage(0, LLViewerTextureManager::getFetchedTexture(sSpeciesTable[mSpecies]->mTextureID, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); + // Added new boost Grass as it forces a fixed size on updates + setTEImage(0, LLViewerTextureManager::getFetchedTexture(sSpeciesTable[mSpecies]->mTextureID, FTT_DEFAULT, true, LLGLTexture::BOOST_GRASS, LLViewerTexture::LOD_TEXTURE)); + // [FIRE-35081] } diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp index 199d5dc3f6..954faa5572 100644 --- a/indra/newview/llvotree.cpp +++ b/indra/newview/llvotree.cpp @@ -330,7 +330,11 @@ U32 LLVOTree::processUpdateMessage(LLMessageSystem *mesgsys, // Load Species-Specific data // static const S32 MAX_TREE_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL = 32 ; //frames. - mTreeImagep = LLViewerTextureManager::getFetchedTexture(sSpeciesTable[mSpecies]->mTextureID, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + //mTreeImagep = LLViewerTextureManager::getFetchedTexture(sSpeciesTable[mSpecies]->mTextureID, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + // Set boost level for Tree as it overrides the normal texture sizes + mTreeImagep = LLViewerTextureManager::getFetchedTexture(sSpeciesTable[mSpecies]->mTextureID, FTT_DEFAULT, true, LLGLTexture::BOOST_TREE, LLViewerTexture::LOD_TEXTURE); + // [FIRE-35081] mTreeImagep->setMaxVirtualSizeResetInterval(MAX_TREE_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL); //allow to wait for at most 16 frames to reset virtual size. mBranchLength = sSpeciesTable[mSpecies]->mBranchLength; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index a89f011115..a6f4deb688 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -926,6 +926,10 @@ void LLVOVolume::updateTextureVirtualSize(bool forced) F32 min_vsize=999999999.f, max_vsize=0.f; LLViewerCamera* camera = LLViewerCamera::getInstance(); std::stringstream debug_text; + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Use this flag to indicate that there was a legit change to 0.0 for the mPixelArea (All faces off screen) + bool changed = false; + // [FIRE-35081] for (S32 i = 0; i < num_faces; i++) { LLFace* face = mDrawable->getFace(i); @@ -974,6 +978,13 @@ void LLVOVolume::updateTextureVirtualSize(bool forced) mPixelArea = llmax(mPixelArea, face->getPixelArea()); + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // If the new area is changed from the old area, then accept it. + if (mPixelArea != old_area) + { + changed = true; + } + // [FIRE-35081] // if the face has gotten small enough to turn off texture animation and texture // animation is running, rebuild the render batch for this face to turn off // texture animation @@ -1062,7 +1073,10 @@ void LLVOVolume::updateTextureVirtualSize(bool forced) { LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); LLUUID id = params->getLightTexture(); - mLightTexture = LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE); + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Light textures should be treaded not the same as normal LOD textures + mLightTexture = LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, true, LLGLTexture::BOOST_LIGHT); + // [FIRE-35081] if (mLightTexture.notNull()) { F32 rad = getLightRadius(); @@ -1112,7 +1126,11 @@ void LLVOVolume::updateTextureVirtualSize(bool forced) setDebugText(output); } - if (mPixelArea == 0) + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + //if (mPixelArea == 0) + // If there is a legit change to 0.0, don't dismiss it. + if (mPixelArea == 0 && !changed) + // [FIRE-35081] { //flexi phasing issues make this happen mPixelArea = old_area; } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index f01e813a3f..6422ceb8ae 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2275,7 +2275,6 @@ F32 LLPipeline::calcPixelArea(LLVector3 center, LLVector3 size, LLCamera &camera //ramp down distance for nearby objects //shrink dist by dist/16. - // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer /* if (dist < 16.f) { @@ -2283,15 +2282,6 @@ F32 LLPipeline::calcPixelArea(LLVector3 center, LLVector3 size, LLCamera &camera dist *= dist; dist *= 16.f; } - */ - // Applied the camera draw distance multiplier to the distance similar to the textures - if (dist < 16.f * camera.getDrawDistanceMultiplier()) - { - dist /= 16.f * camera.getDrawDistanceMultiplier(); - dist *= dist; - dist *= 16.f * camera.getDrawDistanceMultiplier(); - } - // [FIRE-35081] //get area of circle around node F32 app_angle = atanf(size.length()/dist); @@ -2311,23 +2301,12 @@ F32 LLPipeline::calcPixelArea(const LLVector4a& center, const LLVector4a& size, //ramp down distance for nearby objects //shrink dist by dist/16. - // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - /* if (dist < 16.f) { dist /= 16.f; dist *= dist; dist *= 16.f; } - */ - // Applied the camera draw distance multiplier to the distance similar to the textures - if (dist < 16.f * camera.getDrawDistanceMultiplier()) - { - dist /= 16.f * camera.getDrawDistanceMultiplier(); - dist *= dist; - dist *= 16.f * camera.getDrawDistanceMultiplier(); - } - // [FIRE-35081] //get area of circle around node F32 app_angle = atanf(size.getLength3().getF32() / dist);