aboutsummaryrefslogtreecommitdiff
path: root/client/shaders/nodes_shader/opengl_fragment.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'client/shaders/nodes_shader/opengl_fragment.glsl')
-rw-r--r--client/shaders/nodes_shader/opengl_fragment.glsl8
1 files changed, 8 insertions, 0 deletions
diff --git a/client/shaders/nodes_shader/opengl_fragment.glsl b/client/shaders/nodes_shader/opengl_fragment.glsl
index 19e6c2d86..7213612bd 100644
--- a/client/shaders/nodes_shader/opengl_fragment.glsl
+++ b/client/shaders/nodes_shader/opengl_fragment.glsl
@@ -190,6 +190,14 @@ void main(void)
#endif
vec4 base = texture2D(baseTexture, uv).rgba;
+#ifdef USE_DISCARD
+ // If alpha is zero, we can just discard the pixel. This fixes transparency
+ // on GPUs like GC7000L, where GL_ALPHA_TEST is not implemented in mesa.
+ if (base.a == 0.0) {
+ discard;
+ }
+#endif
+
#ifdef ENABLE_BUMPMAPPING
if (use_normalmap) {
vec3 L = normalize(lightVec);