From 3fae474a1b50a4518a8924eacc0714c3f8f1170e Mon Sep 17 00:00:00 2001 From: MMT Date: Wed, 27 Jul 2022 13:37:58 +0430 Subject: [PATCH] enhance target painting --- target.fs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/target.fs b/target.fs index 34e7dbb..b102dc4 100755 --- a/target.fs +++ b/target.fs @@ -3,6 +3,9 @@ uniform sampler2D texture; varying vec2 vTexCoord; varying vec3 color; void main() -{ - gl_FragColor = vec4(color.x,color.y,color.z,texture2D(texture, vTexCoord).w); +{ + if(texture2D(texture, vTexCoord).w == 0) + discard; + + gl_FragColor = vec4(color.x,color.y,color.z,1); }