2013-11-30 16:33:06 -05:00
|
|
|
uniform sampler2D tex;
|
|
|
|
uniform vec3 col;
|
2014-02-23 12:59:24 -05:00
|
|
|
|
|
|
|
in vec2 uv;
|
2014-01-19 13:31:00 -05:00
|
|
|
out vec4 FragColor;
|
2013-11-30 16:33:06 -05:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2014-02-23 12:59:24 -05:00
|
|
|
vec4 res = texture(tex, uv);
|
2013-11-30 16:33:06 -05: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 14:16:03 -05:00
|
|
|
res = res * vec4(mul);
|
2013-11-30 16:33:06 -05:00
|
|
|
|
2014-01-19 13:31:00 -05:00
|
|
|
FragColor = res;
|
2013-11-30 16:33:06 -05:00
|
|
|
}
|