From b9c2a0394343ff3586880d118b7d549b3e748cad Mon Sep 17 00:00:00 2001 From: skal Date: Sat, 28 Feb 2026 11:50:13 +0100 Subject: refactor(effects): co-locate effect WGSL shaders with their .h/.cc in src/effects/ Move 13 effect-specific shaders from workspaces/main/shaders/ to src/effects/ so each effect's .h, .cc, and .wgsl are together. Update assets.txt paths in both main and test workspaces. Update EFFECT_WORKFLOW.md to reflect new location. Shared/reusable snippets remain in src/shaders/. handoff(Gemini): shaders moved; src/effects/ now has .h, .cc, and .wgsl per effect. Co-Authored-By: Claude Sonnet 4.6 --- src/effects/ellipse.wgsl | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/effects/ellipse.wgsl (limited to 'src/effects/ellipse.wgsl') diff --git a/src/effects/ellipse.wgsl b/src/effects/ellipse.wgsl new file mode 100644 index 0000000..a377507 --- /dev/null +++ b/src/effects/ellipse.wgsl @@ -0,0 +1,12 @@ +#include "common_uniforms" +#include "render/fullscreen_vs" +#include "math/sdf_shapes" + +@group(0) @binding(0) var uniforms: CommonUniforms; + +@fragment fn fs_main(@builtin(position) p: vec4f) -> @location(0) vec4f { + let uv = (p.xy / uniforms.resolution - 0.5) * 2.0; + let movement = vec2f(sin(uniforms.time * 0.7), cos(uniforms.time * 0.5)); + let d = sdEllipse((uv * vec2f(uniforms.aspect_ratio, 1.0)) - movement, vec2f(0.5, 0.3) * (1.0 + uniforms.beat_phase * 0.2)); + return mix(vec4f(0.2, 0.8, 0.4, 1.0), vec4f(0.0), smoothstep(0.0, 0.01, d)); +} -- cgit v1.2.3