From 2520ae66ce2da210eaeaeba44c467c97e0c3fdd0 Mon Sep 17 00:00:00 2001 From: skal Date: Sat, 31 Jan 2026 00:57:47 +0100 Subject: Chore: Remove trailing whitespaces across the codebase --- src/gpu/gpu.cc | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/gpu/gpu.cc b/src/gpu/gpu.cc index ec9922a..27c0772 100644 --- a/src/gpu/gpu.cc +++ b/src/gpu/gpu.cc @@ -286,7 +286,7 @@ struct Uniforms { fn vs_main(@builtin(vertex_index) vertex_index: u32) -> @builtin(position) vec4 { let PI = 3.14159265; let num_sides = 7.0; - + // Pulse scale based on audio peak let base_scale = 0.5; let pulse_scale = 0.3 * uniforms.audio_peak; @@ -298,14 +298,14 @@ fn vs_main(@builtin(vertex_index) vertex_index: u32) -> @builtin(position) vec4< if (sub_idx == 0u) { return vec4(0.0, 0.0, 0.0, 1.0); } - + // Apply rotation based on time let rotation = uniforms.time * 0.5; let i = tri_idx + f32(sub_idx - 1u); let angle = i * 2.0 * PI / num_sides + rotation; let x = scale * cos(angle) / uniforms.aspect_ratio; let y = scale * sin(angle); - + return vec4(x, y, 0.0, 1.0); } @@ -316,7 +316,7 @@ fn fs_main() -> @location(0) vec4 { let r = sin(h + 0.0) * 0.5 + 0.5; let g = sin(h + 2.0) * 0.9 + 0.3; let b = sin(h + 4.0) * 0.5 + 0.5; - + let boost = uniforms.audio_peak * 0.5; return vec4(r + boost, g + boost, b + boost, 0.5); // Alpha 0.5 for blending } @@ -347,26 +347,26 @@ fn main(@builtin(global_invocation_id) GlobalInvocationID : vec3) { } var p = particles[index]; - + // Update Position p.pos.x = p.pos.x + p.vel.x * 0.016; p.pos.y = p.pos.y + p.vel.y * 0.016; p.pos.z = p.pos.z + p.vel.z * 0.016; - + // Gravity / Audio attraction p.vel.y = p.vel.y - 0.01 * (1.0 + uniforms.audio_peak * 5.0); - + // Rotate p.rot.x = p.rot.x + p.rot.y * 0.016; - + // Reset if out of bounds if (p.pos.y < -1.5) { p.pos.y = 1.5; - p.pos.x = (f32(index % 100u) / 50.0) - 1.0 + (uniforms.audio_peak * 0.5); + p.pos.x = (f32(index % 100u) / 50.0) - 1.0 + (uniforms.audio_peak * 0.5); p.vel.y = 0.0; p.vel.x = (f32(index % 10u) - 5.0) * 0.1; } - + particles[index] = p; } )"; @@ -396,10 +396,10 @@ struct VertexOutput { @vertex fn vs_main(@builtin(vertex_index) vertex_index : u32, @builtin(instance_index) instance_index : u32) -> VertexOutput { let p = particles[instance_index]; - + // Simple quad expansion let size = 0.02 + p.pos.z * 0.01 + uniforms.audio_peak * 0.02; - + // Vertex ID 0..5 for 2 triangles (Quad) // 0 1 2, 2 1 3 (Strip-like order manually mapped) var offsets = array, 6>( @@ -410,18 +410,18 @@ fn vs_main(@builtin(vertex_index) vertex_index : u32, @builtin(instance_index) i vec2( 1.0, -1.0), vec2( 1.0, 1.0) ); - + let offset = offsets[vertex_index]; - + // Rotate let c = cos(p.rot.x); let s = sin(p.rot.x); let rot_x = offset.x * c - offset.y * s; let rot_y = offset.x * s + offset.y * c; - + let x = p.pos.x + rot_x * size / uniforms.aspect_ratio; let y = p.pos.y + rot_y * size; - + var output : VertexOutput; output.Position = vec4(x, y, 0.0, 1.0); output.Color = p.color * (0.5 + 0.5 * uniforms.audio_peak); -- cgit v1.2.3