mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 06:45:33 +00:00
21 lines
No EOL
791 B
Text
21 lines
No EOL
791 B
Text
shader_type canvas_item;
|
|
|
|
uniform vec4 blink_color: source_color;
|
|
uniform float blink_intensity = 0.0;
|
|
uniform float teleport_progress = 0.0; // 0 = fully visible, 1 = fully gone
|
|
uniform float scanline_density = 50.0; // Controls the number of scanlines
|
|
|
|
void fragment() {
|
|
vec4 color = texture(TEXTURE, UV);
|
|
color = mix(color, blink_color, blink_intensity * color.a);
|
|
|
|
// Generate scanline effect based on teleport_progress
|
|
float scanline = mod(UV.y * scanline_density, 1.0); // Creates scanline pattern
|
|
float cutoff = smoothstep(0.0, 1.0, UV.y - teleport_progress); // Controls disappearance
|
|
|
|
// Mix scanline effect with cutoff to make it gradually disappear
|
|
float alpha_multiplier = step(scanline, cutoff);
|
|
color.a *= alpha_multiplier;
|
|
|
|
COLOR = color;
|
|
} |