makepad/apps/vj/resources/effects/185_mirror_rotate_b.splash
Admin cb49b032df vjfx: 104 presets, engine hooks + hold stage, the videomesh engine, the audio picture, livecodable effects, and mp4 thumbnail sheets
Squashed from work; the fine-grained history is under tag archive/work-2026-08-26:
- vjfx: 104 new presets — the transition lane fills out and the screen family goes wide
- vjfx: three lanes land — engine hooks + hold stage, the videomesh engine, and the audio picture
- vj: the thumbnail pipeline becomes one honest machine, and effects go livecodable
- vj: thumbnails become mp4 — hardware-coded sheets at measured-4K cells, and the bake stops racing the GPU
- store: the ceremony dies — batch publish, one transaction, and the engine stops re-reading its own log
- store: the ceremony dies — batch publish, one transaction, and the engine stops re-reading its own log
- vj: the console grows real transports, and the deck stops lying about reverse
- vj: reverse earns a memory, and the effects stop aging
- fab: a 3D creation shell and the viewer built on it
2026-08-26 08:49:48 +02:00

44 lines
1.6 KiB
Text

// MIRROR ROTATE B — the same fold-across-an-axis mirror, but the axis
// SNAPS to a new angle every beat instead of spinning continuously — a
// stepped, stroboscopic cousin of Mirror Rotate A.
{
name: "Mirror Rotate B"
engine: "screen"
input0: "test"
p0: 0.5 p1: 0.5 p2: 0.5
dials: [
{name: "STEPS", 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 pi = 3.14159265
let steps = mix(3.0, 12.0, self.user.x)
let beat_id = floor(self.time_beat.y)
let slot = modf(beat_id, steps)
let ang = (slot / steps) * pi
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)
}
}
}