Hyperspace Jump
Fast-moving radial streaks creating a classic sci-fi hyperspace effect.
60 FPS • WebGPU
WGSL Shader Source
struct Uniforms { resolution: vec2f, time: f32, padding: f32, mouse: vec2f, speed: f32, }
@group(0) @binding(0) var<uniform> u: Uniforms;
@vertex fn vs_main(@builtin(vertex_index) vi: u32) -> @builtin(position) vec4f {
let pos = array(vec2f(-1.0,-1.0), vec2f(3.0,-1.0), vec2f(-1.0,3.0)); return vec4f(pos[vi], 0.0, 1.0);
}
@fragment fn fs_main(@builtin(position) fc: vec4f) -> @location(0) vec4f {
let uv = (fc.xy - 0.5*u.resolution) / u.resolution.y + (u.mouse-0.5)*0.2;
let r = length(uv);
let a = atan2(uv.y, uv.x);
let t = u.time * u.speed;
let streak = sin(a * 20.0 + sin(a*5.0)) * sin(a * 43.0);
let z = fract(1.0/r + t + streak);
let col = vec3f(0.5, 0.8, 1.0) * smoothstep(0.9, 1.0, z) * r;
return vec4f(col, 1.0);
} Properties
#webgpu#hyperspace#sci-fi
Author: Math Art Core Target: 60 FPS