2022-04-05 17:10:08 +00:00
|
|
|
#version 330 core
|
|
|
|
|
|
|
|
in vec2 uvCoordinates;
|
2022-04-11 23:08:57 +00:00
|
|
|
flat in int atlasPage;
|
2022-04-05 17:10:08 +00:00
|
|
|
|
2022-04-11 23:08:57 +00:00
|
|
|
uniform sampler2DArray textureSampler;
|
2022-04-05 17:10:08 +00:00
|
|
|
uniform vec4 recolor;
|
|
|
|
|
|
|
|
out vec4 out_Color;
|
|
|
|
|
|
|
|
void main(void)
|
|
|
|
{
|
2022-04-11 23:08:57 +00:00
|
|
|
vec3 textCoords = vec3(uvCoordinates, atlasPage);
|
2022-04-05 17:10:08 +00:00
|
|
|
|
2022-04-11 23:08:57 +00:00
|
|
|
float threshold = 1 - 240.0 / 255.0;
|
|
|
|
|
|
|
|
float signedDist = 1 - texture(textureSampler, textCoords).r;
|
|
|
|
|
|
|
|
float fw = fwidth(signedDist);
|
|
|
|
|
|
|
|
vec4 col = recolor;
|
|
|
|
|
|
|
|
col.a *= smoothstep(threshold + 0.2, threshold, signedDist);
|
|
|
|
|
|
|
|
out_Color = col;
|
2022-04-05 17:10:08 +00:00
|
|
|
}
|