#version 450 core

#pragma include ./shared.glsl
#pragma include ../misc/glow.glsl
#pragma include ../misc/global.glsl

const GlowArgs GLOW_ARGS = {
    /* step0      */ 0.480,
    /* step1      */ 0.975,
    /* pulseSize0 */ 0.010,
    /* pulseSize1 */ 0.050,
    /* pulseTime  */ 2.000,
};

in FragmentData fragmentData;

uniform vec4 uGlowColor;
uniform sampler2D uTexture;

out vec4 outColor;

void main() {
    float alpha = glow(GLOW_ARGS, fragmentData.texCoords - vec2(0.5), uGlobal.time);
    vec4 glow = vec4(uGlowColor.rgb, uGlowColor.a * alpha);
    vec4 tex = texture(uTexture, fragmentData.texCoords);

    outColor = tex * tex.a + glow * (1.0 - tex.a);
}
