#version 410 core
in vec2 vUV;
uniform sampler2DArray uAtlas;
uniform float uLayer;
uniform float uShade;
uniform vec4 uTint;     // RGB multiply + alpha (white = unchanged)
out vec4 FragColor;
void main() {
    vec4 t = texture(uAtlas, vec3(vUV, uLayer));
    if (t.a < 0.02) discard;
    FragColor = vec4(t.rgb * uShade * uTint.rgb, t.a * uTint.a);
}
