2013-11-30 21:33:06 +00:00
|
|
|
uniform sampler2D tex;
|
|
|
|
uniform vec3 col;
|
2014-02-23 18:59:24 +01:00
|
|
|
|
2014-01-19 19:31:00 +01:00
|
|
|
out vec4 FragColor;
|
2013-11-30 21:33:06 +00:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2015-02-24 22:29:31 +01:00
|
|
|
// Use quarter resolution
|
2017-12-25 14:00:10 +08:00
|
|
|
vec2 uv = 4. * gl_FragCoord.xy / u_screen;
|
2014-02-23 18:59:24 +01:00
|
|
|
vec4 res = texture(tex, uv);
|
2013-11-30 21:33:06 +00:00
|
|
|
|
|
|
|
// Keep the sun fully bright, but fade the sky
|
|
|
|
float mul = distance(res.xyz, col);
|
|
|
|
mul = step(mul, 0.02);
|
|
|
|
mul *= 0.97;
|
|
|
|
|
2014-02-23 20:16:03 +01:00
|
|
|
res = res * vec4(mul);
|
2013-11-30 21:33:06 +00:00
|
|
|
|
2014-01-19 19:31:00 +01:00
|
|
|
FragColor = res;
|
2013-11-30 21:33:06 +00:00
|
|
|
}
|