#version 430 core
/*
* Copyright 2023 Vienna University of Technology.
* Institute of Computer Graphics and Algorithms.
* This file is part of the GCG Lab Framework and must not be redistributed.
*/

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

in VertexData {
	vec4 color;
} vert;


void main() {	
	color = vert.color;

	// 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);
    }
}

