Added ConnectionCable

This commit is contained in:
2026-06-15 22:54:03 +03:00
parent 95539bcf5d
commit 22c0912ea2
8 changed files with 83 additions and 2 deletions
+22
View File
@@ -0,0 +1,22 @@
shader_type canvas_item;
uniform float glow_interval : hint_range(0.0, 1.0, 0.00001) = 1.0;
uniform float glow_radius : hint_range(0.0, 1.0, 0.00001) = 1.0;
uniform float travel_time : hint_range(0.0, 100.0, 1) = 5.0;
float get_alpha(vec2 uv, float offset) {
float dist = fract(mod(TIME, travel_time)/travel_time + offset);
float left = uv.x - glow_radius;
float right = uv.x + glow_radius;
return step(left, dist) * (1.0 - step(right, dist));
}
void fragment() {
float alpha = 0.0;
float offset = 0.0;
for (float offset = 0.0; offset <= 1.0; offset += glow_interval) {
alpha += get_alpha(UV, offset);
}
COLOR.a = alpha;
}
@@ -0,0 +1 @@
uid://dbsrm43wcolg4