some meshgen and map rendering updates
[voxelands-alt.git] / data / shaders / ui_fragment.glsl
bloba4519c196a12701eb9436508f1d0b5724a8ffd68
1 #version 330 core
3 in vec2 uv;
5 out vec4 out_Colour;
7 uniform sampler2D texture0;
8 uniform float alphafunc;
10 void main(void) {
12         out_Colour = texture(texture0,uv);
13         if (alphafunc > 1.5) {
14                 float a0 = out_Colour.a;
15                 float a1 = texture(texture0,uv+vec2(-0.001,-0.001)).a;
16                 float a2 = texture(texture0,uv+vec2(-0.001,0.0)).a;
17                 float a3 = texture(texture0,uv+vec2(-0.001,0.001)).a;
18                 float a4 = texture(texture0,uv+vec2(0.0,-0.001)).a;
19                 float a5 = texture(texture0,uv+vec2(0.0,0.001)).a;
20                 float a6 = texture(texture0,uv+vec2(0.001,-0.001)).a;
21                 float a7 = texture(texture0,uv+vec2(0.001,0.0)).a;
22                 float a8 = texture(texture0,uv+vec2(0.001,0.001)).a;
23                 out_Colour.a = smoothstep(0.45,0.55,(a0+a1+a2+a3+a4+a5+a6+a7+a8)/9.0);
24         }else if (alphafunc > 0.5) {
25                 out_Colour.a = smoothstep(0.45,0.55,out_Colour.a);
26         }