GRK_Room/cw 9/shaders/shader_8_sun.frag

21 lines
531 B
GLSL
Raw Normal View History

2023-01-14 12:00:59 +01:00
#version 430 core
2023-01-30 12:10:43 +01:00
layout (location = 0) out vec4 FragColor;
layout (location = 1) out vec4 BloomColor;
2023-01-14 12:00:59 +01:00
uniform vec3 color;
uniform float exposition;
out vec4 outColor;
void main()
{
2023-02-06 17:29:54 +01:00
outColor = vec4(vec3(1.0) - exp(-color*exposition),1);
//outColor = vec4(color, 1.0);
float brightness = dot(FragColor.rgb, vec3(0.2126, 0.7152, 0.0722));
if(brightness > 1.0)
BloomColor = vec4(FragColor.rgb, 1.0);
else
BloomColor = vec4(0.0, 0.0, 0.0, 1.0);
BloomColor = vec4(color, 1.0);
2023-01-14 12:00:59 +01:00
}