disable texture filtering experiment

This commit is contained in:
griffi-gh 2023-05-19 13:44:33 +02:00
parent b18756bb7e
commit af356565a3

View file

@ -9,26 +9,26 @@ flat in uint v_tex_index;
out vec4 color; out vec4 color;
uniform sampler2DArray tex; uniform sampler2DArray tex;
vec4 alpha_drop(vec4 b, vec4 a) { // vec4 alpha_drop(vec4 b, vec4 a) {
if ((a.w < 1.) || (b.w < 1.)) { // if ((a.w < 1.) || (b.w < 1.)) {
return vec4(b.xyz, 0.); // return vec4(b.xyz, 0.);
} // }
return a; // return a;
} // }
void main() { void main() {
// base color from texture // base color from texture
color = texture(tex, vec3(v_uv, v_tex_index)); color = texture(tex, vec3(v_uv, v_tex_index));
// HACKY texture "antialiasing" // HACKY texture "antialiasing"
color += ( // color += (
alpha_drop(color, texture(tex, vec3(v_uv + vec2(.000, .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, .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(.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(.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, .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(.001, .001), v_tex_index)))
) / 6.; // ) / 6.;
color /= 2.; // color /= 2.;
// discard fully transparent pixels // discard fully transparent pixels
if (color.w <= 0.0) { if (color.w <= 0.0) {
discard; discard;