motionlab/native/effects/wave-shift.metal
0xrsydn 6591138bbf 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>
2026-10-05 20:26:47 +07:00

13 lines
556 B
Metal

// RGB split that ripples down the image and gets pushed around by your movement.
// order 60
// slider amount 0.0 0.05 0.012
// slider waves 1.0 80.0 24.0
// slider speed 0.0 10.0 3.0
// slider react 0.0 3.0 1.0
float4 effect(float2 uv, Inputs in) {
float2 d = float2(in.p.amount * sin(uv.y * in.p.waves + in.time * in.p.speed), 0.0);
d += in.flow.sample(in.smp, uv).xy * in.p.react;
return float4(in.image.sample(in.smp, uv + d).r,
in.image.sample(in.smp, uv).g,
in.image.sample(in.smp, uv - d).b, 1.0);
}