Add in.dt, slider warnings in --check, and two agent-written effects

Spec fixes come from a test where pi + deepseek-v4.1-flash wrote effects
from EFFECTS.md alone: glitch-blocks and ghost-stamps both compiled on the
first try. The agent's feedback led to in.dt (frame time), documented
limits of in.prev as memory, and a --check warning for ignored slider lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Rasyidan Akbar F. 2026-10-05 20:50:31 +07:00
commit 169c5f9b63
6 changed files with 111 additions and 9 deletions

View file

@ -74,6 +74,7 @@ func effectShader(body: String, params: [EffectParam]) -> String {
return shaderPrelude + """
struct Uniforms {
float time;
float dt;
float2 resolution;
float params[\(maxParams)];
};
@ -89,6 +90,7 @@ func effectShader(body: String, params: [EffectParam]) -> String {
texture2d<float> particles; // .r = brightness of particles that drift along with the motion
sampler smp;
float time; // seconds since start
float dt; // seconds since the previous frame (about 1/30)
float2 resolution; // output size in pixels
Params p; // this effect's sliders
};
@ -106,7 +108,7 @@ func effectShader(body: String, params: [EffectParam]) -> String {
constant Uniforms &u [[buffer(0)]]) {
constexpr sampler smp(filter::linear, address::clamp_to_edge);
Params p = { \(values) };
Inputs in = { image, camera, last, prev, flow, particles, smp, u.time, u.resolution, p };
Inputs in = { image, camera, last, prev, flow, particles, smp, u.time, u.dt, u.resolution, p };
return effect(v.uv, in);
}
"""