GRK_Room/cw 9/shaders/shader_skybox.frag

21 lines
523 B
GLSL
Raw Normal View History

2023-01-14 16:54:20 +01:00
#version 430 core
uniform samplerCube skybox;
2023-02-07 20:29:53 +01:00
uniform float exposition;
2023-01-14 16:54:20 +01:00
in vec3 texCoord;
2023-02-07 20:29:53 +01:00
out vec4 outColor;
2023-02-06 17:29:54 +01:00
layout (location = 0) out vec4 FragColor;
layout (location = 1) out vec4 BloomColor;
2023-01-14 16:54:20 +01:00
void main()
{
2023-02-07 20:29:53 +01:00
outColor = vec4(vec3(1.0) - exp(-texture(skybox,texCoord).rgb*exposition),1);
FragColor = outColor;
2023-02-06 17:29:54 +01:00
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);
2023-01-14 16:54:20 +01:00
}