PlanetEditor/grk/cw 6/shaders/shader_skybox.frag

26 lines
569 B
GLSL
Raw Permalink Normal View History

2024-01-21 13:34:33 +01:00
#version 430 core
2024-02-07 20:16:03 +01:00
layout (location = 0) out vec4 outColor;
layout (location = 1) out vec4 BrightColor;
2024-01-21 13:34:33 +01:00
uniform samplerCube skybox;
uniform vec3 lightColor;
in vec3 texCoord;
2024-02-07 20:16:03 +01:00
//out vec4 out_color;
2024-01-21 13:34:33 +01:00
void main()
{
vec4 textureColor = texture(skybox, texCoord);
2024-02-07 20:16:03 +01:00
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);
2024-01-21 13:34:33 +01:00
}