#version 330 core

in vec2 TexCoord;
out vec4 color;
uniform float time_f;
uniform sampler2D textTexture;
uniform float alpha;
uniform vec2 iResolution;

void main(void) {
    // Apply the texture to the current pixel
    color = texture(textTexture, TexCoord);

    // Optimization: Use a pre-multiplied alpha blending formula
    // This reduces the number of texture samples and improves performance
    if (alpha < 0.5) {
        discard;
    } else {
        color = vec4(color.rgb * alpha, color.a);
    }
}
