diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-14 17:48:59 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-14 17:48:59 +0100 |
| commit | b4c901700de0d9e867b9fd0c0c6a6586578f8480 (patch) | |
| tree | fa75851852713717e78df59efa4f19aa25d4c9fc /workspaces/main | |
| parent | 0127c747a41f972fd68e3e6e6b472859bfdb80dd (diff) | |
some tweaking
Diffstat (limited to 'workspaces/main')
| -rw-r--r-- | workspaces/main/pop_punk_drums.track | 12 | ||||
| -rw-r--r-- | workspaces/main/shaders/chroma_aberration.wgsl | 12 | ||||
| -rw-r--r-- | workspaces/main/shaders/gaussian_blur.wgsl | 16 |
3 files changed, 25 insertions, 15 deletions
diff --git a/workspaces/main/pop_punk_drums.track b/workspaces/main/pop_punk_drums.track index 6f8e653..f54bf9d 100644 --- a/workspaces/main/pop_punk_drums.track +++ b/workspaces/main/pop_punk_drums.track @@ -98,9 +98,19 @@ PATTERN break LENGTH 1.0 0.6250, ASSET_KICK_1, 0.9, 0.0 0.7500, ASSET_KICK_1, 0.9, 0.0 -# Score: 4-bar sequence +# Score SCORE 0.0, main_groove_crash # Bar 1: with crash 1.0, main_groove # Bar 2 2.0, main_groove # Bar 3 3.0, break # Bar 4: transition + + 4.0, main_groove_crash # Bar 1: with crash + 5.0, main_groove # Bar 2 + 6.0, main_groove # Bar 3 + 7.0, break # Bar 4: transition + + 8.0, main_groove_crash # Bar 1: with crash + 9.0, main_groove # Bar 2 + 10.0, main_groove # Bar 3 + 11.0, break # Bar 4: transition diff --git a/workspaces/main/shaders/chroma_aberration.wgsl b/workspaces/main/shaders/chroma_aberration.wgsl index ee730b1..d5e50ea 100644 --- a/workspaces/main/shaders/chroma_aberration.wgsl +++ b/workspaces/main/shaders/chroma_aberration.wgsl @@ -15,14 +15,10 @@ struct ChromaAberrationParams { @fragment fn fs_main(@builtin(position) p: vec4<f32>) -> @location(0) vec4<f32> { let uv = p.xy / uniforms.resolution; - // Compute offset magnitude and direction - let offset_mag = params.offset_scale * uniforms.audio_intensity; - let offset_dir = vec2<f32>(cos(params.angle), sin(params.angle)); - let offset = offset_mag * offset_dir; - - // Sample RGB channels with chromatic aberration + let amp = params.offset_scale * uniforms.audio_intensity; + let offset = amp * vec2<f32>(cos(params.angle), sin(params.angle)); + let center = textureSample(txt, smplr, uv); let r = textureSample(txt, smplr, uv + offset).r; - let g = textureSample(txt, smplr, uv).g; let b = textureSample(txt, smplr, uv - offset).b; - return vec4<f32>(r, g, b, 1.0); + return vec4<f32>(r, center.g, b, 1.0); } diff --git a/workspaces/main/shaders/gaussian_blur.wgsl b/workspaces/main/shaders/gaussian_blur.wgsl index 22e467f..4e845ff 100644 --- a/workspaces/main/shaders/gaussian_blur.wgsl +++ b/workspaces/main/shaders/gaussian_blur.wgsl @@ -1,3 +1,5 @@ +// 5x5 gaussian blur + @group(0) @binding(0) var smplr: sampler; @group(0) @binding(1) var txt: texture_2d<f32>; @@ -6,6 +8,8 @@ struct GaussianBlurParams { strength: f32, + strength_audio: f32, + stretch: f32, // dir_y / dir_x _pad: f32, }; @@ -13,17 +17,17 @@ struct GaussianBlurParams { @group(0) @binding(3) var<uniform> params: GaussianBlurParams; @fragment fn fs_main(@builtin(position) p: vec4<f32>) -> @location(0) vec4<f32> { - let uv = p.xy / uniforms.resolution; - var res = vec4<f32>(0.0); - // Parameterized strength + dramatic beat pulsation - let pulse = 0.5 + uniforms.audio_intensity * 2.0; // Pulsate between 0.5x and 2.5x with beat + let pulse = 1.0 + uniforms.audio_intensity * params.strength_audio; // Pulsate beat let size = params.strength * pulse; + let dir = vec2<f32>(1., params.stretch) * size / uniforms.resolution.x; + let uv = p.xy / uniforms.resolution; + var res = vec4<f32>(0.0); for (var x: f32 = -2.0; x <= 2.0; x += 1.0) { for (var y: f32 = -2.0; y <= 2.0; y += 1.0) { - res += textureSample(txt, smplr, uv + vec2<f32>(x, y) * size / uniforms.resolution.x); + res += textureSample(txt, smplr, uv + vec2<f32>(x, y) * dir); } } - return res / 25.0; + return res * (1. / 25.0); } |
