Python/OpenCV proof of concept plus first native Swift port

Snapshot before the Python POC is removed. The POC (main.py, effects.py,
panel.py, shaders.py, effects/*.glsl, flake.nix) is the reference for the
native app under native/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Rasyidan Akbar F. 2026-10-05 20:26:47 +07:00
commit 6591138bbf
27 changed files with 2076 additions and 0 deletions

View file

@ -0,0 +1,16 @@
// Feedback trails: the previous output is zoomed, turned and faded, so bright things leave streaks.
// "push" smears the trails in the direction things are moving.
// order 40
// on
// slider fade 0.5 0.995 0.92
// slider zoom -0.04 0.04 0.012
// slider spin -0.05 0.05 0.005
// slider push 0.0 4.0 0.0
float4 effect(float2 uv, Inputs in) {
float2 c = uv - 0.5;
float2 turned = float2(c.x * cos(in.p.spin) - c.y * sin(in.p.spin), c.x * sin(in.p.spin) + c.y * cos(in.p.spin));
float2 from = turned * (1.0 - in.p.zoom) + 0.5 - in.flow.sample(in.smp, uv).xy * in.p.push;
float3 trail = in.prev.sample(in.smp, from).rgb * in.p.fade;
float3 live = in.image.sample(in.smp, uv).rgb;
return float4(max(live, trail), 1.0);
}