From 2d655ea8f184dc08603e36cda85ea51367681a45 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Wed, 22 Nov 2023 22:02:30 +0100 Subject: [PATCH] discard alpha, use treshold --- kubi/shaders/world.frag | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kubi/shaders/world.frag b/kubi/shaders/world.frag index 59ae56b..54eb595 100644 --- a/kubi/shaders/world.frag +++ b/kubi/shaders/world.frag @@ -19,9 +19,11 @@ uniform sampler2DArray tex; void main() { // base color from texture color = texture(tex, vec3(v_uv, v_tex_index)); - // discard fully transparent pixels - if (color.w <= 0.0) discard; + // discard transparent pixels + if (color.w < 0.5) discard; //basic "lighting" float light = abs(v_normal.x) + .8 * abs(v_normal.y) + .6 * abs(v_normal.z); color *= vec4(vec3(light), 1.); + //discard alpha + color.w = 0.; }