mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 09:35:34 +00:00
Teleport animation
This commit is contained in:
parent
2ce91362b7
commit
4a8ac7a495
8 changed files with 269 additions and 5 deletions
21
Shaders/Blink.gdshader
Normal file
21
Shaders/Blink.gdshader
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue