From 2b4c484dcb1031f9f196805def71887b92ab097f Mon Sep 17 00:00:00 2001 From: whitequark Date: Sat, 28 Jul 2018 12:33:32 +0000 Subject: [PATCH] Discard fragments with zero texture alpha in imesh_tex.frag. This makes image requests that have an image with a hole in it actually transparent, since otherwise the depth test would prevent any geometry behind the request from being drawn. --- res/shaders/imesh_tex.frag | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/res/shaders/imesh_tex.frag b/res/shaders/imesh_tex.frag index 79adcec..a6514f0 100644 --- a/res/shaders/imesh_tex.frag +++ b/res/shaders/imesh_tex.frag @@ -9,5 +9,7 @@ uniform sampler2D texture; varying vec2 fragTex; void main() { - gl_FragColor = texture2D(texture, fragTex) * color; + vec4 texColor = texture2D(texture, fragTex); + if(texColor.a == 0.0) discard; + gl_FragColor = texColor * color; }