struct VertexOutput { @builtin(position) position: vec4, @location(0) coord: vec2, }; struct Uniforms { mouse: vec2, time: f32, }; @group(0) @binding(0) var uniforms: Uniforms; @fragment fn fs_main(in: VertexOutput) -> @location(0) vec4 { let normalized = (in.coord + vec2(1., 1.)) / 2.; let angle = sin(uniforms.time); let cc = sin(uniforms.time / 1.4 + 0.3); let r = sin(uniforms.time / 4.4) / 2. + 0.5; let rot: mat2x2 = mat2x2( vec2(cos(angle), -sin(angle)), vec2(sin(angle), cos(angle)) ); let tc: vec2 = rot * in.coord; let c = sin(tc.x * 12. * cc) / 2. + 0.5; let d = sin(tc.y * 12.) / 2. + 0.5; return vec4(r, c, d, 1.0); }