10 lines
510 B
Plaintext
10 lines
510 B
Plaintext
shader_type canvas_item;
|
|
uniform float elapsed = 0.0;
|
|
void fragment() {
|
|
vec4 tex = texture(TEXTURE, UV);
|
|
float edge = abs(tex.a - texture(TEXTURE, UV + vec2(TEXTURE_PIXEL_SIZE.x * 2.0, 0.0)).a);
|
|
edge += abs(tex.a - texture(TEXTURE, UV + vec2(0.0, TEXTURE_PIXEL_SIZE.y * 2.0)).a);
|
|
float scan = pow(0.5 + 0.5 * sin(UV.y * 140.0 - elapsed * 4.0), 14.0);
|
|
COLOR = vec4(mix(tex.rgb * vec3(0.3, 0.65, 0.9), vec3(0.4, 0.95, 1.0), clamp(edge + scan * 0.5, 0.0, 1.0)), tex.a * (0.10 + edge * 0.25 + scan * 0.1));
|
|
}
|