From 520ebb392bd06701fb6f6472cccebfaa8f13a03c Mon Sep 17 00:00:00 2001
From: Beq <beqjanus@gmail.com>
Date: Sat, 5 Nov 2022 22:37:14 +0000
Subject: [PATCH] [BUG-232834][BUG-232871] Alpha mask is being applied with
 emissive mask

This is the most local fix for this issue, addressing the specific unqualified use of HAS_ALPHA_MASK.
If we find other issues with alpha mask being applied incorrectly then, it may be better to fix higher up in llvieweshadermgr.cpp by reverting the changes from SL-17532.
For now, this way works for this specific bug without non-emissive side-effects.
---
 .../newview/app_settings/shaders/class1/deferred/materialF.glsl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
index b26194f2788..1280bc20a80 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
@@ -227,7 +227,7 @@ void main()
     vec4 diffcol = texture2D(diffuseMap, vary_texcoord0.xy);
 	diffcol.rgb *= vertex_color.rgb;
 
-#ifdef HAS_ALPHA_MASK
+#if HAS_ALPHA_MASK && (DIFFUSE_ALPHA_MODE != DIFFUSE_ALPHA_MODE_EMISSIVE)
 #if DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND
     if (diffcol.a*vertex_color.a < minimum_alpha)
 #else
-- 
GitLab