makepad/apps/vj/resources/effects/209_dual_blend.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

58 lines
2.2 KiB
Text

// DUAL BLEND — the frame blends against a second, shifted copy of itself:
// MODUS sweeps the operator from darkest-wins through a plain 50/50 mix
// to brightest-wins, OFFSET sets how far the second copy is shifted,
// AMOUNT how much of the blended result replaces the original.
{
name: "Dual Blend"
engine: "screen"
seed: 209
input0: "test"
speed: 1.0
beat_pulse: 0.4
beat_rate: 1.0
bar_beats: 4
glow: 1.0
// PERFORMANCE DIALS — mid-knob = the stock look, exact.
p0: 0.5 p1: 0.5 p2: 0.5
dials: [
{name: "MODUS", bind: "p0", default: 0.5},
{name: "OFFSET", bind: "p1", default: 0.5},
{name: "AMOUNT", bind: "p2", default: 0.5}
]
color_bg: #x03040a
color_a: #x30ffd0
color_b: #xff3a86
color_c: #xfff0d0
stages: [
{kind: "bloom", threshold: 0.6, strength: 1.0, levels: 2}
]
// THE LOOK LIVES HERE: the whole frame is this function. A second
// sample of the SAME input, shifted by OFFSET, is combined against
// the first with a MODUS that sweeps continuously from min to mix to
// max — a single input, never a second deck.
// Inputs: uv, content = input0 at uv, cmix = pre-gated content
// strength. Signals: self.time_beat (time, beat, phase, pulse),
// self.sig (bar, bpm, energy, dt), self.user (p0..p3),
// self.col_a/b/c/bg, self.fog (density, glow, content, -).
shader: draw.DrawVjFxScreen {
fx_color: fn(uv: vec2, content: vec4, cmix: float) -> vec4 {
let off = (0.01 + 0.09 * clamp(self.user.y, 0.0, 1.0)) * vec2(0.7, 0.4)
let uv2 = clamp(uv + off, vec2(0.0, 0.0), vec2(1.0, 1.0))
let copy2 = self.tex0.sample_as_bgra(uv2)
let a = content.xyz
let b = copy2.xyz
let mn = vec3(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z))
let mx = vec3(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z))
let nm = a.mix(b, 0.5)
let t = clamp(self.user.x, 0.0, 1.0) * 2.0
let stage1 = mn.mix(nm, clamp(t, 0.0, 1.0))
let blended = stage1.mix(mx, clamp(t - 1.0, 0.0, 1.0))
let rgb = a.mix(blended, clamp(self.user.z, 0.0, 1.0))
return vec4(rgb, 1.0)
}
}
}