From b2e3159ce76b7aeafd3b083fa34b76d002a85a2b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 21 Feb 2025 19:17:33 +0200 Subject: viewer-private#398 Fix constant asset rerequests --- indra/newview/gltfscenemanager.cpp | 19 +++++++++++++------ indra/newview/llviewerobject.h | 1 + 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/gltfscenemanager.cpp b/indra/newview/gltfscenemanager.cpp index 7863d25696..c33d15228c 100644 --- a/indra/newview/gltfscenemanager.cpp +++ b/indra/newview/gltfscenemanager.cpp @@ -356,8 +356,9 @@ void GLTFSceneManager::addGLTFObject(LLViewerObject* obj, LLUUID gltf_id) llassert(obj->getVolume()->getParams().getSculptID() == gltf_id); llassert(obj->getVolume()->getParams().getSculptType() == LL_SCULPT_TYPE_GLTF); - if (obj->mGLTFAsset) - { // object already has a GLTF asset, don't reload it + if (obj->mGLTFAsset || obj->mIsGLTFAssetMissing ) + { + // object already has a GLTF asset or load failed, don't reload it // TODO: below assertion fails on dupliate requests for assets -- possibly need to touch up asset loading state machine // llassert(std::find(mObjects.begin(), mObjects.end(), obj) != mObjects.end()); @@ -398,16 +399,19 @@ void GLTFSceneManager::onGLTFBinLoadComplete(const LLUUID& id, LLAssetType::ETyp } else { - LL_WARNS("GLTF") << "Failed to prepare GLTF asset: " << id << LL_ENDL; + LL_WARNS("GLTF") << "Failed to prepare GLTF asset: " << id << ". Marking as missing." << LL_ENDL; + obj->mIsGLTFAssetMissing = true; obj->mGLTFAsset = nullptr; } } } + obj->unref(); // todo: use LLPointer } } else { - LL_WARNS("GLTF") << "Failed to load GLTF asset: " << id << LL_ENDL; + LL_WARNS("GLTF") << "Failed to load GLTF asset: " << id << ". Marking as missing." << LL_ENDL; + obj->mIsGLTFAssetMissing = true; obj->unref(); } }); @@ -446,7 +450,8 @@ void GLTFSceneManager::onGLTFLoadComplete(const LLUUID& id, LLAssetType::EType a } else { - LL_WARNS("GLTF") << "Buffer URI is not a valid UUID: " << buffer.mUri << LL_ENDL; + LL_WARNS("GLTF") << "Buffer URI is not a valid UUID: " << buffer.mUri << " for asset id: " << id << ". Marking as missing." << LL_ENDL; + obj->mIsGLTFAssetMissing = true; obj->unref(); return; } @@ -455,7 +460,8 @@ void GLTFSceneManager::onGLTFLoadComplete(const LLUUID& id, LLAssetType::EType a } else { - LL_WARNS("GLTF") << "Failed to load GLTF asset: " << id << LL_ENDL; + LL_WARNS("GLTF") << "Failed to load GLTF asset: " << id << ". Marking as missing." << LL_ENDL; + obj->mIsGLTFAssetMissing = true; obj->unref(); } } @@ -517,6 +523,7 @@ void GLTFSceneManager::update() if (mUploadingObject) { mUploadingObject->mGLTFAsset = nullptr; + mUploadingObject->mIsGLTFAssetMissing = false; mUploadingObject->setGLTFAsset(assetId); mUploadingObject->markForUpdate(); mUploadingObject = nullptr; diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 206840ebfb..119b07b1f5 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -758,6 +758,7 @@ public: // Associated GLTF Asset std::shared_ptr mGLTFAsset; + bool mIsGLTFAssetMissing = false; // Pipeline classes LLPointer mDrawable; -- cgit v1.2.3 From 3e2da8e584b082135ca7eeba624b0e362e111e6b Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Sat, 22 Feb 2025 14:17:43 -0500 Subject: Accidental double linearization, try roughness ^2 for water punctual light. --- indra/newview/app_settings/shaders/class3/environment/waterF.glsl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl index 35b2f8bd10..2c87937906 100644 --- a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl +++ b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl @@ -25,7 +25,7 @@ // class3/environment/waterF.glsl -#define WATER_MINIMAL 1 +#define WATER_MINIMAL_PLUS 1 out vec4 frag_color; @@ -255,7 +255,7 @@ void main() shadow = sampleDirectionalShadow(pos.xyz, norm.xyz, distort); #endif - vec3 sunlit_linear = srgb_to_linear(sunlit); + vec3 sunlit_linear = (sunlit); float fade = 1; #ifdef TRANSPARENT_WATER float depth = texture(depthMap, distort).r; @@ -315,7 +315,7 @@ void main() vec3 diffPunc = vec3(0); vec3 specPunc = vec3(0); - pbrPunctual(diffuseColor, specularColor, perceptualRoughness, metallic, normalize(wavef+up*max(dist, 32.0)/32.0*(1.0-vdu)), v, normalize(light_dir), nl, diffPunc, specPunc); + pbrPunctual(diffuseColor, specularColor, perceptualRoughness * perceptualRoughness, metallic, normalize(wavef+up*max(dist, 32.0)/32.0*(1.0-vdu)), v, normalize(light_dir), nl, diffPunc, specPunc); vec3 punctual = clamp(nl * (diffPunc + specPunc), vec3(0), vec3(10)) * sunlit_linear * shadow; radiance *= df2.y; -- cgit v1.2.3 From d2fd2f49e346fb0f7966de592350607301292d44 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Sun, 23 Feb 2025 12:20:11 -0500 Subject: Cleanup --- indra/newview/app_settings/shaders/class3/environment/waterF.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl index 2c87937906..41c0d95b0e 100644 --- a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl +++ b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl @@ -255,7 +255,7 @@ void main() shadow = sampleDirectionalShadow(pos.xyz, norm.xyz, distort); #endif - vec3 sunlit_linear = (sunlit); + vec3 sunlit_linear = sunlit; float fade = 1; #ifdef TRANSPARENT_WATER float depth = texture(depthMap, distort).r; -- cgit v1.2.3 From 892628c7f3e4f189cc2fec1c7d49b9d40ebc072c Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Sun, 23 Feb 2025 12:54:50 -0500 Subject: Quick fix for null pointer in LLDrawPoolWater --- indra/newview/app_settings/shaders/class3/environment/waterF.glsl | 4 ++-- indra/newview/lldrawpoolwater.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl index 41c0d95b0e..157b59953d 100644 --- a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl +++ b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl @@ -315,9 +315,9 @@ void main() vec3 diffPunc = vec3(0); vec3 specPunc = vec3(0); - pbrPunctual(diffuseColor, specularColor, perceptualRoughness * perceptualRoughness, metallic, normalize(wavef+up*max(dist, 32.0)/32.0*(1.0-vdu)), v, normalize(light_dir), nl, diffPunc, specPunc); + pbrPunctual(diffuseColor, specularColor, perceptualRoughness, metallic, normalize(wavef+up*max(dist, 32.0)/32.0*(1.0-vdu)), v, normalize(light_dir), nl, diffPunc, specPunc); - vec3 punctual = clamp(nl * (diffPunc + specPunc), vec3(0), vec3(10)) * sunlit_linear * shadow; + vec3 punctual = clamp(nl * (diffPunc + specPunc), vec3(0), vec3(10)) * sunlit_linear * shadow * atten; radiance *= df2.y; //radiance = toneMapNoExposure(radiance); vec3 color = vec3(0); diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index 32de0e5ee7..7d58511d41 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -213,7 +213,7 @@ void LLDrawPoolWater::renderPostDeferred(S32 pass) else if (tex_b && !tex_a) { shader->bindTexture(LLViewerShaderMgr::BUMP_MAP, tex_b); - tex_a->setFilteringOption(filter_mode); + tex_b->setFilteringOption(filter_mode); blend_factor = 0; // only one tex provided, no blending } else if (tex_b != tex_a) -- cgit v1.2.3 From 3dde346975526d7830886a112b654bd12adfd662 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Mon, 24 Feb 2025 17:19:41 -0500 Subject: Backout minimal+ change. --- indra/newview/app_settings/shaders/class3/environment/waterF.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl index 157b59953d..2121088405 100644 --- a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl +++ b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl @@ -25,7 +25,7 @@ // class3/environment/waterF.glsl -#define WATER_MINIMAL_PLUS 1 +#define WATER_MINIMAL 1 out vec4 frag_color; -- cgit v1.2.3 From ae7658de24e487719a8cbdaaa334ba1619ec6de8 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Tue, 25 Feb 2025 08:50:25 -0500 Subject: Mitigation for #3331 --- indra/newview/llheroprobemanager.cpp | 11 +++++++++++ indra/newview/llheroprobemanager.h | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llheroprobemanager.cpp b/indra/newview/llheroprobemanager.cpp index e754de2fd1..675a8dfe7d 100644 --- a/indra/newview/llheroprobemanager.cpp +++ b/indra/newview/llheroprobemanager.cpp @@ -80,6 +80,17 @@ void LLHeroProbeManager::update() return; } + // Part of a hacky workaround to fix #3331. + // 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; + } + LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY; llassert(!gCubeSnapshot); // assert a snapshot is not in progress if (LLAppViewer::instance()->logoutRequestSent()) diff --git a/indra/newview/llheroprobemanager.h b/indra/newview/llheroprobemanager.h index 58a94a3de8..2737ec5ddf 100644 --- a/indra/newview/llheroprobemanager.h +++ b/indra/newview/llheroprobemanager.h @@ -144,6 +144,7 @@ private: std::vector> mHeroVOList; LLPointer mNearestHero; - + // Part of a hacky workaround to fix #3331. + bool mInitialized = false; }; -- cgit v1.2.3