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.
pull/348/head
whitequark 2018-07-28 12:33:32 +00:00
parent a4644cc58d
commit 2b4c484dcb
1 changed files with 3 additions and 1 deletions

View File

@ -9,5 +9,7 @@ uniform sampler2D texture;
varying vec2 fragTex; varying vec2 fragTex;
void main() { void main() {
gl_FragColor = texture2D(texture, fragTex) * color; vec4 texColor = texture2D(texture, fragTex);
if(texColor.a == 0.0) discard;
gl_FragColor = texColor * color;
} }