21 lines
523 B
GLSL
21 lines
523 B
GLSL
#version 430 core
|
|
|
|
uniform samplerCube skybox;
|
|
uniform float exposition;
|
|
in vec3 texCoord;
|
|
out vec4 outColor;
|
|
layout (location = 0) out vec4 FragColor;
|
|
layout (location = 1) out vec4 BloomColor;
|
|
|
|
|
|
void main()
|
|
{
|
|
outColor = vec4(vec3(1.0) - exp(-texture(skybox,texCoord).rgb*exposition),1);
|
|
|
|
FragColor = outColor;
|
|
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);
|
|
} |