diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-16 14:32:59 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-16 14:32:59 +0100 |
| commit | b2ede3f0680edc894a54e28374cb87ab2690afa2 (patch) | |
| tree | 69e0a8c04eb29be953b037eb98e0a9ac0f1b417a /common/shaders/heptagon_v2.wgsl | |
| parent | 0fd3c982247d05bacbd67db08c865ec67602437f (diff) | |
refactor: remove v2 versioning artifacts, establish Sequence as canonical system
Complete v1→v2 migration cleanup: rename 29 files (sequence_v2→sequence, effect_v2→effect, 14 effect files, 8 shaders, compiler, docs), update all class names and references across 54 files. Archive v1 timeline. System now uses standard naming with all versioning removed. 30/34 tests passing.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'common/shaders/heptagon_v2.wgsl')
| -rw-r--r-- | common/shaders/heptagon_v2.wgsl | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/common/shaders/heptagon_v2.wgsl b/common/shaders/heptagon_v2.wgsl deleted file mode 100644 index cb07c18..0000000 --- a/common/shaders/heptagon_v2.wgsl +++ /dev/null @@ -1,47 +0,0 @@ -// Heptagon shader for Sequence v2 -#include "sequence_v2_uniforms" - -// Standard v2 post-process layout (bindings 0,1 unused for scene effects) -@group(0) @binding(2) var<uniform> uniforms: UniformsSequenceParams; - -struct VertexOutput { - @builtin(position) position: vec4<f32>, - @location(0) uv: vec2<f32>, -}; - -@vertex fn vs_main(@builtin(vertex_index) vid: u32) -> VertexOutput { - var out: VertexOutput; - let x = f32((vid & 1u) << 1u); - let y = f32((vid & 2u)); - out.position = vec4<f32>(x * 2.0 - 1.0, 1.0 - y * 2.0, 0.0, 1.0); - out.uv = vec2<f32>(x, y); - return out; -} - -fn sdf_heptagon(p: vec2<f32>, r: f32) -> f32 { - let k = vec3<f32>(0.868516, -0.495754, 0.357407); - var p_abs = abs(p); - p_abs -= 2.0 * k.xy * min(dot(k.xy, p_abs), 0.0); - p_abs -= 2.0 * vec2<f32>(-k.x, k.y) * min(dot(vec2<f32>(-k.x, k.y), p_abs), 0.0); - p_abs -= vec2<f32>(clamp(p_abs.x, -k.z * r, k.z * r), r); - return length(p_abs) * sign(p_abs.y); -} - -@fragment fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> { - let aspect = uniforms.aspect_ratio; - let uv = (in.uv * 2.0 - 1.0) * vec2<f32>(aspect, 1.0); - - let rotation = uniforms.beat_time * 0.5; - let c = cos(rotation); - let s = sin(rotation); - let rot_uv = vec2<f32>( - uv.x * c - uv.y * s, - uv.x * s + uv.y * c - ); - - let dist = sdf_heptagon(rot_uv, 0.5); - let color = mix(vec3<f32>(0.2, 0.4, 0.8), vec3<f32>(1.0, 0.8, 0.2), - smoothstep(0.01, -0.01, dist)); - - return vec4<f32>(color, 1.0); -} |
