diff options
Diffstat (limited to 'common/shaders/heptagon.wgsl')
| -rw-r--r-- | common/shaders/heptagon.wgsl | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/common/shaders/heptagon.wgsl b/common/shaders/heptagon.wgsl deleted file mode 100644 index a8a450f..0000000 --- a/common/shaders/heptagon.wgsl +++ /dev/null @@ -1,33 +0,0 @@ -// Heptagon shader for Sequence v2 -#include "sequence_uniforms" -#include "render/fullscreen_uv_vs" // <- VertexOutput + vs_main - -// Standard v2 post-process layout (bindings 0,1 unused for scene effects) -@group(0) @binding(2) var<uniform> uniforms: UniformsSequenceParams; - -fn sdf_heptagon(p: vec2f, r: f32) -> f32 { - let an = 3.141593 / 7.0; // PI/7 for heptagon - let acs = vec2f(cos(an), sin(an)); - let bn = (atan2(p.x, p.y) % (2.0 * an)) - an; - let q = length(p) * vec2f(cos(bn), abs(sin(bn))); - return length(q - r * acs) * sign(q.x - r * acs.x); -} - -@fragment fn fs_main(in: VertexOutput) -> @location(0) vec4f { - let aspect = uniforms.aspect_ratio; - let uv = (in.uv * 2.0 - 1.0) * vec2f(aspect, 1.0); - - let rotation = uniforms.beat_time * 0.5; - let c = cos(rotation); - let s = sin(rotation); - let rot_uv = vec2f( - uv.x * c - uv.y * s, - uv.x * s + uv.y * c - ); - - let dist = sdf_heptagon(rot_uv, 0.3); - let color = mix(vec3f(0.2, 0.4, 0.8), vec3f(1.0, 0.8, 0.2), - smoothstep(0.01, -0.01, dist)); - - return vec4f(color, 1.0); -} |
