makepad/apps/vj/resources/effects/184_mirror_rotate_a.splash
Arena Agent d8d5ea8b6a Repair integration manifests and port nigig exports onto upstream widget families
Restore missing required asset/flow packages from the pinned nigig revision; retain upstream script isolation, X11 hover, and widget-core fixes. Validated makepad-widgets data feature with Rust 1.97.1.
2026-10-26 11:23:26 +00:00

39 lines
1.4 KiB
Text

// MIRROR ROTATE A — the frame folds across a straight axis through the
// centre; the axis spins continuously and SHIFT slides it off-centre.
{
name: "Mirror Rotate A"
engine: "screen"
input0: "test"
p0: 0.5 p1: 0.5 p2: 0.5
dials: [
{name: "SPIN", bind: "p0", default: 0.5},
{name: "SHIFT", bind: "p1", default: 0.5},
{name: "EDGE", bind: "p2", default: 0.5}
]
stages: [
{kind: "bloom", threshold: 0.6, strength: 1.05, levels: 2}
]
shader: draw.DrawVjFxScreen {
fx_color: fn(uv: vec2, content: vec4, cmix: float) -> vec4 {
let ang = self.time_beat.x * 0.16 * (0.2 + 1.6 * self.user.x)
let cs = cos(ang)
let sn = sin(ang)
let u = vec2(cs, sn)
let n = vec2(-sn, cs)
let shift = (self.user.y - 0.5) * 0.5
let c = uv - vec2(0.5, 0.5)
let along = c.x * u.x + c.y * u.y
let perp = c.x * n.x + c.y * n.y - shift
let fperp = abs(perp) + shift
let p = u * along + n * fperp
let w = p + vec2(0.5, 0.5)
let tex = self.tex0.sample_as_bgra(clamp(w, vec2(0.0, 0.0), vec2(1.0, 1.0)))
let seam = smoothstep(0.0, 0.01 + 0.05 * self.user.z, abs(perp))
let out = tex.xyz * (0.6 + 0.4 * seam) + vec3(1.0, 1.0, 1.0) * (1.0 - seam) * 0.2
return vec4(out, 1.0)
}
}
}