stk-code_catmod/data/shaders/godfade.frag

21 lines
346 B
GLSL
Raw Normal View History

uniform sampler2D tex;
uniform vec3 col;
out vec4 FragColor;
void main()
{
2015-02-24 16:29:31 -05:00
// Use quarter resolution
vec2 uv = 4. * gl_FragCoord.xy / screen;
vec4 res = texture(tex, uv);
// Keep the sun fully bright, but fade the sky
float mul = distance(res.xyz, col);
mul = step(mul, 0.02);
mul *= 0.97;
res = res * vec4(mul);
FragColor = res;
}