#version 450
layout(location = 0) in vec2 vUV;

layout(std140, binding = 0) uniform Globals {
    mat4 uVP;
    vec3 uOffset;
    float uLayer;
    float uAlpha;
};
layout(binding = 1) uniform sampler2DArray uAtlas;

layout(location = 0) out vec4 FragColor;

void main() {
    vec4 texel = texture(uAtlas, vec3(vUV, uLayer));
    if (texel.a < 0.04) discard;
    FragColor = vec4(texel.rgb * vec3(0.92, 1.06, 1.02), texel.a * uAlpha);
}
