2013-11-30 21:33:06 +00:00
|
|
|
uniform sampler2D tex;
|
|
|
|
uniform vec3 col;
|
2014-02-23 18:59:24 +01:00
|
|
|
|
2014-02-28 17:29:05 +01:00
|
|
|
#if __VERSION__ >= 130
|
2014-02-23 18:59:24 +01:00
|
|
|
in vec2 uv;
|
2014-01-19 19:31:00 +01:00
|
|
|
out vec4 FragColor;
|
2014-02-28 17:29:05 +01:00
|
|
|
#else
|
|
|
|
varying vec2 uv;
|
|
|
|
#define FragColor gl_FragColor
|
|
|
|
#endif
|
2013-11-30 21:33:06 +00:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
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
|
|
|
}
|