#version 330 core


layout (location = 0) out vec4 color;
layout (location = 1) out vec4 BrightColor;

uniform vec4 colorStart;
uniform vec4 colorEnd;

in float modifier;

void main()
{
    color = colorStart * (1.0 - modifier) + (colorEnd * modifier);

    // bloom
    float brightness = dot(color.rgb, vec3(0.2126f, 0.7152f, 0.0722f));
    if(brightness > 0.5){
        BrightColor = vec4(color.rgb  * brightness * brightness, 1.0f);
    } else{
        BrightColor = vec4(0.0f, 0.0f, 0.0f, 1.0f);
    }
}