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
|
|
|
|
|
2016-01-16 14:53:48 +03:00
|
|
|
float hatchOffsetY = 5.0;
|
|
|
|
float lumThreshold01 = 0.9;
|
|
|
|
float lumThreshold02 = 0.7;
|
|
|
|
float lumThreshold03 = 0.5;
|
|
|
|
float lumThreshold04 = 0.3;
|
2015-09-02 03:44:16 +03:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
vec3 tc = vec3(1.0, 1.0, 1.0);
|
2016-01-16 14:53:48 +03:00
|
|
|
float lum = length(texture(texture0, fragTexCoord).rgb);
|
2015-09-02 03:44:16 +03:00
|
|
|
|
|
|
|
if (lum < lumThreshold01)
|
|
|
|
{
|
|
|
|
if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) tc = vec3(0.0, 0.0, 0.0);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (lum < lumThreshold02)
|
|
|
|
{
|
|
|
|
if (mod(gl_FragCoord .x - gl_FragCoord .y, 10.0) == 0.0) tc = vec3(0.0, 0.0, 0.0);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (lum < lumThreshold03)
|
|
|
|
{
|
|
|
|
if (mod(gl_FragCoord .x + gl_FragCoord .y - hatchOffsetY, 10.0) == 0.0) tc = vec3(0.0, 0.0, 0.0);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (lum < lumThreshold04)
|
|
|
|
{
|
|
|
|
if (mod(gl_FragCoord .x - gl_FragCoord .y - hatchOffsetY, 10.0) == 0.0) tc = vec3(0.0, 0.0, 0.0);
|
|
|
|
}
|
|
|
|
|
|
|
|
fragColor = vec4(tc, 1.0);
|
|
|
|
}
|