mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-11-21 22:38:41 -06:00
disable texture filtering experiment
This commit is contained in:
parent
4bf2b350c6
commit
73940d61ff
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue