From 87eb902f7a583667038f1618d5eb85acd7d7052b Mon Sep 17 00:00:00 2001 From: minerjr Date: Sat, 1 Mar 2025 23:00:46 -0400 Subject: [PATCH 01/30] [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer Changed the textures to divide the texture vsize by the Aspect Ratio and Fields of view. to better control when a texture needs to be scaled down. Fixed issue when low screen image size could cause an assert on the on screen console due to negative sizes(Calculated to -30 from the value and code that uses the negative location Updated the logic in LLViewerObjectList to fix the issue of mObjects being modified at possibly any time by the code it calling. --- indra/llui/llconsole.cpp | 7 ++++++- indra/newview/llface.h | 6 +++++- indra/newview/llviewerobjectlist.cpp | 15 ++++++++------- indra/newview/llviewertexturelist.cpp | 11 ++++++++++- indra/newview/llviewertexturelist.h | 5 +++++ indra/newview/llvoavatar.cpp | 11 +++++++++-- 6 files changed, 43 insertions(+), 12 deletions(-) diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp index 82ff89e442..92620270b8 100644 --- a/indra/llui/llconsole.cpp +++ b/indra/llui/llconsole.cpp @@ -566,7 +566,12 @@ void LLConsole::Paragraph::updateLines(F32 screen_width, const LLFontGL* font, L if ( !force_resize ) { if ( mMaxWidth >= 0.0f - && mMaxWidth < screen_width ) + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + //&& mMaxWidth < screen_width) + // If viewer window was made as small as possible with the console enabled, it would cause an assert error + // as the line below can go as small as -38 + && mMaxWidth < screen_width || screen_width <= 30) + // [FIRE-35081] { return; //No resize required. } diff --git a/indra/newview/llface.h b/indra/newview/llface.h index 651a4167e0..20689ee0fb 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -52,7 +52,11 @@ class LLDrawInfo; class LLMeshSkinInfo; const F32 MIN_ALPHA_SIZE = 1024.f; -const F32 MIN_TEX_ANIM_SIZE = 512.f; +// [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer +//const F32 MIN_TEX_ANIM_SIZE = 512.f; +// Change the min size to +const F32 MIN_TEX_ANIM_SIZE = 64.f; +// [FIRE-35081] const U8 FACE_DO_NOT_BATCH_TEXTURES = 255; class alignas(16) LLFace diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index e3a68ef5a7..45af5f228d 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -889,7 +889,7 @@ void LLViewerObjectList::updateApparentAngles(LLAgent &agent, F32 max_time) max_value = (S32)mObjects.size(); LLTimer timer; // If the number of objects since last being in here has changed (IE objects deleted, then reset the lazy update index) - if (mCurLazyUpdateIndex > max_value) + if (mCurLazyUpdateIndex >= max_value) { mCurLazyUpdateIndex = 0; } @@ -898,6 +898,12 @@ void LLViewerObjectList::updateApparentAngles(LLAgent &agent, F32 max_time) // loop over number of objects in the BIN (128), or below until we run out of time while(num_updates < NUM_BINS) { + // Moved to the first to fix up the issue of access violation if the object list chaanges size during processing. + if (i >= (S32)mObjects.size()) + { + // Reset the index if we go over the max value + i = 0; + } objectp = mObjects[i]; if (objectp != nullptr && !objectp->isDead()) { @@ -906,12 +912,7 @@ void LLViewerObjectList::updateApparentAngles(LLAgent &agent, F32 max_time) objectp->setPixelAreaAndAngle(agent); // Also sets the approx. pixel area objectp->updateTextures(); // Update the image levels of textures for this object. } - i++; - // Reset the index if we go over the max value - if (i == max_value) - { - i = 0; - } + i++; num_updates++; // Escape either if we run out of time, or loop back onto ourselves. diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index edcfdb3c9d..418876aa21 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -980,6 +980,9 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag //F32 vsize = face->getPixelArea(); //on_screen = face->mInFrustum; vsize = face->getPixelArea(); + // Apply the Aspect ratio and field of view to the vsize, this allows the texture to be in the same space as the face, IE the face has + // based around LLCamera::calculateFrustumPlanes + vsize = vsize * mAspectRatioFOVRemove; current_on_screen = face->mInFrustum; // Create a new var to store the current on screen status on_screen_count += current_on_screen; // Count the number of on sceen faces instead of using brach important_to_camera = face->mImportanceToCamera; // Store so we don't have to do 2 indirects later on @@ -1295,7 +1298,13 @@ F32 LLViewerTextureList::updateImagesFetchTextures(F32 max_time) typedef std::vector > entries_list_t; entries_list_t entries; - + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Pre-calculate current aspect ratio and FOV so we can use to remove from the Faces used for updating the textures + // This is used per face per texture, so it can cave a bunch of divisions as well as acessing the values from + // the camera singleton. + LLViewerCamera* camera = LLViewerCamera::getInstance(); // Store the + mAspectRatioFOVRemove = 1.0f / (camera->getAspect() * ((F32)tanf(0.5f * camera->getView()))); + // [FIRE-35081] // update N textures at beginning of mImageList U32 update_count = 0; static const S32 MIN_UPDATE_COUNT = gSavedSettings.getS32("TextureFetchUpdateMinCount"); // default: 32 diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h index 3816c32500..23e73c2ca2 100644 --- a/indra/newview/llviewertexturelist.h +++ b/indra/newview/llviewertexturelist.h @@ -235,6 +235,11 @@ public: // Fast cache stats static U32 sNumFastCacheReads; + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Store the camera's aspect ratio and fov + F32 mAspectRatioFOVRemove; + // [FIRE-35081] + private: typedef std::map< LLTextureKey, LLPointer > uuid_map_t; uuid_map_t mUUIDMap; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 40c070515c..35d116589f 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2754,12 +2754,19 @@ LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUU LL_DEBUGS("Avatar") << avString() << "get old-bake image from host " << uuid << LL_ENDL; LLHost host = getObjectHost(); result = LLViewerTextureManager::getFetchedTexture( - uuid, FTT_HOST_BAKE, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, host); + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + //uuid, FTT_HOST_BAKE, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, host); + uuid, FTT_HOST_BAKE, true, LLGLTexture::BOOST_AVATAR_BAKED, LLViewerTexture::LOD_TEXTURE, 0, 0, host); + // [FIRE-35081] // [Legacy Bake] } LL_DEBUGS("Avatar") << avString() << "get server-bake image from URL " << url << LL_ENDL; result = LLViewerTextureManager::getFetchedTextureFromUrl( - url, FTT_SERVER_BAKE, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, uuid); + // + //url, FTT_SERVER_BAKE, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, uuid); + // Change the texture from LOD to AVATAR_BAKED. + url, FTT_SERVER_BAKE, true, LLGLTexture::BOOST_AVATAR_BAKED, LLViewerTexture::LOD_TEXTURE, 0, 0, uuid); + // [FIRE-35081] if (result->isMissingAsset()) { result->setIsMissingAsset(false); From 27ec21aa7eb198b1fdeb5e3e01711da3fdf41e15 Mon Sep 17 00:00:00 2001 From: minerjr Date: Wed, 5 Mar 2025 09:04:16 -0400 Subject: [PATCH 02/30] Added invers aspect ratio Added inverse aspect ratio for use with face virtual textures. --- indra/llmath/llcamera.cpp | 11 +++++++++++ indra/llmath/llcamera.h | 7 +++++++ 2 files changed, 18 insertions(+) diff --git a/indra/llmath/llcamera.cpp b/indra/llmath/llcamera.cpp index 3daed2ac31..988d600486 100644 --- a/indra/llmath/llcamera.cpp +++ b/indra/llmath/llcamera.cpp @@ -35,6 +35,9 @@ LLCamera::LLCamera() : LLCoordFrame(), mView(DEFAULT_FIELD_OF_VIEW), mAspect(DEFAULT_ASPECT_RATIO), + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + mInverseAspect(1.0f / DEFAULT_ASPECT_RATIO), + // [FIRE-35081] mViewHeightInPixels( -1 ), // invalid height mNearPlane(DEFAULT_NEAR_PLANE), mFarPlane(DEFAULT_FAR_PLANE), @@ -63,6 +66,10 @@ LLCamera::LLCamera(F32 vertical_fov_rads, F32 aspect_ratio, S32 view_height_in_p } mAspect = llclamp(aspect_ratio, MIN_ASPECT_RATIO, MAX_ASPECT_RATIO); + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Store the inverse of the aspect ratio, so we can remove it from texture calculations + mInverseAspect = 1.0f / mAspect; + // [FIRE-35081] mNearPlane = llclamp(near_plane, MIN_NEAR_PLANE, MAX_NEAR_PLANE); if(far_plane < 0) far_plane = DEFAULT_FAR_PLANE; mFarPlane = llclamp(far_plane, MIN_FAR_PLANE, MAX_FAR_PLANE); @@ -129,6 +136,10 @@ void LLCamera::setViewHeightInPixels(S32 height) void LLCamera::setAspect(F32 aspect_ratio) { mAspect = llclamp(aspect_ratio, MIN_ASPECT_RATIO, MAX_ASPECT_RATIO); + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Store the inverse of the aspect ratio, so we can remove it from texture calculations + mInverseAspect = 1.0f / mAspect; + // [FIRE-35081] calculateFrustumPlanes(); } diff --git a/indra/llmath/llcamera.h b/indra/llmath/llcamera.h index b6e0e4a2be..8155573263 100644 --- a/indra/llmath/llcamera.h +++ b/indra/llmath/llcamera.h @@ -127,6 +127,10 @@ private: F32 mView; // angle between top and bottom frustum planes in radians. F32 mAspect; // width/height + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Store the inverse of the aspect ratio, for the texture's sizes + F32 mInverseAspect; // height/width + // [FIRE-35081] S32 mViewHeightInPixels; // for ViewHeightInPixels() only F32 mNearPlane; F32 mFarPlane; @@ -161,6 +165,9 @@ public: F32 getView() const { return mView; } // vertical FOV in radians S32 getViewHeightInPixels() const { return mViewHeightInPixels; } F32 getAspect() const { return mAspect; } // width / height + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + F32 getInverseAspect() const { return mInverseAspect; } // width / height + // [FIRE-35081] F32 getNear() const { return mNearPlane; } // meters F32 getFar() const { return mFarPlane; } // meters From 8a0cf5ca0f9e80002b0af012be0615fffbea40eb Mon Sep 17 00:00:00 2001 From: minerjr Date: Wed, 5 Mar 2025 09:49:12 -0400 Subject: [PATCH 03/30] Added storing the full Cos FOV for the camera Added storing the full Cos FOV for the camera --- indra/newview/llviewercamera.cpp | 8 ++++++++ indra/newview/llviewercamera.h | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp index 0df185e716..b995fccada 100644 --- a/indra/newview/llviewercamera.cpp +++ b/indra/newview/llviewercamera.cpp @@ -69,6 +69,7 @@ LLViewerCamera::LLViewerCamera() : LLCamera() mCameraFOVDefault = DEFAULT_FIELD_OF_VIEW; mPrevCameraFOVDefault = DEFAULT_FIELD_OF_VIEW; mCosHalfCameraFOV = cosf(mCameraFOVDefault * 0.5f); + mCosCameraFOV = cosf(mCameraFOVDefault); mPixelMeterRatio = 0.f; mScreenPixelArea = 0; mZoomFactor = 1.f; @@ -143,6 +144,10 @@ void LLViewerCamera::updateCameraLocation(const LLVector3 ¢er, const LLVecto mAverageSpeed = (F32)LLTrace::get_frame_recording().getPeriodMeanPerSec(sVelocityStat, 50); mAverageAngularSpeed = (F32)LLTrace::get_frame_recording().getPeriodMeanPerSec(sAngularVelocityStat); mCosHalfCameraFOV = cosf(0.5f * getView() * llmax(1.0f, getAspect())); + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Store the full Cos FOV value + mCosCameraFOV = cosf(getView() * llmax(1.0f, getAspect())); + // [FIRE-35081] // update pixel meter ratio using default fov, not modified one mPixelMeterRatio = (F32)(getViewHeightInPixels()/ (2.f*tanf(mCameraFOVDefault*0.5f))); @@ -822,6 +827,9 @@ void LLViewerCamera::setDefaultFOV(F32 vertical_fov_rads) setView(vertical_fov_rads); mCameraFOVDefault = vertical_fov_rads; mCosHalfCameraFOV = cosf(mCameraFOVDefault * 0.5f); + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + mCosCameraFOV = cosf(mCameraFOVDefault); + // [FIRE-35081] } bool LLViewerCamera::isDefaultFOVChanged() diff --git a/indra/newview/llviewercamera.h b/indra/newview/llviewercamera.h index b202f0812a..6fa3d3c6f2 100644 --- a/indra/newview/llviewercamera.h +++ b/indra/newview/llviewercamera.h @@ -81,6 +81,7 @@ public: static LLTrace::CountStatHandle<>* getVelocityStat() {return &sVelocityStat; } static LLTrace::CountStatHandle<>* getAngularVelocityStat() {return &sAngularVelocityStat; } F32 getCosHalfFov() {return mCosHalfCameraFOV;} + F32 getCosFov() {return mCosCameraFOV;} F32 getAverageSpeed() {return mAverageSpeed ;} F32 getAverageAngularSpeed() {return mAverageAngularSpeed;} @@ -120,6 +121,10 @@ protected: F32 mCameraFOVDefault; F32 mPrevCameraFOVDefault; F32 mCosHalfCameraFOV; + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Store the Cos of the full FOV + F32 mCosCameraFOV; + // [FIRE-35081] LLVector3 mLastPointOfInterest; F32 mPixelMeterRatio; // Divide by distance from camera to get pixels per meter at that distance. S32 mScreenPixelArea; // Pixel area of entire window From c64a294cf155fa854ab52718269277c209691168 Mon Sep 17 00:00:00 2001 From: minerjr Date: Wed, 5 Mar 2025 10:53:48 -0400 Subject: [PATCH 04/30] Fixed up animations to always be running (Frustum may need revision Fixed up animations to always be running, so they should not stutter or be in odd places when turning the camera. May need to revise the mInFrustum as trying to make sure it's within the actual visual location. Need to test with --- indra/newview/llface.cpp | 32 +++++++++++++++-- indra/newview/llface.h | 2 +- indra/newview/llviewertexturelist.cpp | 51 ++++++++++++--------------- indra/newview/llviewertexturelist.h | 5 --- indra/newview/llvovolume.cpp | 20 ++++++++--- 5 files changed, 69 insertions(+), 41 deletions(-) diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index f346aa1f54..31a439bc49 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1679,7 +1679,10 @@ bool LLFace::getGeometryVolume(const LLVolume& volume, xforms = XFORM_NONE; } - if (getVirtualSize() >= MIN_TEX_ANIM_SIZE) // || isState(LLFace::RIGGED)) + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Removed check for turning off animations + //if (getVirtualSize() >= MIN_TEX_ANIM_SIZE) // || isState(LLFace::RIGGED)) + // [FIRE-35081] { //don't override texture transform during tc bake tex_mode = 0; } @@ -2280,10 +2283,16 @@ F32 LLFace::getTextureVirtualSize() F32 radius; F32 cos_angle_to_view_dir; - bool in_frustum = calcPixelArea(cos_angle_to_view_dir, radius); + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + //bool in_frustum = calcPixelArea(cos_angle_to_view_dir, radius); + // The mInFrustum value is now updated in calcPixelArea, so no longer need to accss the value + calcPixelArea(cos_angle_to_view_dir, radius); - if (mPixelArea < F_ALMOST_ZERO || !in_frustum) + //if (mPixelArea < F_ALMOST_ZERO || !in_frustum) + // Use the stored value from calcPixelArea + if (mPixelArea < F_ALMOST_ZERO || !mInFrustum) + // [FIRE-35081] { setVirtualSize(0.f) ; return 0.f; @@ -2320,6 +2329,11 @@ F32 LLFace::getTextureVirtualSize() } } + // [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] setVirtualSize(face_area) ; return face_area; @@ -2405,6 +2419,10 @@ bool LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius) // no rigged extents, zero out bounding box and skip update mRiggedExtents[0] = mRiggedExtents[1] = LLVector4a(0.f, 0.f, 0.f); + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Set the face to be out of the frustum as the object is invalid + mInFrustum = false; + // [FIRE-35081] return false; } @@ -2451,6 +2469,10 @@ bool LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius) LLVector4a x_axis; x_axis.load3(camera->getXAxis().mV); cos_angle_to_view_dir = lookAt.dot3(x_axis).getF32(); + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Added real in frustum check value. Previous was only false for media textures off screen and invalid rig objects + mInFrustum = cos_angle_to_view_dir > camera->getCosHalfFov() && cos_angle_to_view_dir < camera->getCosHalfFov() * 2.0f; + // [FIRE-35081] //if has media, check if the face is out of the view frustum. if(hasMedia()) @@ -2458,6 +2480,10 @@ bool LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius) if(!camera->AABBInFrustum(center, size)) { mImportanceToCamera = 0.f ; + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Added real in frustum check value. Previous was only false for media textures off screen and invalid rig objects + mInFrustum = false; + // [FIRE-35081] return false ; } if(cos_angle_to_view_dir > camera->getCosHalfFov()) //the center is within the view frustum diff --git a/indra/newview/llface.h b/indra/newview/llface.h index 20689ee0fb..0a1225eb0f 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -55,7 +55,7 @@ const F32 MIN_ALPHA_SIZE = 1024.f; // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer //const F32 MIN_TEX_ANIM_SIZE = 512.f; // Change the min size to -const F32 MIN_TEX_ANIM_SIZE = 64.f; +const F32 MIN_TEX_ANIM_SIZE = 10.f; // [FIRE-35081] const U8 FACE_DO_NOT_BATCH_TEXTURES = 255; diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 418876aa21..28981d4bec 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -919,7 +919,7 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag // convert bias into a vsize scaler // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer //bias = (F32) llroundf(powf(4, bias - 1.f)); - // Pre-divied the bias so you can just use multiiply in the loop + // Pre-divide the bias so you can just use multiply in the loop bias = (F32) 1.0f / llroundf(powf(4, bias - 1.f)); // Apply new rules to bias discard, there are now 2 bias, off-screen and on-screen. @@ -940,8 +940,6 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag S32 on_screen_count = 0; // Moved all the variables outside of the loop bool current_on_screen = false; - F32 radius; // Moved outside the loop to save reallocation every loop - F32 cos_angle_to_view_dir; // Moved outside the loop to save reallocation every loop F32 vsize = 0.0f; // Moved outside the loop to save reallocation every loop F32 important_to_camera = 0.0f; F64 animated = 0; // U64 used to track if a pointer is set for the animations. (The texture matrix of the face is null if no animation assigned to the texture) @@ -961,7 +959,7 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag { ++face_count; // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - // Moved outside the loop to stop createing new memory every loop + // No longer needed as we no longer re-calculate the face's virtual texture size, we use it directly from the face //F32 radius; //F32 cos_angle_to_view_dir; // [FIRE-35081] @@ -970,27 +968,28 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag { // only call calcPixelArea at most once every 10 frames for a given face // this helps eliminate redundant calls to calcPixelArea for faces that have multiple textures // assigned to them, such as is the case with GLTF materials or Blinn-Phong materials - face->mInFrustum = face->calcPixelArea(cos_angle_to_view_dir, radius); + + //face->calcPixelArea(cos_angle_to_view_dir, radius); + // The face already has a function to calculate the Texture Virtual Size, which already calls the calcPixelArea method + // so just call this instead. This can be called from outside this loop by LLVolume objects + face->getTextureVirtualSize(); face->mLastTextureUpdate = gFrameCount; } - - + // Also moved allocation outside the loop // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer //F32 vsize = face->getPixelArea(); - //on_screen = face->mInFrustum; - vsize = face->getPixelArea(); - // Apply the Aspect ratio and field of view to the vsize, this allows the texture to be in the same space as the face, IE the face has - // based around LLCamera::calculateFrustumPlanes - vsize = vsize * mAspectRatioFOVRemove; + // Get the already calculated face's virtual size, instead of re-calculating it + vsize = face->getVirtualSize(); + current_on_screen = face->mInFrustum; // Create a new var to store the current on screen status on_screen_count += current_on_screen; // Count the number of on sceen faces instead of using brach 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); - // [FIRE-35081] - + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer (It is) + /* // Scale desired texture resolution higher or lower depending on texture scale // // Minimum usage examples: a 1024x1024 texture with aplhabet, runing string @@ -998,6 +997,7 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag // // Maximum usage examples: huge chunk of terrain repeats texture // TODO: make this work with the GLTF texture transforms + S32 te_offset = face->getTEOffset(); // offset is -1 if not inited LLViewerObject* objp = face->getViewerObject(); const LLTextureEntry* te = (te_offset < 0 || te_offset >= objp->getNumTEs()) ? nullptr : objp->getTE(te_offset); @@ -1005,8 +1005,6 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag min_scale = llclamp(min_scale * min_scale, texture_scale_min(), texture_scale_max()); vsize /= min_scale; - // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - /* // apply bias to offscreen faces all the time, but only to onscreen faces when bias is large if (!face->mInFrustum || LLViewerTexture::sDesiredDiscardBias > 2.f) { @@ -1064,11 +1062,9 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag } } - imagep->addTextureStats(max_vsize); - - // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - // New logic block for the bias system - // All textures begin at the max_vsize with bias applied. + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + //imagep->addTextureStats(max_vsize); + // New logic block for the bias system // Then depending on the type of texture, the higher resolution on_screen_max_vsize is applied. // On Screen (Without Bias applied: // LOD/Fetch Texture: Discard Levels 0, 1 @@ -1087,6 +1083,11 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag // Always use the best quality of the texture imagep->addTextureStats(max_on_screen_vsize); } + // All other texture cases will use max_vsize with bias applied. + else + { + imagep->addTextureStats(max_vsize); + } // [FIRE-35081] } @@ -1298,13 +1299,7 @@ F32 LLViewerTextureList::updateImagesFetchTextures(F32 max_time) typedef std::vector > entries_list_t; entries_list_t entries; - // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - // Pre-calculate current aspect ratio and FOV so we can use to remove from the Faces used for updating the textures - // This is used per face per texture, so it can cave a bunch of divisions as well as acessing the values from - // the camera singleton. - LLViewerCamera* camera = LLViewerCamera::getInstance(); // Store the - mAspectRatioFOVRemove = 1.0f / (camera->getAspect() * ((F32)tanf(0.5f * camera->getView()))); - // [FIRE-35081] + // update N textures at beginning of mImageList U32 update_count = 0; static const S32 MIN_UPDATE_COUNT = gSavedSettings.getS32("TextureFetchUpdateMinCount"); // default: 32 diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h index 23e73c2ca2..3816c32500 100644 --- a/indra/newview/llviewertexturelist.h +++ b/indra/newview/llviewertexturelist.h @@ -235,11 +235,6 @@ public: // Fast cache stats static U32 sNumFastCacheReads; - // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - // Store the camera's aspect ratio and fov - F32 mAspectRatioFOVRemove; - // [FIRE-35081] - private: typedef std::map< LLTextureKey, LLPointer > uuid_map_t; uuid_map_t mUUIDMap; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 5fc7fffb38..a89f011115 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -742,7 +742,10 @@ void LLVOVolume::animateTextures() { LLFace* facep = mDrawable->getFace(i); if (!facep) continue; - if(facep->getVirtualSize() <= MIN_TEX_ANIM_SIZE && facep->mTextureMatrix) continue; + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Removed check for turning off animations + //if(facep->getVirtualSize() <= MIN_TEX_ANIM_SIZE && facep->mTextureMatrix) continue; + // [FIRE-35081] const LLTextureEntry* te = facep->getTextureEntry(); @@ -767,7 +770,10 @@ void LLVOVolume::animateTextures() if (!facep->mTextureMatrix) { facep->mTextureMatrix = new LLMatrix4(); - if (facep->getVirtualSize() > MIN_TEX_ANIM_SIZE) + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Removed check for turning off animations + //if (facep->getVirtualSize() > MIN_TEX_ANIM_SIZE) + // [FIRE-35081] { // Fix the one edge case missed in // LLVOVolume::updateTextureVirtualSize when the @@ -5438,7 +5444,10 @@ bool can_batch_texture(LLFace* facep) return false; } - if (facep->isState(LLFace::TEXTURE_ANIM) && facep->getVirtualSize() > MIN_TEX_ANIM_SIZE) + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Removed check for turning off animations + if (facep->isState(LLFace::TEXTURE_ANIM))//&& facep->getVirtualSize() > MIN_TEX_ANIM_SIZE) + // [FIRE-35081] { //texture animation breaks batches return false; } @@ -5585,7 +5594,10 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, } const LLMatrix4* tex_mat = NULL; - if (facep->isState(LLFace::TEXTURE_ANIM) && facep->getVirtualSize() > MIN_TEX_ANIM_SIZE) + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Removed check for turning off animations + if (facep->isState(LLFace::TEXTURE_ANIM)) //&& facep->getVirtualSize() > MIN_TEX_ANIM_SIZE) + // [FIRE-35081] { tex_mat = facep->mTextureMatrix; } From 5b0801e535cf6269cef8f237e65314b1b22aa99b Mon Sep 17 00:00:00 2001 From: minerjr Date: Tue, 11 Mar 2025 00:31:39 -0300 Subject: [PATCH 05/30] [FIRE-35081] - Fixed blurry textures and scaling issues Added new calculation to the LLCamera for draw distance multiplier Removed the Inverse aspect as not longer used Modified the LLFace to no long user the inverse aspect. Updated mInFrustum to use mImportanceToCamera as it was correct LLViewerCamera removed the mCosCameraFOV (not used anymore) Added LLViewerMenu option under Developer->Dump->Texture List to dump texture list to info for debugging. LLViewerTexture viewer for LOD textures, now loops to make the texture fit to cover the max discard value instead of calculating with logs and divisions. LLViewerTextureList updated to to dump texture list to the Infos, and updated to boost for not only textures based upon the importance to the camera, but to boost a second time for textures close to the camera. Also capped the mMaxVirtualSize to try to help track down texture size changes Updated LLPipeline to use same getDrawDistanceMultiplier as the texture calcPixelArea code. --- indra/llmath/llcamera.cpp | 18 ++++-- indra/llmath/llcamera.h | 6 +- indra/newview/llface.cpp | 33 +++++++--- indra/newview/llface.h | 3 + indra/newview/llviewercamera.cpp | 8 --- indra/newview/llviewercamera.h | 5 -- indra/newview/llviewermenu.cpp | 4 ++ indra/newview/llviewertexture.cpp | 35 ++++++++-- indra/newview/llviewertexture.h | 8 +++ indra/newview/llviewertexturelist.cpp | 64 +++++++++++++++++-- indra/newview/llviewertexturelist.h | 3 + indra/newview/pipeline.cpp | 32 ++++++++-- .../skins/default/xui/en/menu_viewer.xml | 14 ++++ 13 files changed, 189 insertions(+), 44 deletions(-) diff --git a/indra/llmath/llcamera.cpp b/indra/llmath/llcamera.cpp index 988d600486..3103ce90dd 100644 --- a/indra/llmath/llcamera.cpp +++ b/indra/llmath/llcamera.cpp @@ -36,7 +36,8 @@ LLCamera::LLCamera() : mView(DEFAULT_FIELD_OF_VIEW), mAspect(DEFAULT_ASPECT_RATIO), // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - mInverseAspect(1.0f / DEFAULT_ASPECT_RATIO), + //mInverseAspect(1.0f / DEFAULT_ASPECT_RATIO), + mDrawDistanceMultiplier(1.0f), // [FIRE-35081] mViewHeightInPixels( -1 ), // invalid height mNearPlane(DEFAULT_NEAR_PLANE), @@ -68,12 +69,16 @@ LLCamera::LLCamera(F32 vertical_fov_rads, F32 aspect_ratio, S32 view_height_in_p mAspect = llclamp(aspect_ratio, MIN_ASPECT_RATIO, MAX_ASPECT_RATIO); // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer // Store the inverse of the aspect ratio, so we can remove it from texture calculations - mInverseAspect = 1.0f / mAspect; + //mInverseAspect = 1.0f / mAspect; // [FIRE-35081] mNearPlane = llclamp(near_plane, MIN_NEAR_PLANE, MAX_NEAR_PLANE); if(far_plane < 0) far_plane = DEFAULT_FAR_PLANE; mFarPlane = llclamp(far_plane, MIN_FAR_PLANE, MAX_FAR_PLANE); - + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Store the draw distance multiplier based upon how much bigger/smaller the far plan is then the default (64.0f) + mDrawDistanceMultiplier = mFarPlane / DEFAULT_FAR_PLANE; + mDrawDistanceMultiplier = mDrawDistanceMultiplier < 1.0f ? 1.0f : mDrawDistanceMultiplier; + // [FIRE-35081] setView(vertical_fov_rads); } @@ -138,7 +143,7 @@ void LLCamera::setAspect(F32 aspect_ratio) mAspect = llclamp(aspect_ratio, MIN_ASPECT_RATIO, MAX_ASPECT_RATIO); // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer // Store the inverse of the aspect ratio, so we can remove it from texture calculations - mInverseAspect = 1.0f / mAspect; + //mInverseAspect = 1.0f / mAspect; // [FIRE-35081] calculateFrustumPlanes(); } @@ -154,6 +159,11 @@ void LLCamera::setNear(F32 near_plane) void LLCamera::setFar(F32 far_plane) { mFarPlane = llclamp(far_plane, MIN_FAR_PLANE, MAX_FAR_PLANE); + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Store the draw distance multiplier based upon how much bigger/smaller the far plan is then the default (64.0f) + mDrawDistanceMultiplier = mFarPlane / DEFAULT_FAR_PLANE; + mDrawDistanceMultiplier = mDrawDistanceMultiplier < 1.0f ? 1.0f : mDrawDistanceMultiplier; + // [FIRE-35081] calculateFrustumPlanes(); } diff --git a/indra/llmath/llcamera.h b/indra/llmath/llcamera.h index 8155573263..c89162b9ff 100644 --- a/indra/llmath/llcamera.h +++ b/indra/llmath/llcamera.h @@ -129,7 +129,8 @@ private: F32 mAspect; // width/height // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer // Store the inverse of the aspect ratio, for the texture's sizes - F32 mInverseAspect; // height/width + //F32 mInverseAspect; // height/width + F32 mDrawDistanceMultiplier; // mFarPlane / DEFAULT_FAR_PLANE // [FIRE-35081] S32 mViewHeightInPixels; // for ViewHeightInPixels() only F32 mNearPlane; @@ -166,7 +167,8 @@ public: S32 getViewHeightInPixels() const { return mViewHeightInPixels; } F32 getAspect() const { return mAspect; } // width / height // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - F32 getInverseAspect() const { return mInverseAspect; } // width / height + //F32 getInverseAspect() const { return mInverseAspect; } // width / height + F32 getDrawDistanceMultiplier() const { return mDrawDistanceMultiplier; } // mFarPlane / DEFAULT_FAR_PLANE (could also include near plane as well) // [FIRE-35081] F32 getNear() const { return mNearPlane; } // meters F32 getFar() const { return mFarPlane; } // meters diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 31a439bc49..9a7ab65a91 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -75,6 +75,14 @@ static LLStaticHashedString sColorIn("color_in"); bool LLFace::sSafeRenderSelect = true; // false +// [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer +// Moved to allow more code to access these values +const S8 FACE_IMPORTANCE_LEVEL = 4 ; +const F32 FACE_IMPORTANCE_TO_CAMERA_OVER_DISTANCE[FACE_IMPORTANCE_LEVEL][2] = //{distance, importance_weight} +{{16.1f, 1.0f}, {32.1f, 0.5f}, {48.1f, 0.2f}, {96.1f, 0.05f} } ; +const F32 FACE_IMPORTANCE_TO_CAMERA_OVER_ANGLE[FACE_IMPORTANCE_LEVEL][2] = //{cos(angle), importance_weight} +{{0.985f /*cos(10 degrees)*/, 1.0f}, {0.94f /*cos(20 degrees)*/, 0.8f}, {0.866f /*cos(30 degrees)*/, 0.64f}, {0.0f, 0.36f}} ; +// [FIRE-35081] #define DOTVEC(a,b) (a.mV[0]*b.mV[0] + a.mV[1]*b.mV[1] + a.mV[2]*b.mV[2]) @@ -2332,7 +2340,7 @@ F32 LLFace::getTextureVirtualSize() // [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(); + //face_area = face_area * LLViewerCamera::getInstance()->getInverseAspect(); // [FIRE-35081] setVirtualSize(face_area) ; @@ -2470,8 +2478,9 @@ bool LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius) x_axis.load3(camera->getXAxis().mV); cos_angle_to_view_dir = lookAt.dot3(x_axis).getF32(); // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - // Added real in frustum check value. Previous was only false for media textures off screen and invalid rig objects - mInFrustum = cos_angle_to_view_dir > camera->getCosHalfFov() && cos_angle_to_view_dir < camera->getCosHalfFov() * 2.0f; + // 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; // [FIRE-35081] //if has media, check if the face is out of the view frustum. @@ -2506,10 +2515,17 @@ bool LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius) { cos_angle_to_view_dir = 1.0f ; mImportanceToCamera = 1.0f ; + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + mInFrustum = true; // If the face is important to the camera, it is in the frustum + mCloseToCamera = true; + // [FIRE-35081] } 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 ; @@ -2544,12 +2560,6 @@ F32 LLFace::adjustPartialOverlapPixelArea(F32 cos_angle_to_view_dir, F32 radius return 1.0f ; } -const S8 FACE_IMPORTANCE_LEVEL = 4 ; -const F32 FACE_IMPORTANCE_TO_CAMERA_OVER_DISTANCE[FACE_IMPORTANCE_LEVEL][2] = //{distance, importance_weight} - {{16.1f, 1.0f}, {32.1f, 0.5f}, {48.1f, 0.2f}, {96.1f, 0.05f} } ; -const F32 FACE_IMPORTANCE_TO_CAMERA_OVER_ANGLE[FACE_IMPORTANCE_LEVEL][2] = //{cos(angle), importance_weight} - {{0.985f /*cos(10 degrees)*/, 1.0f}, {0.94f /*cos(20 degrees)*/, 0.8f}, {0.866f /*cos(30 degrees)*/, 0.64f}, {0.0f, 0.36f}} ; - //static F32 LLFace::calcImportanceToCamera(F32 cos_angle_to_view_dir, F32 dist) { @@ -2570,7 +2580,10 @@ F32 LLFace::calcImportanceToCamera(F32 cos_angle_to_view_dir, F32 dist) } S32 i = 0 ; - for(i = 0; i < FACE_IMPORTANCE_LEVEL && dist > FACE_IMPORTANCE_TO_CAMERA_OVER_DISTANCE[i][0]; ++i); + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Added draw distance multiplier to the distance + for(i = 0; i < FACE_IMPORTANCE_LEVEL && dist > FACE_IMPORTANCE_TO_CAMERA_OVER_DISTANCE[i][0] * camera->getDrawDistanceMultiplier(); ++i); + // [FIRE-35081] i = llmin(i, FACE_IMPORTANCE_LEVEL - 1) ; F32 dist_factor = FACE_IMPORTANCE_TO_CAMERA_OVER_DISTANCE[i][1] ; diff --git a/indra/newview/llface.h b/indra/newview/llface.h index 0a1225eb0f..a3bd935760 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -127,6 +127,8 @@ public: void setPixelArea(F32 area) { mPixelArea = area; } F32 getVirtualSize() const { return mVSize; } F32 getPixelArea() const { return mPixelArea; } + F32 getImportanceToCamera() const { return mImportanceToCamera; } + F32 getCloseToCamera() const { return mCloseToCamera; } S32 getIndexInTex(U32 ch) const { llassert(ch < LLRender::NUM_TEXTURE_CHANNELS); return mIndexInTex[ch]; } void setIndexInTex(U32 ch, S32 index) { llassert(ch < LLRender::NUM_TEXTURE_CHANNELS); mIndexInTex[ch] = index; } @@ -333,6 +335,7 @@ private: //1.0: the most important. //based on the distance from the face to the view point and the angle from the face center to the view direction. F32 mImportanceToCamera ; + F32 mCloseToCamera; F32 mBoundingSphereRadius ; bool mHasMedia ; bool mIsMediaAllowed; diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp index b995fccada..0df185e716 100644 --- a/indra/newview/llviewercamera.cpp +++ b/indra/newview/llviewercamera.cpp @@ -69,7 +69,6 @@ LLViewerCamera::LLViewerCamera() : LLCamera() mCameraFOVDefault = DEFAULT_FIELD_OF_VIEW; mPrevCameraFOVDefault = DEFAULT_FIELD_OF_VIEW; mCosHalfCameraFOV = cosf(mCameraFOVDefault * 0.5f); - mCosCameraFOV = cosf(mCameraFOVDefault); mPixelMeterRatio = 0.f; mScreenPixelArea = 0; mZoomFactor = 1.f; @@ -144,10 +143,6 @@ void LLViewerCamera::updateCameraLocation(const LLVector3 ¢er, const LLVecto mAverageSpeed = (F32)LLTrace::get_frame_recording().getPeriodMeanPerSec(sVelocityStat, 50); mAverageAngularSpeed = (F32)LLTrace::get_frame_recording().getPeriodMeanPerSec(sAngularVelocityStat); mCosHalfCameraFOV = cosf(0.5f * getView() * llmax(1.0f, getAspect())); - // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - // Store the full Cos FOV value - mCosCameraFOV = cosf(getView() * llmax(1.0f, getAspect())); - // [FIRE-35081] // update pixel meter ratio using default fov, not modified one mPixelMeterRatio = (F32)(getViewHeightInPixels()/ (2.f*tanf(mCameraFOVDefault*0.5f))); @@ -827,9 +822,6 @@ void LLViewerCamera::setDefaultFOV(F32 vertical_fov_rads) setView(vertical_fov_rads); mCameraFOVDefault = vertical_fov_rads; mCosHalfCameraFOV = cosf(mCameraFOVDefault * 0.5f); - // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - mCosCameraFOV = cosf(mCameraFOVDefault); - // [FIRE-35081] } bool LLViewerCamera::isDefaultFOVChanged() diff --git a/indra/newview/llviewercamera.h b/indra/newview/llviewercamera.h index 6fa3d3c6f2..b202f0812a 100644 --- a/indra/newview/llviewercamera.h +++ b/indra/newview/llviewercamera.h @@ -81,7 +81,6 @@ public: static LLTrace::CountStatHandle<>* getVelocityStat() {return &sVelocityStat; } static LLTrace::CountStatHandle<>* getAngularVelocityStat() {return &sAngularVelocityStat; } F32 getCosHalfFov() {return mCosHalfCameraFOV;} - F32 getCosFov() {return mCosCameraFOV;} F32 getAverageSpeed() {return mAverageSpeed ;} F32 getAverageAngularSpeed() {return mAverageAngularSpeed;} @@ -121,10 +120,6 @@ protected: F32 mCameraFOVDefault; F32 mPrevCameraFOVDefault; F32 mCosHalfCameraFOV; - // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - // Store the Cos of the full FOV - F32 mCosCameraFOV; - // [FIRE-35081] LLVector3 mLastPointOfInterest; F32 mPixelMeterRatio; // Divide by distance from camera to get pixels per meter at that distance. S32 mScreenPixelArea; // Pixel area of entire window diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index a25ff25cee..651dfffed4 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -128,6 +128,7 @@ #include "llviewerparcelmgr.h" #include "llviewerstats.h" #include "llviewerstatsrecorder.h" +#include "llviewertexturelist.h" #include "llvlcomposition.h" #include "llvoavatarself.h" #include "llvoicevivox.h" @@ -12784,6 +12785,9 @@ void initialize_menus() // Develop (Fonts debugging) commit.add("Develop.Fonts.Dump", boost::bind(&LLFontGL::dumpFonts)); commit.add("Develop.Fonts.DumpTextures", boost::bind(&LLFontGL::dumpFontTextures)); + + //Develop (dump data) + commit.add("Develop.TextureList.Dump", boost::bind(&LLViewerTextureList::dumpTexturelist)); // Add telemetry controls to the viewer Develop menu (Toggle profiling) view_listener_t::addMenu(new FSProfilerToggle(), "Develop.ToggleProfiling"); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 22f872ec3f..1951df6a9c 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1178,6 +1178,9 @@ void LLViewerFetchedTexture::init(bool firstinit) mKeptSavedRawImageTime = 0.f; 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) + // [FIRE-35081] mFTType = FTT_UNKNOWN; } @@ -3053,7 +3056,11 @@ void LLViewerLODTexture::processTextureStats() else if (mBoostLevel < LLGLTexture::BOOST_HIGH && mMaxVirtualSize <= 10.f) { // If the image has not been significantly visible in a while, we don't want it - mDesiredDiscardLevel = llmin(mMinDesiredDiscardLevel, (S8)(MAX_DISCARD_LEVEL + 1)); + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + //mDesiredDiscardLevel = llmin(mMinDesiredDiscardLevel, (S8)(MAX_DISCARD_LEVEL + 1)); + // Off screen textures at 6 would not downscale. + mDesiredDiscardLevel = llmin(mMinDesiredDiscardLevel, (S8)(MAX_DISCARD_LEVEL)); + // [FIRE-35081] mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, (S32)mLoadedCallbackDesiredDiscardLevel); } else if (!mFullWidth || !mFullHeight) @@ -3063,6 +3070,8 @@ void LLViewerLODTexture::processTextureStats() } else { + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + /* //static const F64 log_2 = log(2.0); static const F64 log_4 = log(4.0); @@ -3090,10 +3099,28 @@ void LLViewerLODTexture::processTextureStats() discard_level = floorf(discard_level); F32 min_discard = 0.f; - if (mFullWidth > max_tex_res || mFullHeight > max_tex_res) - min_discard = 1.f; + */ - discard_level = llclamp(discard_level, min_discard, (F32)MAX_DISCARD_LEVEL); + // Use a S32 value for the discard level + S32 discard_level = 0; + // Find the best discard that covers the entire mMaxVirtualSize of the on screen texture + for (; discard_level <= MAX_DISCARD_LEVEL; discard_level++) + { + // If the max virtual size is greater then the current discard level, then break out of the loop and use the current discard level + if (mMaxVirtualSize > getWidth(discard_level) * getHeight(discard_level)) + { + break; + } + } + + // Use a S32 instead of a float + S32 min_discard = 0; + if (mFullWidth > max_tex_res || mFullHeight > max_tex_res) + min_discard = 1; + + //discard_level = llclamp(discard_level, min_discard, (F32)MAX_DISCARD_LEVEL); + discard_level = llclamp(discard_level, min_discard, MAX_DISCARD_LEVEL); // Don't convert to float and back again + // [FIRE-35081] // Can't go higher than the max discard level mDesiredDiscardLevel = llmin(getMaxDiscardLevel() + 1, (S32)discard_level); diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 10a79515e9..13b6b6b883 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -437,6 +437,11 @@ public: void setInFastCacheList(bool in_list) { mInFastCacheList = in_list; } bool isInFastCacheList() { return mInFastCacheList; } + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + F32 getCloseToCamera() const {return mCloseToCamera ;} // Get close to camera value + void setCloseToCamera(F32 value) {mCloseToCamera = value ;} // Set the close to camera value (0.0f or 1.0f) + // [FIRE-35081] + /*virtual*/bool isActiveFetching() override; //is actively in fetching by the fetching pipeline. virtual bool scaleDown() { return false; }; @@ -537,6 +542,9 @@ protected: bool mForSculpt ; //a flag if the texture is used as sculpt data. bool mIsFetched ; //is loaded from remote or from cache, not generated locally. + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + F32 mCloseToCamera; // Float (0.0f or 1.0f) to indicate if the texture is close to the camera + // [FIRE-35081] public: static F32 sMaxVirtualSize; //maximum possible value of mMaxVirtualSize diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 28981d4bec..2bd3f3738f 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -371,11 +371,28 @@ void LLViewerTextureList::shutdown() mInitialized = false ; //prevent loading textures again. } +// [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer +// static +// Allows the menu to call the dump method of the texture list +void LLViewerTextureList::dumpTexturelist() +{ + gTextureList.dump(); +} +// [FIRE-35081] void LLViewerTextureList::dump() { LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; LL_INFOS() << "LLViewerTextureList::dump()" << LL_ENDL; + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + S32 texture_count = 0; + S32 textures_close_to_camera = 0; + S32 image_counts[MAX_DISCARD_LEVEL + 1]; + for (S32 index = 0; index <= MAX_DISCARD_LEVEL; index++) + { + image_counts[index] = 0; + } + // [FIRE-35081] for (image_list_t::iterator it = mImageList.begin(); it != mImageList.end(); ++it) { LLViewerFetchedTexture* image = *it; @@ -385,9 +402,28 @@ void LLViewerTextureList::dump() << " size " << image->getWidth() << "x" << image->getHeight() << " discard " << image->getDiscardLevel() << " desired " << image->getDesiredDiscardLevel() + // [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) + // [FIRE-35081] << " http://asset.siva.lindenlab.com/" << image->getID() << ".texture" << LL_ENDL; + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + image_counts[image->getDiscardLevel()] += 1; + texture_count++; + textures_close_to_camera += S32(image->getCloseToCamera()); + // [FIRE-35081] } + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // Add overal texture totals + LL_INFOS() << "Texture Stats: Textures in Close to Camera " << textures_close_to_camera << " of " << texture_count << " : " << LL_ENDL; + + for (S32 index = 0; index <= MAX_DISCARD_LEVEL; index++) + { + LL_INFOS() << " Discard Level: " << index << " Number of Textures: " << image_counts[index] << LL_ENDL; + } + // [FIRE-35081] } void LLViewerTextureList::destroyGL() @@ -942,12 +978,13 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag bool current_on_screen = false; F32 vsize = 0.0f; // Moved outside the loop to save reallocation every loop F32 important_to_camera = 0.0f; + F32 close_to_camera = 0.0f; // Track if the texture is close to the cameras F64 animated = 0; // U64 used to track if a pointer is set for the animations. (The texture matrix of the face is null if no animation assigned to the texture) // So if you keep adding and the final result is 0, there is no animation // [FIRE-35081] // boost resolution of textures that are important to the camera // Can instead of using max for a min of 1.0, just subtract 1 from the boost and just do a 1 + (TextureCameraBoost - 1) * importanceToCamera) - static LLCachedControl texture_camera_boost(gSavedSettings, "TextureCameraBoost", 7.f); + static LLCachedControl texture_camera_boost(gSavedSettings, "TextureCameraBoost", 7.f); LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; for (U32 i = 0; i < LLRender::NUM_TEXTURE_CHANNELS; ++i) { @@ -1026,9 +1063,14 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag // Lerp instead of doing conditional input // If the image is import to the camera, even a little then make the on screen true on_screen_count += S32(important_to_camera * 1000.0f); - vsize = vsize + (vsize * (1.0f + important_to_camera * texture_camera_boost) - vsize) * F32(current_on_screen); - + //vsize = vsize + (vsize * (1.0f + important_to_camera * texture_camera_boost) - vsize) * F32(current_on_screen); + // Apply boost of size based upon importance to camera + vsize = vsize + (vsize * important_to_camera * 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 * 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; max_on_screen_vsize = llmax(max_on_screen_vsize, vsize); max_vsize = llmax(max_vsize, vsize * bias); // [FIRE-35081] @@ -1039,7 +1081,8 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer // Replaced all the checks for this bool to be only in this 1 place instead of in the loop. // If the on screen counter is greater then 0, then there was at least 1 on screen texture - on_screen = bool(on_screen_count); + on_screen = bool(on_screen_count); + imagep->setCloseToCamera(close_to_camera > 0.0f ? 1.0f : 0.0f); //if (face_count > 1024) // Add check for if the image is animated to boost to high as well @@ -1078,16 +1121,25 @@ 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) + 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); } // All other texture cases will use max_vsize with bias applied. else - { + { 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] } diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h index 3816c32500..c8e9693c58 100644 --- a/indra/newview/llviewertexturelist.h +++ b/indra/newview/llviewertexturelist.h @@ -111,6 +111,9 @@ public: static void receiveImageHeader(LLMessageSystem *msg, void **user_data); static void receiveImagePacket(LLMessageSystem *msg, void **user_data); // + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + static void dumpTexturelist(); // Added code to handle dumping texture information + // [FIRE-35081] public: LLViewerTextureList(); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index b9d9830298..f01e813a3f 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2275,12 +2275,23 @@ 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) { 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.length()/dist); @@ -2300,12 +2311,23 @@ 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; + 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); @@ -8082,7 +8104,7 @@ bool LLPipeline::renderSnapshotFrame(LLRenderTarget* src, LLRenderTarget* dst) { float frame_width = w; float frame_height = frame_width / snapshot_aspect; - // Centre this box in [0..1][0..1] + // Centre this box in [0..1]�[0..1] float y_offset = 0.5f * (h - frame_height); left = 0.f; top = y_offset / h; @@ -8093,7 +8115,7 @@ bool LLPipeline::renderSnapshotFrame(LLRenderTarget* src, LLRenderTarget* dst) { float frame_height = h; float frame_width = h * snapshot_aspect; - // Centre this box in [0..1][0..1] + // Centre this box in [0..1]�[0..1] float x_offset = 0.5f * (w - frame_width); left = x_offset / w; top = 0.f; diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index f8a8fd49b3..bb2f0ebf23 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -5761,6 +5761,20 @@ + + + + + + + Date: Tue, 11 Mar 2025 23:51:23 -0300 Subject: [PATCH 06/30] Added 2 minor fixes for LLFace Added init value for mCloseToCmera for LLFace Changed mCloseToCamera assignment from True to 1.0f (It was a bool at one point) in LLFace --- indra/newview/llface.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 9a7ab65a91..4f95125c5c 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -180,6 +180,9 @@ void LLFace::init(LLDrawable* drawablep, LLViewerObject* objp) mFaceColor = LLColor4(1,0,0,1); mImportanceToCamera = 0.f ; + // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + mCloseToCamera = 0.0f; + // [FIRE-35081] mBoundingSphereRadius = 0.0f ; mTexExtents[0].set(0, 0); @@ -2517,7 +2520,7 @@ bool LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius) mImportanceToCamera = 1.0f ; // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer mInFrustum = true; // If the face is important to the camera, it is in the frustum - mCloseToCamera = true; + mCloseToCamera = 1.0f; // [FIRE-35081] } else From ed687991f66cc6f1ea030f153cb41fc94bda2944 Mon Sep 17 00:00:00 2001 From: chanayane Date: Thu, 13 Mar 2025 15:03:47 +0100 Subject: [PATCH 07/30] prevents having Move Lock activated but disabled when for some reason the LSL Bridge is not worn or not ready --- indra/newview/llviewermenu.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index a25ff25cee..fcf1f6b105 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5141,6 +5141,13 @@ class FSSelfCheckMoveLock : public view_listener_t if (LLGridManager::getInstance()->isInSecondLife()) { new_value = gSavedPerAccountSettings.getBOOL("UseMoveLock"); + // prevents having Move Lock activated but disabled when for some reason the LSL Bridge is not worn or not ready + if (new_value && !enable_bridge_function()) + { + gSavedPerAccountSettings.setBOOL("UseMoveLock", false); + new_value = false; + } + // } #ifdef OPENSIM else From c082f0cd76a5cb6bb484e8e7928ce064aee0a1e1 Mon Sep 17 00:00:00 2001 From: minerjr Date: Mon, 17 Mar 2025 23:13:41 -0300 Subject: [PATCH 08/30] FIRE-35081 - Handled animated/media textures, grass, tree and light textures Added new boost levels for Tree, Grass and Light textures (More for tracking as they have custom hard coded values for the mPixelArea which causes issues with loading of sizes. Added adjustments for the calcPixelArea and calcImportanceToCamera as well as getTextureVirtualSize Added virtual texture size updates for Media textures Added code to scale down off screen textures (saves a lot of texture VRAM. Added additional features for the LLViewerTextureList::Dump Only issue is server controlled textures which animate tend to load low quality, then upscale as well as Sculpted Volume's which force textures to reload. --- indra/llrender/llgltexture.cpp | 6 +++ indra/llrender/llgltexture.h | 5 ++ indra/newview/llappviewer.cpp | 4 +- indra/newview/llface.cpp | 40 +++++++++------ indra/newview/llviewermedia.cpp | 1 + indra/newview/llviewertexture.cpp | 73 ++++++++++++++++++++++++--- indra/newview/llviewertexturelist.cpp | 39 +++++++++----- indra/newview/llvoavatar.cpp | 6 ++- indra/newview/llvograss.cpp | 6 ++- indra/newview/llvotree.cpp | 6 ++- indra/newview/llvovolume.cpp | 22 +++++++- indra/newview/pipeline.cpp | 21 -------- 12 files changed, 166 insertions(+), 63 deletions(-) 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); From bd45bd6e4b64d141cfe55444f67b27982753081f Mon Sep 17 00:00:00 2001 From: minerjr Date: Mon, 17 Mar 2025 23:16:01 -0300 Subject: [PATCH 09/30] FIRE-35081 - minor fixup for Pipeline.cpp Removed /* from the code (Was missed in previous checkin) --- indra/newview/pipeline.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 6422ceb8ae..f27fe3dee1 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. - /* if (dist < 16.f) { dist /= 16.f; From ac93966a8420de08e1d37eecbe986f48e5d20b76 Mon Sep 17 00:00:00 2001 From: humbletim Date: Thu, 20 Mar 2025 18:04:32 -0400 Subject: [PATCH 10/30] FIRE-34020 - Copy of address bar contents does not URL encode space in region name for OpenSim only Escape clipboard URLs starting with hop:// too --- indra/newview/llurllineeditorctrl.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/indra/newview/llurllineeditorctrl.cpp b/indra/newview/llurllineeditorctrl.cpp index de0ed645eb..a4d9945783 100644 --- a/indra/newview/llurllineeditorctrl.cpp +++ b/indra/newview/llurllineeditorctrl.cpp @@ -86,6 +86,10 @@ void LLURLLineEditor::copyEscapedURLToClipboard() // *HACK: Because LLSLURL is currently broken we cannot use it to check if unescaped_text is a valid SLURL (see EXT-8335). if (LLStringUtil::startsWith(unescaped_text, "http://") || LLStringUtil::startsWith(unescaped_text, "secondlife://")) // SLURL text_to_copy = utf8str_to_wstring(LLWeb::escapeURL(unescaped_text)); + // [FIRE-34020] Copy of address bar contents does not URL encode space in region name for OpenSim only + else if (LLStringUtil::startsWith(unescaped_text, "hop://")) + text_to_copy = utf8str_to_wstring(LLWeb::escapeURL(unescaped_text)); + // else // human-readable location text_to_copy = utf8str_to_wstring(unescaped_text); From f54d29ba69c7367134256a7094125c0bd23a587b Mon Sep 17 00:00:00 2001 From: Beq Date: Fri, 21 Mar 2025 00:27:38 +0000 Subject: [PATCH 11/30] clarify logic precedence to keep gcc (and me) happy --- indra/llui/llconsole.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp index 92620270b8..0c5714d952 100644 --- a/indra/llui/llconsole.cpp +++ b/indra/llui/llconsole.cpp @@ -565,12 +565,12 @@ void LLConsole::Paragraph::updateLines(F32 screen_width, const LLFontGL* font, L { if ( !force_resize ) { - if ( mMaxWidth >= 0.0f // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer + // if ( mMaxWidth >= 0.0f //&& mMaxWidth < screen_width) // If viewer window was made as small as possible with the console enabled, it would cause an assert error // as the line below can go as small as -38 - && mMaxWidth < screen_width || screen_width <= 30) + if ( ((mMaxWidth >= 0.0f) && (mMaxWidth < screen_width)) || (screen_width <= 30) ) // [FIRE-35081] { return; //No resize required. From 5a14d48a941efcf638804df35630d4dc0ddb4a5a Mon Sep 17 00:00:00 2001 From: Beq Date: Sat, 22 Mar 2025 00:47:28 +0000 Subject: [PATCH 12/30] [FIRE-35007][#3331] Mirrors not working after relog even when enabled. This fixes the bug, but the deeper problem of NaN behaviour under fastmath needs to be examined. --- indra/newview/llheroprobemanager.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/indra/newview/llheroprobemanager.cpp b/indra/newview/llheroprobemanager.cpp index 6589f18410..477a348c72 100644 --- a/indra/newview/llheroprobemanager.cpp +++ b/indra/newview/llheroprobemanager.cpp @@ -60,7 +60,7 @@ static void touch_default_probe(LLReflectionMap* probe) } } -LLHeroProbeManager::LLHeroProbeManager() +LLHeroProbeManager::LLHeroProbeManager():mMirrorNormal(0,0,1) // [FIRE-35007][#3331] mirrors not working after relog. make sure the mirror normal is not zero length { } @@ -84,12 +84,14 @@ void LLHeroProbeManager::update() // For some reason clearing shaders will cause mirrors to actually work. // There's likely some deeper state issue that needs to be resolved. // - Geenz 2025-02-25 - if (!mInitialized && LLStartUp::getStartupState() > STATE_PRECACHE) - { - LLViewerShaderMgr::instance()->clearShaderCache(); - LLViewerShaderMgr::instance()->setShaders(); - mInitialized = true; - } + // [FIRE-35007][#3331] mirrors not working after relog. hack no longer needed. + // if (!mInitialized && LLStartUp::getStartupState() > STATE_PRECACHE) + // { + // LLViewerShaderMgr::instance()->clearShaderCache(); + // LLViewerShaderMgr::instance()->setShaders(); + // mInitialized = true; + // } + // LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY; llassert(!gCubeSnapshot); // assert a snapshot is not in progress From 961044daaa06acbdcc71c2bf4aec30e0f59b62fc Mon Sep 17 00:00:00 2001 From: PanteraPolnocy Date: Sat, 22 Mar 2025 16:57:07 +0100 Subject: [PATCH 13/30] =?UTF-8?q?FIRE-35272,=20FIRE-35266=20Updated=20Chin?= =?UTF-8?q?ese=20(by=20=20=E5=B0=8F=E6=BB=A2=20Zi=20Ying),=20Russian=20(by?= =?UTF-8?q?=20Romka=20Swallowtail)=20and=20Polish=20translations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../skins/default/xui/pl/floater_fs_poser.xml | 2 +- .../skins/default/xui/pl/menu_viewer.xml | 1 + .../skins/default/xui/ru/floater_fs_poser.xml | 61 +++++++++---------- .../skins/default/xui/ru/menu_viewer.xml | 29 ++++++++- .../skins/default/xui/zh/menu_viewer.xml | 3 + 5 files changed, 59 insertions(+), 37 deletions(-) diff --git a/indra/newview/skins/default/xui/pl/floater_fs_poser.xml b/indra/newview/skins/default/xui/pl/floater_fs_poser.xml index 21eeade61e..8bcd877ca1 100644 --- a/indra/newview/skins/default/xui/pl/floater_fs_poser.xml +++ b/indra/newview/skins/default/xui/pl/floater_fs_poser.xml @@ -227,7 +227,7 @@ Góra/Dół: - Lewo/Prawo: + Lwo/Prw: Zawijanie: diff --git a/indra/newview/skins/default/xui/pl/menu_viewer.xml b/indra/newview/skins/default/xui/pl/menu_viewer.xml index 0ce2db7c70..779ed541f8 100644 --- a/indra/newview/skins/default/xui/pl/menu_viewer.xml +++ b/indra/newview/skins/default/xui/pl/menu_viewer.xml @@ -668,6 +668,7 @@ + diff --git a/indra/newview/skins/default/xui/ru/floater_fs_poser.xml b/indra/newview/skins/default/xui/ru/floater_fs_poser.xml index 16f5239a1c..2e3836c827 100644 --- a/indra/newview/skins/default/xui/ru/floater_fs_poser.xml +++ b/indra/newview/skins/default/xui/ru/floater_fs_poser.xml @@ -13,6 +13,7 @@ Хвост Задние конечности Крылья + Уши/Нос Весь аватар Торс @@ -206,28 +207,45 @@ Чувствительность трекпада: + + + - + + + - + + + + + + + + + + + @@ -534,6 +546,8 @@ + + @@ -573,6 +587,7 @@ + @@ -603,9 +618,16 @@ - + + + + + + + + @@ -697,6 +719,7 @@ + diff --git a/indra/newview/skins/default/xui/zh/menu_viewer.xml b/indra/newview/skins/default/xui/zh/menu_viewer.xml index c343f6d514..de90f67f75 100644 --- a/indra/newview/skins/default/xui/zh/menu_viewer.xml +++ b/indra/newview/skins/default/xui/zh/menu_viewer.xml @@ -649,6 +649,9 @@ + + + From de2ef92061fb82bd45eea9687bf53bf8a5c5098f Mon Sep 17 00:00:00 2001 From: PanteraPolnocy Date: Sat, 22 Mar 2025 18:23:45 +0100 Subject: [PATCH 14/30] FIRE-35275 French translation update, by Laurent Bechir --- .../skins/default/xui/fr/floater_fs_poser.xml | 284 +++++++++--------- .../skins/default/xui/fr/menu_viewer.xml | 1 + 2 files changed, 144 insertions(+), 141 deletions(-) diff --git a/indra/newview/skins/default/xui/fr/floater_fs_poser.xml b/indra/newview/skins/default/xui/fr/floater_fs_poser.xml index f6dcc938d6..86996e6a3f 100644 --- a/indra/newview/skins/default/xui/fr/floater_fs_poser.xml +++ b/indra/newview/skins/default/xui/fr/floater_fs_poser.xml @@ -1,146 +1,148 @@ - Corps - Front/sourcils - Yeux/Paupières - Joues/Lèvres - Main gauche - Bras gauche - Main droite - Bras droit - Jambes - Queue - Membres postérieurs - Ailes - Oreilles/nez - Tout l'avatar - Torse - Poitrine - Cou - Tête - Oeil droit - Oeil gauche - Front, côté gauche - Front, côté droit - Sourcil, extérieur gauche - Sourcil, milieu gauche - Sourcil, intérieur gauche - Sourcil, extérieur droit - Sourcil, milieu droit - Sourcil, intérieur droit - Paupière, en haut à gauche - Paupière, en bas à gauche - Paupière, en haut à droite - Paupière en bas à droite - Oreille en haut à gauche - Oreille en bas à gauche - Oreille en haut à droite - Oreille en bas à droite - Nez à gauche - Nez au milieu - Nez à droite - Bas de la joue gauche - Haut de la joue gauche - Bas de la joue droite - Haut de la joue droite - Mâchoire - Dents du bas - Lèvre du bas à gauche - Lèvre du bas à droite - Lèvre du bas au milieu - Base de la langue - Extrémité de la langue - Forme de la mâchoire - Milieu du front - Base du nez - Dents du haut - Lèvre supérieure à gauche - Lèvre supérieure à droite - Coin gauche de la bouche - Coin droit de la bouche - Milieu de la lèvre supérieure - Coin interne gauche de l'œil - Coin interne droit de l'œil - Arête du nez - Col - Bras entier - Avant-bras - Poignet - Base du majeur - Milieu du majeur - Extrémité du majeur - Base de l'index - Milieu de l'index - Extrémité de l'index - Base de l'annulaire - Milieu de l'annulaire - Extrémité de l'annulaire - Base de l'auriculaire - Milieu de l'auriculaire - Extrémité de l'auriculaire - Base du pouce - Milieu du pouce - Extrémité du pouce - Col - Bras entier - Avant-bras - Poignet - Base du majeur - Milieu du majeur - Extrémité du majeur - Base de l'index - Milieu de l'index - Extrémité de l'index - Base de l'annulaire - Milieu de l'annulaire - Extrémité de l'annulaire - Base de l'auriculaire - Milieu de l'auriculaire - Extrémité de l'auriculaire - Base du pouce - Milieu du pouce - Extrémité du pouce - Articulations - Gauche 1 - Gauche 2 - Gauche 3 - Gauche 4 - Pale gauche - Droite 1 - Droite 2 - Droite 3 - Droite 4 - Pale droit - Jambe droite - Genou droit - Cheville droite - Pied droit - Orteil droit - Jambe gauche - Genou gauche - Cheville gauche - Pied gauche - Orteil gauche - Base de la queue - Queue 2 - Queue 3 - Queue 4 - Queue 5 - Extrémité de la queue - Entrejambe - Membres postérieurs - Pied gauche - Gauche 2 - Gauche 3 - Gauche 4 - Pied droit - Droite 2 - Droite 3 - Droite 4 - Fesses - Ventre - Sein gauche - Sein droit + Corps + Front/sourcils + Yeux/Paupières + Joues/Lèvres + Main gauche + Bras gauche + Main droite + Bras droit + Jambes + Queue + Membres postérieurs + Ailes + Oreilles/nez + Tout l'avatar + Torse + Poitrine + Cou + Tête + Oeil droit + Oeil gauche + Front, côté gauche + Front, côté droit + Sourcil, extérieur gauche + Sourcil, milieu gauche + Sourcil, intérieur gauche + Sourcil, extérieur droit + Sourcil, milieu droit + Sourcil, intérieur droit + Paupière, en haut à gauche + Paupière, en bas à gauche + Paupière, en haut à droite + Paupière en bas à droite + Oreille en haut à gauche + Oreille en bas à gauche + Oreille en haut à droite + Oreille en bas à droite + Nez à gauche + Nez au milieu + Nez à droite + Bas de la joue gauche + Haut de la joue gauche + Bas de la joue droite + Haut de la joue droite + Mâchoire + Dents du bas + Lèvre du bas à gauche + Lèvre du bas à droite + Lèvre du bas au milieu + Base de la langue + Extrémité de la langue + Forme de la mâchoire + Milieu du front + Base du nez + Dents du haut + Lèvre supérieure à gauche + Lèvre supérieure à droite + Coin gauche de la bouche + Coin droit de la bouche + Milieu de la lèvre supérieure + Coin interne gauche de l'œil + Coin interne droit de l'œil + Arête du nez + Col + Bras entier + Avant-bras + Poignet + Base du majeur + Milieu du majeur + Extrémité du majeur + Base de l'index + Milieu de l'index + Extrémité de l'index + Base de l'annulaire + Milieu de l'annulaire + Extrémité de l'annulaire + Base de l'auriculaire + Milieu de l'auriculaire + Extrémité de l'auriculaire + Base du pouce + Milieu du pouce + Extrémité du pouce + Col + Bras entier + Avant-bras + Poignet + Base du majeur + Milieu du majeur + Extrémité du majeur + Base de l'index + Milieu de l'index + Extrémité de l'index + Base de l'annulaire + Milieu de l'annulaire + Extrémité de l'annulaire + Base de l'auriculaire + Milieu de l'auriculaire + Extrémité de l'auriculaire + Base du pouce + Milieu du pouce + Extrémité du pouce + Articulations + Gauche 1 + Gauche 2 + Gauche 3 + Gauche 4 + Pale gauche + Droite 1 + Droite 2 + Droite 3 + Droite 4 + Pale droit + Jambe droite + Genou droit + Cheville droite + Pied droit + Orteil droit + Jambe gauche + Genou gauche + Cheville gauche + Pied gauche + Orteil gauche + Base de la queue + Queue 2 + Queue 3 + Queue 4 + Queue 5 + Extrémité de la queue + Entrejambe + Membres postérieurs + Pied gauche + Gauche 2 + Gauche 3 + Gauche 4 + Pied droit + Droite 2 + Droite 3 + Droite 4 + Fesses + Ventre + Sein gauche + Sein droit + Charger pose + Charger diff diff --git a/indra/newview/skins/default/xui/fr/menu_viewer.xml b/indra/newview/skins/default/xui/fr/menu_viewer.xml index 00be90a8f1..ce9fbe86eb 100644 --- a/indra/newview/skins/default/xui/fr/menu_viewer.xml +++ b/indra/newview/skins/default/xui/fr/menu_viewer.xml @@ -624,6 +624,7 @@ + From b47d3c3ef543681c377f18b2dc4c43146adc745a Mon Sep 17 00:00:00 2001 From: minerjr Date: Sat, 22 Mar 2025 19:15:03 -0300 Subject: [PATCH 15/30] Fix float typos There were five files which had float values assigned which were missing the "f" on them so they are in fact a doubles. These get treated as errors when you change the floating point compile options from Fast to Precise or Strict as the fast path turns them from doubles to floats and suppresses the warnings. --- indra/newview/fsmaniprotatejoint.h | 4 ++-- indra/newview/fsposingmotion.h | 2 +- indra/newview/llviewermedia.cpp | 2 +- indra/newview/llviewerstatsrecorder.cpp | 2 +- indra/newview/llvoicewebrtc.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/indra/newview/fsmaniprotatejoint.h b/indra/newview/fsmaniprotatejoint.h index 4feb5e2600..5a8a05a03c 100644 --- a/indra/newview/fsmaniprotatejoint.h +++ b/indra/newview/fsmaniprotatejoint.h @@ -132,8 +132,8 @@ private: void renderActiveRing( F32 radius, F32 width, const LLColor4& front_color, const LLColor4& back_color); void renderManipulatorRings(const LLVector3& center, const LLQuaternion& finalAlignment); - void renderCenterCircle(const F32 radius, const LLColor4& normal_color = LLColor4(0.7f,0.7,0.7f,0.2), const LLColor4& highlight_color = LLColor4(0.8f,0.8f,0.8f,0.3)); - void renderCenterSphere(const F32 radius, const LLColor4& normal_color = LLColor4(0.7f,0.7,0.7f,0.2), const LLColor4& highlight_color = LLColor4(0.8f,0.8f,0.8f,0.3)); + void renderCenterCircle(const F32 radius, const LLColor4& normal_color = LLColor4(0.7f,0.7f,0.7f,0.2f), const LLColor4& highlight_color = LLColor4(0.8f,0.8f,0.8f,0.3f)); // add missing f for float + void renderCenterSphere(const F32 radius, const LLColor4& normal_color = LLColor4(0.7f,0.7f,0.7f,0.2f), const LLColor4& highlight_color = LLColor4(0.8f,0.8f,0.8f,0.3f)); // add missing f for float void renderRingPass(const RingRenderParams& params, float radius, float width, int pass); void renderAxes(const LLVector3& center, F32 size, const LLQuaternion& rotation); diff --git a/indra/newview/fsposingmotion.h b/indra/newview/fsposingmotion.h index 3b9d3a7a0d..71c7d41063 100644 --- a/indra/newview/fsposingmotion.h +++ b/indra/newview/fsposingmotion.h @@ -133,7 +133,7 @@ private: /// This takes advantage of how the actual vector migrates to equality with the target vector. /// Certain physics settings (bouncing whatnots) account for some longer term work, but as this is applied per joint, it tends to reduce a lot of work. /// - const F32 closeEnough = 1e-6; + const F32 closeEnough = 1e-6f; // add missing f for float /// /// The kind of joint state this animation is concerned with changing. diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index d0e7e7c071..28896e3cf5 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -695,7 +695,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg) static LLCachedControl max_instances(gSavedSettings, "PluginInstancesTotal", 8); static LLCachedControl max_normal(gSavedSettings, "PluginInstancesNormal", 2); static LLCachedControl max_low(gSavedSettings, "PluginInstancesLow", 4); - static LLCachedControl max_cpu(gSavedSettings, "PluginInstancesCPULimit", 0.9); + static LLCachedControl max_cpu(gSavedSettings, "PluginInstancesCPULimit", 0.9f); // add missing f for float // Setting max_cpu to 0.0 disables CPU usage checking. bool check_cpu_usage = (max_cpu != 0.0f); diff --git a/indra/newview/llviewerstatsrecorder.cpp b/indra/newview/llviewerstatsrecorder.cpp index 58065ecce5..4c0f120326 100644 --- a/indra/newview/llviewerstatsrecorder.cpp +++ b/indra/newview/llviewerstatsrecorder.cpp @@ -41,7 +41,7 @@ LLViewerStatsRecorder::LLViewerStatsRecorder() : mLastSnapshotTime(0.0), mEnableStatsRecording(false), mEnableStatsLogging(false), - mInterval(0.2), + mInterval(0.2f), // add missing f for float mMaxDuration(300.f), mSkipSaveIfZeros(false) { diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index c3245b00f4..782c0c89fc 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -85,7 +85,7 @@ namespace { const F32 VOLUME_SCALE_WEBRTC = 0.01f; const F32 LEVEL_SCALE_WEBRTC = 0.008f; - const F32 SPEAKING_AUDIO_LEVEL = 0.30; + const F32 SPEAKING_AUDIO_LEVEL = 0.30f; // add missing f for float const uint32_t PEER_GAIN_CONVERSION_FACTOR = 220; From 653a9b4df7dbe9901903112b637fdbdae8b360eb Mon Sep 17 00:00:00 2001 From: Hecklezz Date: Sun, 23 Mar 2025 17:58:58 +1000 Subject: [PATCH 16/30] Fix for client freeze in OpenSim getting picks limit --- indra/newview/llagentbenefits.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/newview/llagentbenefits.cpp b/indra/newview/llagentbenefits.cpp index f176b14f00..63dd55693e 100644 --- a/indra/newview/llagentbenefits.cpp +++ b/indra/newview/llagentbenefits.cpp @@ -37,6 +37,8 @@ #include "llviewerregion.h" // +constexpr S32 MAX_OPENSIM_PICKS = S32_MAX; // [FIRE-35276] Fix for client freeze in OpenSim getting picks limit + LLAgentBenefits::LLAgentBenefits(): m_initalized(false), m_animated_object_limit(-1), @@ -213,7 +215,7 @@ S32 LLAgentBenefits::getPicksLimit() const { // OpenSim legacy economy //return m_picks_limit; - return LLGridManager::instance().isInSecondLife() ? m_picks_limit : LLAgentPicksInfo::instance().getMaxNumberOfPicks(); + return LLGridManager::instance().isInSecondLife() ? m_picks_limit : MAX_OPENSIM_PICKS; // } From fe125e167b1a514d1f3b6bdc5a013fff495cb6a0 Mon Sep 17 00:00:00 2001 From: minerjr Date: Sun, 23 Mar 2025 14:14:57 -0300 Subject: [PATCH 17/30] FIRE-35280 - Inventory gallery and combination view no longer display thumbnails Reverted change to the LLViewerTextureList's updateImageFetchTextures which was intended to skip processing UI textures to downscale as they don't need to be changed, but the problem is if a new local texture is created it does not get processed. --- indra/newview/llviewertexturelist.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 6903e1ec6a..04522d9b65 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -1401,11 +1401,7 @@ F32 LLViewerTextureList::updateImagesFetchTextures(F32 max_time) iter = mUUIDMap.begin(); } - // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - //if (iter->second->getGLTexture()) - // Can skip processing TEX_LIST_SCALED as they are UI elements and should not be discarded - if (iter->second->getGLTexture() && get_element_type(iter->second->getBoostLevel()) == TEX_LIST_STANDARD) - // [FIRE-35081] + if (iter->second->getGLTexture()) { entries.push_back(iter->second); } From 2802475f053e54d047bea870c43dbe3c42d5facd Mon Sep 17 00:00:00 2001 From: minerjr Date: Mon, 24 Mar 2025 07:22:53 -0300 Subject: [PATCH 18/30] FIRE-35081 - Fix crash on load Reverted added code for the LLFace::switchTexture to update the texture being passed in to use the existing texture boost and max virtual size as the mTexture[ch] may be NULL or invalid due to being deleted. --- indra/newview/llface.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 5ffcc1a059..50409190eb 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -386,11 +386,6 @@ 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()) From 8c57cb9076e9f61d9a119fef9de22ecae158873e Mon Sep 17 00:00:00 2001 From: Beq Date: Sun, 23 Mar 2025 22:14:41 +0000 Subject: [PATCH 19/30] [FIRE-35276] add OpenSim MaxProfilePicks support and set fallback to 20 Fallback value agreed with Ubit. --- indra/newview/llagentbenefits.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/indra/newview/llagentbenefits.cpp b/indra/newview/llagentbenefits.cpp index 63dd55693e..5b737e35f3 100644 --- a/indra/newview/llagentbenefits.cpp +++ b/indra/newview/llagentbenefits.cpp @@ -37,7 +37,6 @@ #include "llviewerregion.h" // -constexpr S32 MAX_OPENSIM_PICKS = S32_MAX; // [FIRE-35276] Fix for client freeze in OpenSim getting picks limit LLAgentBenefits::LLAgentBenefits(): m_initalized(false), @@ -215,7 +214,27 @@ S32 LLAgentBenefits::getPicksLimit() const { // OpenSim legacy economy //return m_picks_limit; - return LLGridManager::instance().isInSecondLife() ? m_picks_limit : MAX_OPENSIM_PICKS; + if (LLGridManager::instance().isInSecondLife()) + { + return m_picks_limit; + } + else + { + constexpr S32 MAX_OPENSIM_PICKS_FALLBACK = 20; // [FIRE-35276] Freeze on OpenSim (default agreed with Ubit Umarov) (originally by Haklezz) + + S32 max_profile_picks = MAX_OPENSIM_PICKS_FALLBACK; + + if (gAgent.getRegion()) + { + LLSD features; + gAgent.getRegion()->getSimulatorFeatures(features); + if (features.has("MaxProfilePicks")) + { + max_profile_picks = features["MaxProfilePicks"].asInteger(); + } + } + return max_profile_picks; + } // } From 6410a2597520f45fc5ff49d12fde098ebf0b3eea Mon Sep 17 00:00:00 2001 From: Beq Date: Mon, 24 Mar 2025 12:11:27 +0000 Subject: [PATCH 20/30] Add "Hecklezz" to contributors --- indra/newview/skins/default/xui/en/floater_about.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml index 3774f25ca7..b01a41ab79 100644 --- a/indra/newview/skins/default/xui/en/floater_about.xml +++ b/indra/newview/skins/default/xui/en/floater_about.xml @@ -165,7 +165,7 @@ Additional code generously contributed to Firestorm by: top_pad="4" width="450" wrap="true"> -Aira Yumi, Albatroz Hird, Alexie Birman, Andromeda Rage, Angus Boyd, Animats, Armin Weatherwax, Ayane Lyla, Casper Warden, Chalice Yao, Chaser Zaks, Chorazin Allen, Cron Stardust, Damian Zhaoying, Dan Threebeards, Dawa Gurbux, Dax Dupont, Denver Maksim, Dragonborn Forzane, Drake Arconis, Felyza Wishbringer, f0rbidden, Fractured Crystal, Geenz Spad, Gibson Firehawk, Hitomi Tiponi, humbletim, Inusaito Sayori, Jean Severine, Katharine Berry, Kittin Ninetails, Kool Koolhoven, Lance Corrimal, Lassie, Latif Khalifa, Laurent Bechir, Magne Metaverse LLC, Magus Freston, Makidoll, Manami Hokkigai, MartinRJ Fayray, McCabe Maxstead, Melancholy Lemon, Melysmile, Mimika Oh, minerjr, Mister Acacia, MorganMegan, Morgan Pennent, Mysty Saunders, Nagi Michinaga, Name Short, nhede Core, NiranV Dean, Nogardrevlis Lectar, Oren Hurvitz, paperwork, Penny Patton, Peyton Menges, programmtest, Qwerty Venom, rafak360, Rebecca Ashbourne, Revolution Smythe, Romka Swallowtail, Sahkolihaa Contepomi, sal Kaligawa, Samm Florian, Satomi Ahn, Sei Lisa, Sempervirens Oddfellow, Shin Wasp, Shyotl Kuhr, Sione Lomu, Skills Hak, StarlightShining, Sunset Faulkes, Tapple Gao, Testicular Slingshot, Thickbrick Sleaford, Ubit Umarov, Vaalith Jinn, Vincent Sylvester, Whirly Fizzle, Xenhat Liamano, 小滢 Zi Ying, Zwagoth Klaar and others. +Aira Yumi, Albatroz Hird, Alexie Birman, Andromeda Rage, Angus Boyd, Animats, Armin Weatherwax, Ayane Lyla, Casper Warden, Chalice Yao, Chaser Zaks, Chorazin Allen, Cron Stardust, Damian Zhaoying, Dan Threebeards, Dawa Gurbux, Dax Dupont, Denver Maksim, Dragonborn Forzane, Drake Arconis, Felyza Wishbringer, f0rbidden, Fractured Crystal, Geenz Spad, Gibson Firehawk, Hecklezz, Hitomi Tiponi, humbletim, Inusaito Sayori, Jean Severine, Katharine Berry, Kittin Ninetails, Kool Koolhoven, Lance Corrimal, Lassie, Latif Khalifa, Laurent Bechir, Magne Metaverse LLC, Magus Freston, Makidoll, Manami Hokkigai, MartinRJ Fayray, McCabe Maxstead, Melancholy Lemon, Melysmile, Mimika Oh, minerjr, Mister Acacia, MorganMegan, Morgan Pennent, Mysty Saunders, Nagi Michinaga, Name Short, nhede Core, NiranV Dean, Nogardrevlis Lectar, Oren Hurvitz, paperwork, Penny Patton, Peyton Menges, programmtest, Qwerty Venom, rafak360, Rebecca Ashbourne, Revolution Smythe, Romka Swallowtail, Sahkolihaa Contepomi, sal Kaligawa, Samm Florian, Satomi Ahn, Sei Lisa, Sempervirens Oddfellow, Shin Wasp, Shyotl Kuhr, Sione Lomu, Skills Hak, StarlightShining, Sunset Faulkes, Tapple Gao, Testicular Slingshot, Thickbrick Sleaford, Ubit Umarov, Vaalith Jinn, Vincent Sylvester, Whirly Fizzle, Xenhat Liamano, 小滢 Zi Ying, Zwagoth Klaar and others. Date: Mon, 24 Mar 2025 13:45:22 +0100 Subject: [PATCH 21/30] Make colors for FPS display optional and themeable --- indra/newview/app_settings/settings.xml | 11 ++++ indra/newview/llstatusbar.cpp | 50 ++++++++++--------- indra/newview/skins/ansastorm/colors.xml | 15 ++++++ .../ansastorm/themes/classic_brown/colors.xml | 15 ++++++ indra/newview/skins/default/colors.xml | 15 ++++++ .../skins/default/xui/de/menu_hide_navbar.xml | 1 + .../skins/default/xui/de/panel_status_bar.xml | 2 +- .../skins/default/xui/en/menu_hide_navbar.xml | 13 +++++ 8 files changed, 98 insertions(+), 24 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 45d2941acf..b28681798a 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -25423,6 +25423,17 @@ Change of this parameter will affect the layout of buttons in notification toast Value 1 + FSStatusBarShowFPSColors + + Comment + If enabled, display FPS number in a color based on the current status. + Persist + 1 + Type + Boolean + Value + 1 + FSExperimentalLostAttachmentsFix Comment diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index f6e682dd5e..070c56c828 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -604,44 +604,48 @@ void LLStatusBar::refresh() static LLCachedControl fsStatusBarShowFPS(gSavedSettings, "FSStatusBarShowFPS"); if (fsStatusBarShowFPS && mFPSUpdateTimer.getElapsedTimeF32() > 1.f) { + static LLCachedControl fsStatusBarShowFPSColors(gSavedSettings, "FSStatusBarShowFPSColors"); static LLCachedControl max_fps(gSavedSettings, "FramePerSecondLimit"); static LLCachedControl limit_fps_enabled(gSavedSettings, "FSLimitFramerate"); static LLCachedControl vsync_enabled(gSavedSettings, "RenderVSyncEnable"); - static const auto fps_below_limit_color = LLUIColorTable::instance().getColor("Yellow"); - static const auto fps_limit_reached_color = LLUIColorTable::instance().getColor("Green"); - static const auto vsync_limit_reached_color = LLUIColorTable::instance().getColor("Green"); - static const auto fps_uncapped_color = LLUIColorTable::instance().getColor("White"); - static const auto fps_unfocussed_color = LLUIColorTable::instance().getColor("Gray"); + static const auto fps_below_limit_color = LLUIColorTable::instance().getColor("FpsDisplayBelowLimitColor"); + static const auto fps_limit_reached_color = LLUIColorTable::instance().getColor("FpsDisplayFpsLimitReachedColor"); + static const auto vsync_limit_reached_color = LLUIColorTable::instance().getColor("FpsDisplayVSyncLimitReachedColor"); + static const auto fps_uncapped_color = LLUIColorTable::instance().getColor("FpsDisplayUncappedColor"); + static const auto fps_unfocussed_color = LLUIColorTable::instance().getColor("FpsDisplayUnfocussedColor"); static auto current_fps_color = fps_uncapped_color; mFPSUpdateTimer.reset(); const auto fps = LLTrace::get_frame_recording().getPeriodMedianPerSec(LLStatViewer::FPS); mFPSText->setText(llformat("%.1f", fps)); - // if background, go grey, else go white unless we have a cap (checked next) auto fps_color{ fps_uncapped_color }; - auto window = gViewerWindow ? gViewerWindow->getWindow() : nullptr; - if ((window && !window->getVisible()) || !gFocusMgr.getAppHasFocus()) + if (fsStatusBarShowFPSColors) { - fps_color = fps_unfocussed_color; - } - else - { - S32 vsync_freq{ -1 }; - if (window) + // if background, go grey, else go white unless we have a cap (checked next) + auto window = gViewerWindow ? gViewerWindow->getWindow() : nullptr; + if ((window && !window->getVisible()) || !gFocusMgr.getAppHasFocus()) { - vsync_freq = window->getRefreshRate(); + fps_color = fps_unfocussed_color; } + else + { + S32 vsync_freq{ -1 }; + if (window) + { + vsync_freq = window->getRefreshRate(); + } - if (limit_fps_enabled && max_fps > 0) - { - fps_color = (fps >= max_fps - 1) ? fps_limit_reached_color : fps_below_limit_color; - } - // use vsync if enabled and the freq is lower than the max_fps - if (vsync_enabled && vsync_freq > 0 && (!limit_fps_enabled || vsync_freq < (S32)max_fps)) - { - fps_color = (fps >= vsync_freq - 1) ? vsync_limit_reached_color : fps_below_limit_color; + if (limit_fps_enabled && max_fps > 0) + { + fps_color = (fps >= max_fps - 1) ? fps_limit_reached_color : fps_below_limit_color; + } + // use vsync if enabled and the freq is lower than the max_fps + if (vsync_enabled && vsync_freq > 0 && (!limit_fps_enabled || vsync_freq < (S32)max_fps)) + { + fps_color = (fps >= vsync_freq - 1) ? vsync_limit_reached_color : fps_below_limit_color; + } } } diff --git a/indra/newview/skins/ansastorm/colors.xml b/indra/newview/skins/ansastorm/colors.xml index 70634c08d7..bcaba9ba01 100644 --- a/indra/newview/skins/ansastorm/colors.xml +++ b/indra/newview/skins/ansastorm/colors.xml @@ -1410,4 +1410,19 @@ + + + + + diff --git a/indra/newview/skins/ansastorm/themes/classic_brown/colors.xml b/indra/newview/skins/ansastorm/themes/classic_brown/colors.xml index e35d792e45..8b269290fe 100644 --- a/indra/newview/skins/ansastorm/themes/classic_brown/colors.xml +++ b/indra/newview/skins/ansastorm/themes/classic_brown/colors.xml @@ -1403,4 +1403,19 @@ + + + + + diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index d7bbd28619..ac8aae67e8 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -1378,4 +1378,19 @@ + + + + + diff --git a/indra/newview/skins/default/xui/de/menu_hide_navbar.xml b/indra/newview/skins/default/xui/de/menu_hide_navbar.xml index f1a396ccc0..47d5ddd525 100644 --- a/indra/newview/skins/default/xui/de/menu_hide_navbar.xml +++ b/indra/newview/skins/default/xui/de/menu_hide_navbar.xml @@ -10,6 +10,7 @@ + diff --git a/indra/newview/skins/default/xui/de/panel_status_bar.xml b/indra/newview/skins/default/xui/de/panel_status_bar.xml index 8f57418564..c365729f9c 100644 --- a/indra/newview/skins/default/xui/de/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/de/panel_status_bar.xml @@ -33,7 +33,7 @@