GLSL shader example

Warp-Speed Star Trails

Angle fixes trail direction while reciprocal radius and time create radial motion. Trails stretch toward the perimeter.

Live example

Edit the code and the preview updates as you type.

What to observe

Warp-Speed Star Trails.

Mechanism

Angle fixes trail direction while reciprocal radius and time create radial motion. Trails stretch toward the perimeter.

The controlling code

float a=atan(p.y,p.x),r=max(length(p),.01);float sector=floor(a*130.),phase=fract(1./r*.5+u_time*(.5+u_parameter*3.)+hash(vec2(sector)));float line=pow(.5+.5*cos(a*130.),24.)*pow(phase,15.);c+=vec3(.5,.7,1.)*line*smoothstep(.08,.3,r);

Experiment

Set u_parameter to 0 and then 1, changing phase speed .5+u_parameter*3. from 0.5 to 3.5. Radial streaks move faster while their angular sectors stay fixed.

Debugging and cost

The reciprocal radius is bounded by max(length(p),.01) and the central fade uses smoothstep(.08,.3,r). Increase .08 to .2 to clear a larger center; these streaks are computed per pixel without particle buffers.

Built-in functions used

Learn it step by step