PlanetEditor/grk/cw 6/shaders/shader_skybox.frag
Natalia Nowakowska d94b5cd398 merge bloom
2024-02-07 20:16:03 +01:00

26 lines
569 B
GLSL

#version 430 core
layout (location = 0) out vec4 outColor;
layout (location = 1) out vec4 BrightColor;
uniform samplerCube skybox;
uniform vec3 lightColor;
in vec3 texCoord;
//out vec4 out_color;
void main()
{
vec4 textureColor = texture(skybox, texCoord);
vec3 finalColor = vec3(textureColor) * lightColor * 0.35f;
float brightness = dot(finalColor, vec3(0.2126, 0.7152, 0.0722));
if(brightness > 0.2)
BrightColor = vec4(finalColor, 1.0);
else
BrightColor = vec4(0.0, 0.0, 0.0, 1.0);
outColor = vec4(finalColor, 1.0);
}