From 73940d61ff3e5b3fe8cf9fd3aaa087f28ed7a25b Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Fri, 19 May 2023 13:44:33 +0200 Subject: [PATCH] disable texture filtering experiment --- kubi/shaders/world.frag | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/kubi/shaders/world.frag b/kubi/shaders/world.frag index edc8178..ba9f184 100644 --- a/kubi/shaders/world.frag +++ b/kubi/shaders/world.frag @@ -9,26 +9,26 @@ flat in uint v_tex_index; out vec4 color; uniform sampler2DArray tex; -vec4 alpha_drop(vec4 b, vec4 a) { - if ((a.w < 1.) || (b.w < 1.)) { - return vec4(b.xyz, 0.); - } - return a; -} +// vec4 alpha_drop(vec4 b, vec4 a) { +// if ((a.w < 1.) || (b.w < 1.)) { +// return vec4(b.xyz, 0.); +// } +// return a; +// } void main() { // base color from texture color = texture(tex, vec3(v_uv, v_tex_index)); // HACKY texture "antialiasing" - color += ( - alpha_drop(color, texture(tex, vec3(v_uv + vec2(.000, .001), v_tex_index))) + - alpha_drop(color, texture(tex, vec3(v_uv + vec2(.001, .000), v_tex_index))) + - alpha_drop(color, texture(tex, vec3(v_uv + vec2(.001, .001), v_tex_index))) + - alpha_drop(color, texture(tex, vec3(v_uv - vec2(.000, .001), v_tex_index))) + - alpha_drop(color, texture(tex, vec3(v_uv - vec2(.001, .000), v_tex_index))) + - alpha_drop(color, texture(tex, vec3(v_uv - vec2(.001, .001), v_tex_index))) - ) / 6.; - color /= 2.; + // color += ( + // alpha_drop(color, texture(tex, vec3(v_uv + vec2(.000, .001), v_tex_index))) + + // alpha_drop(color, texture(tex, vec3(v_uv + vec2(.001, .000), v_tex_index))) + + // alpha_drop(color, texture(tex, vec3(v_uv + vec2(.001, .001), v_tex_index))) + + // alpha_drop(color, texture(tex, vec3(v_uv - vec2(.000, .001), v_tex_index))) + + // alpha_drop(color, texture(tex, vec3(v_uv - vec2(.001, .000), v_tex_index))) + + // alpha_drop(color, texture(tex, vec3(v_uv - vec2(.001, .001), v_tex_index))) + // ) / 6.; + // color /= 2.; // discard fully transparent pixels if (color.w <= 0.0) { discard;