2015-09-02 03:44:16 +03:00
|
|
|
#version 330
|
|
|
|
|
|
|
|
in vec2 fragTexCoord;
|
|
|
|
|
|
|
|
out vec4 fragColor;
|
|
|
|
|
|
|
|
uniform sampler2D texture0;
|
2016-01-13 19:13:28 +03:00
|
|
|
uniform vec4 fragTintColor;
|
2015-09-02 03:44:16 +03:00
|
|
|
|
|
|
|
// NOTE: Add here your custom variables
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
vec4 sum = vec4(0);
|
|
|
|
vec4 tc = vec4(0);
|
|
|
|
|
|
|
|
for (int i = -4; i < 4; i++)
|
|
|
|
{
|
|
|
|
for (int j = -3; j < 3; j++)
|
|
|
|
{
|
2016-01-16 14:53:48 +03:00
|
|
|
sum += texture(texture0, fragTexCoord + vec2(j, i)*0.004) * 0.25;
|
2015-09-02 03:44:16 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-01-16 14:53:48 +03:00
|
|
|
if (texture(texture0, fragTexCoord).r < 0.3)
|
2015-09-02 03:44:16 +03:00
|
|
|
{
|
2016-01-16 14:53:48 +03:00
|
|
|
tc = sum*sum*0.012 + texture(texture0, fragTexCoord);
|
2015-09-02 03:44:16 +03:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-01-16 14:53:48 +03:00
|
|
|
if (texture(texture0, fragTexCoord).r < 0.5)
|
2015-09-02 03:44:16 +03:00
|
|
|
{
|
2016-01-16 14:53:48 +03:00
|
|
|
tc = sum*sum*0.009 + texture(texture0, fragTexCoord);
|
2015-09-02 03:44:16 +03:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-01-16 14:53:48 +03:00
|
|
|
tc = sum*sum*0.0075 + texture(texture0, fragTexCoord);
|
2015-09-02 03:44:16 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fragColor = tc;
|
|
|
|
}
|