2020-06-12 00:42:22 +07:00
|
|
|
#define HIGHP
|
|
|
|
|
2017-12-06 00:21:08 +07:00
|
|
|
#define ALPHA 0.18
|
2018-11-09 11:50:03 +07:00
|
|
|
#define step 2.0
|
2017-11-28 13:00:59 +07:00
|
|
|
|
2017-10-22 08:21:04 +07:00
|
|
|
uniform sampler2D u_texture;
|
|
|
|
uniform vec2 u_texsize;
|
2020-06-27 05:42:29 +07:00
|
|
|
uniform vec2 u_invsize;
|
2017-10-22 08:21:04 +07:00
|
|
|
uniform float u_time;
|
2017-12-27 05:58:20 +07:00
|
|
|
uniform float u_dp;
|
2017-10-22 08:21:04 +07:00
|
|
|
uniform vec2 u_offset;
|
|
|
|
|
2020-06-15 05:41:42 +07:00
|
|
|
varying vec2 v_texCoords;
|
2017-10-22 08:21:04 +07:00
|
|
|
|
2020-05-11 11:41:35 +07:00
|
|
|
void main(){
|
2020-06-15 05:41:42 +07:00
|
|
|
vec2 T = v_texCoords.xy;
|
2017-10-22 08:21:04 +07:00
|
|
|
vec2 coords = (T * u_texsize) + u_offset;
|
2018-09-08 10:24:55 +07:00
|
|
|
|
2018-11-26 08:43:45 +07:00
|
|
|
T += vec2(sin(coords.y / 3.0 + u_time / 20.0), sin(coords.x / 3.0 + u_time / 20.0)) / u_texsize;
|
2020-06-27 05:42:29 +07:00
|
|
|
|
2021-12-08 08:37:46 +07:00
|
|
|
vec4 color = texture2D(u_texture, T);
|
|
|
|
vec2 v = u_invsize;
|
|
|
|
|
2021-12-09 02:28:27 +07:00
|
|
|
vec4 maxed = max(max(max(texture2D(u_texture, T + vec2(0, step) * v), texture2D(u_texture, T + vec2(0, -step) * v)), texture2D(u_texture, T + vec2(step, 0) * v)), texture2D(u_texture, T + vec2(-step, 0) * v));
|
2021-12-08 08:37:46 +07:00
|
|
|
|
|
|
|
if(texture2D(u_texture, T).a < 0.9 && maxed.a > 0.9){
|
2021-12-09 02:28:27 +07:00
|
|
|
|
2021-12-08 08:37:46 +07:00
|
|
|
gl_FragColor = vec4(maxed.rgb, maxed.a * 100.0);
|
|
|
|
}else{
|
|
|
|
|
|
|
|
if(color.a > 0.0){
|
|
|
|
if(mod(coords.x / u_dp + coords.y / u_dp + sin(coords.x / u_dp / 5.0) * 3.0 + sin(coords.y / u_dp / 5.0) * 3.0 + u_time / 4.0, 10.0) < 2.0){
|
|
|
|
color *= 1.65;
|
|
|
|
}
|
|
|
|
|
|
|
|
color.a = ALPHA;
|
|
|
|
}
|
|
|
|
|
|
|
|
gl_FragColor = color;
|
|
|
|
}
|
2017-10-22 08:21:04 +07:00
|
|
|
}
|