shader_type canvas_item; // Anime-style radial speed lines. Fullscreen ColorRect overlay; `intensity` // (0..1) is driven by the player controller from horizontal speed + dash. // Lines live at the screen edges and jitter inward, center stays clear. uniform float intensity : hint_range(0.0, 1.0) = 0.0; uniform vec4 line_color : source_color = vec4(1.0, 1.0, 1.0, 1.0); float hash(float n) { return fract(sin(n * 4310.17) * 43758.5453); } void fragment() { vec2 uv = UV - vec2(0.5); uv.x *= 1.6; // widescreen: keep the clear zone round-ish float dist = length(uv); float ang = atan(uv.y, uv.x); // Quantize the circle into spokes; each spoke gets a stable random phase. float spokes = 90.0; float id = floor((ang / 6.2831853 + 0.5) * spokes); float rnd = hash(id); // Only some spokes draw, and they flicker over time. float alive = step(0.55, fract(rnd + floor(TIME * 9.0) * 0.13)); // Thin line across the spoke's angular width. float local = fract((ang / 6.2831853 + 0.5) * spokes); float line = smoothstep(0.5, 0.05, abs(local - 0.5)) ; // Radial extent: start further out for weak intensity, reach inward as it grows. float start = mix(0.62, 0.34, intensity) + rnd * 0.12; float mask = smoothstep(start, start + 0.25, dist); float a = intensity * alive * line * mask; COLOR = vec4(line_color.rgb, a * line_color.a * 0.55); }