Go native-only: remove the Python POC, move the Swift app to the top level
Adds --check (compile every effect without camera or window), EFFECTS.md (the contract for writing effects) and AGENTS.md. The POC stays available at the 'poc' tag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
6591138bbf
commit
a20d3310db
29 changed files with 160 additions and 775 deletions
18
effects/halftone.metal
Normal file
18
effects/halftone.metal
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
// Halftone dots sized by brightness; dots turn hot orange wherever something moves.
|
||||
// order 70
|
||||
// slider cell 4.0 40.0 12.0
|
||||
// slider heat 0.0 20.0 8.0
|
||||
float4 effect(float2 uv, Inputs in) {
|
||||
float2 grid = in.resolution / in.p.cell;
|
||||
float2 centre = (floor(uv * grid) + 0.5) / grid;
|
||||
float3 c = in.image.sample(in.smp, centre).rgb;
|
||||
float luma = dot(c, float3(0.299, 0.587, 0.114));
|
||||
|
||||
float radius = 0.5 * sqrt(luma);
|
||||
float dist = length(fract(uv * grid) - 0.5);
|
||||
float mask = 1.0 - smoothstep(radius - 0.05, radius + 0.05, dist);
|
||||
|
||||
float moved = length(in.camera.sample(in.smp, centre).rgb - in.last.sample(in.smp, centre).rgb);
|
||||
float3 hot = mix(c, float3(1.0, 0.35, 0.1), clamp(moved * in.p.heat, 0.0, 1.0));
|
||||
return float4(hot * mask, 1.0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue