makepad/apps/vj/resources/effects/183_mirror_strip.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

36 lines
1.3 KiB
Text

// MIRROR STRIP — the frame cut into bands, every other band mirrored;
// the band seam slowly scrolls across, a moving mirrored grating.
{
name: "Mirror Strip"
engine: "screen"
input0: "test"
p0: 0.5 p1: 0.5 p2: 0.5
dials: [
{name: "WIDTH", bind: "p0", default: 0.5},
{name: "SCROLL", bind: "p1", default: 0.5},
{name: "GLOW", 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 bandw = mix(0.04, 0.22, self.user.x)
let scroll = modf(self.time_beat.x * 0.04 * (0.2 + 1.6 * self.user.y), bandw)
let bx = uv.x + scroll
let idx = floor(bx / bandw)
let local = fract(bx / bandw)
let odd = modf(idx, 2.0)
let mlocal = mix(local, 1.0 - local, step(0.5, odd))
let band0 = idx * bandw - scroll
let wx = band0 + mlocal * bandw
let w = vec2(clamp(wx, 0.0, 1.0), uv.y)
let tex = self.tex0.sample_as_bgra(w)
let seam = smoothstep(0.0, 0.02 + 0.06 * self.user.z, min(local, 1.0 - local))
return vec4(tex.xyz * (0.55 + 0.45 * seam), 1.0)
}
}
}