Grafika2023/PlanetCreator/cw 6/shaders/shader_sky.frag

19 lines
540 B
GLSL
Raw Permalink Normal View History

2024-02-08 10:10:49 +01:00
#version 430 core
layout (location = 0) out vec4 out_color;
layout (location = 1) out vec4 BrightColor;
uniform samplerCube skybox;
in vec3 texCoord;
//out vec4 out_color;
void main()
{
vec4 finalColor =texture(skybox,texCoord);
float brightness = dot(vec3(finalColor.x,finalColor.y, finalColor.z ), vec3(0.2126, 0.7152, 0.0722));
if(brightness > 1.0)
BrightColor = vec4(vec3(finalColor.x,finalColor.y, finalColor.z ), 1.0);
else
BrightColor = vec4(0.0, 0.0, 0.0, 1.0);
out_color = texture(skybox,texCoord);
}