From b52fe3bf347154a37dc91edc0e9f1902f77a724b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fernando=20Garc=C3=ADa=20Li=C3=B1=C3=A1n?=
 <fernandogarcialinan@gmail.com>
Date: Thu, 19 Aug 2021 20:19:55 +0200
Subject: [PATCH] HDR: Remove glass.eff minimum alpha hack

---
 Effects/glass.eff                     | 5 -----
 Shaders/HDR/geometry-transparent.frag | 4 +---
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/Effects/glass.eff b/Effects/glass.eff
index 46ab33021..8e58a8a39 100644
--- a/Effects/glass.eff
+++ b/Effects/glass.eff
@@ -582,11 +582,6 @@
           <type>float-vec4</type>
           <value><use>material/diffuse</use></value>
         </uniform>
-        <uniform>
-          <name>minimum_alpha</name>
-          <type>float</type>
-          <value>0.1</value>
-        </uniform>
         <!-- Lighting include -->
         <uniform>
           <name>dfg_lut</name>
diff --git a/Shaders/HDR/geometry-transparent.frag b/Shaders/HDR/geometry-transparent.frag
index 5523b5b45..556d35263 100644
--- a/Shaders/HDR/geometry-transparent.frag
+++ b/Shaders/HDR/geometry-transparent.frag
@@ -8,7 +8,6 @@ in vec4 materialColor;
 in vec3 ecPos;
 
 uniform sampler2D color_tex;
-uniform float minimum_alpha = 0.0;
 
 uniform mat4 osg_ViewMatrixInverse;
 uniform vec4 fg_Viewport;
@@ -49,8 +48,7 @@ void main()
 {
     vec4 baseColorTexel = texture(color_tex, texCoord);
     vec3 baseColor = decodeSRGB(baseColorTexel.rgb) * materialColor.rgb;
-    // HACK: Force a minimum value to stay compatible with glass.eff
-    float alpha = max(materialColor.a * baseColorTexel.a, minimum_alpha);
+    float alpha = materialColor.a * baseColorTexel.a;
 
     vec3 n = normalize(normalVS);
     vec3 v = normalize(-ecPos);