diff options
Diffstat (limited to 'src/gpu/gpu.cc')
| -rw-r--r-- | src/gpu/gpu.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gpu/gpu.cc b/src/gpu/gpu.cc index 43aef7c..1f2c7f8 100644 --- a/src/gpu/gpu.cc +++ b/src/gpu/gpu.cc @@ -129,10 +129,11 @@ fn vs_main(@builtin(vertex_index) vertex_index: u32) -> @builtin(position) vec4< @fragment fn fs_main() -> @location(0) vec4<f32> { - let hue = uniforms.audio_peak * 0.5; - let r = sin(hue + 0.0) * 0.5 + 0.5; - let g = sin(hue + 2.0) * 0.5 + 0.5; - let b = sin(hue + 4.0) * 0.5 + 0.5; + // More vibrant hue: shift through colors based on peak + let h = uniforms.audio_peak * 2.0; + let r = sin(h + 0.0) * 0.5 + 0.5; + let g = sin(h + 2.0) * 0.5 + 0.5; + let b = sin(h + 4.0) * 0.5 + 0.5; return vec4<f32>(r, g, b, 1.0); } )"; @@ -289,7 +290,10 @@ void gpu_draw(float audio_peak, float aspect_ratio) { color_attachment.resolveTarget = nullptr; color_attachment.loadOp = WGPULoadOp_Clear; color_attachment.storeOp = WGPUStoreOp_Store; - color_attachment.clearValue = {0.1, 0.2, 0.3, 1.0}; + + // Background flash based on peak + float flash = uniforms.audio_peak * 0.4f; + color_attachment.clearValue = {0.05 + flash, 0.1 + flash, 0.2 + flash, 1.0}; color_attachment.depthSlice = WGPU_DEPTH_SLICE_UNDEFINED; WGPURenderPassDescriptor render_pass_desc = {}; |
