diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-28 09:08:57 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-28 09:08:57 +0100 |
| commit | 9ee410594a52cbc699b13de2bde4860d70c959a3 (patch) | |
| tree | d56adf5931d488abcf3ac8e24a828d2d5b02e8cc /common/shaders/heptagon.wgsl | |
| parent | 6599a428cd69be6c66c5179e1f0fce42f561f935 (diff) | |
refactor: move common/shaders/ to src/shaders/
Relocates shared WGSL shaders under src/ where all source code lives,
eliminating the top-level common/ directory.
- Update asset references in workspaces/main/assets.txt and workspaces/test/assets.txt
- Update docs: PROJECT_CONTEXT.md, ARCHITECTURE.md, WORKSPACE_SYSTEM.md, SHADER_REUSE_INVESTIGATION.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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); -} |
