Tunnel Speed Lines for Godot 4.5
This is a 3D Particles Shader updated (2. Jan. 2026) for Godot 4.5, to draw Tunnel Speed Lines.
Tunnel dimensions are set by Tunnel Radius and Tunnel Length.
Velocity is set by Lifetime ( = Preprocess ).
Draw Pass 1 draws Quad-stripes with editable size x=3.0, y=0.4.
Draw Pass 1 Material has a Shader Param Texture Albedo, to use your own texture with alpha channel.
Shader code
// particles shader for Godot 4.5, updated on 2. Jan. 2026
shader_type particles;
uniform float tube_radius : hint_range( 0.0, 10.0 ) = 2.0;
uniform float tube_length : hint_range( 0.0, 100.0 ) = 50.0;
float rand_from_seed(in uint seed) {
int k;
int s = int(seed);
if (s == 0)
s = 305420679;
k = s / 127773;
s = 16807 * (s - k * 127773) - 2836 * k;
if (s < 0)
s += 2147483647;
seed = uint(s);
return float(seed % uint(65536)) / 65535.0;
}
uint hash(uint x) {
x = ((x >> uint(16)) ^ x) * uint(73244475);
x = ((x >> uint(16)) ^ x) * uint(73244475);
x = (x >> uint(16)) ^ x;
return x;
}
void start(){
uint alt_seed1 = hash(NUMBER + uint(1) + RANDOM_SEED);
// set particle position in model space with tube_radius and tube_length
float angle_rand = rand_from_seed( alt_seed1 ) * 6.283185;
TRANSFORM[3].x = tube_length;
TRANSFORM[3].y = sin( angle_rand ) * tube_radius;
TRANSFORM[3].z = cos( angle_rand ) * tube_radius;
// calculate VELOCITY in negative x direction
VELOCITY.x = -tube_length / LIFETIME;
// calculate 2D normal and send it to "Pass 1" shader with CUSTOM variable
angle_rand -= 1.570796;
CUSTOM.yz = vec2( sin( angle_rand ), cos( angle_rand ) );
}


This coulde be used in a sprite node or how?
Particles shader are 3D. You could draw this to a 2D viewport, explained here: https://docs.godotengine.org/en/stable/tutorials/rendering/viewports.html
I have created today an update for Godot 4
Hi. Did you still have the 3.x version?
No 3.x version?
Doesn’t work in 4.1 version
sorry, it took me over 3 years to update this, now it works again with Godot 4.5