From 0e5a7b965b9cd6f235ae926297ca5784e67b60e6 Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Mon, 25 Mar 2024 22:12:13 -0400
Subject: [PATCH] Import: 71091 sl 20703 pbr masked alpha gradient textures
 change with viewing angle

---
 indra/newview/llfetchedgltfmaterial.cpp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfetchedgltfmaterial.cpp b/indra/newview/llfetchedgltfmaterial.cpp
index 90ec08391d6..ca69a473999 100644
--- a/indra/newview/llfetchedgltfmaterial.cpp
+++ b/indra/newview/llfetchedgltfmaterial.cpp
@@ -78,7 +78,14 @@ void LLFetchedGLTFMaterial::bind(LLViewerTexture* media_tex)
         {
             // dividing the alpha cutoff by transparency here allows the shader to compare against
             // the alpha value of the texture without needing the transparency value
-            min_alpha = mAlphaCutoff/mBaseColor.mV[3];
+            if (mBaseColor.mV[3] > 0.f)
+            {
+                min_alpha = mAlphaCutoff / mBaseColor.mV[3];
+            }
+            else
+            {
+                min_alpha = 1024.f;
+            }
         }
         shader->uniform1f(LLShaderMgr::MINIMUM_ALPHA, min_alpha);
     }
-- 
GitLab