makepad/apps/vj/resources/effects/206_channel_offset.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

52 lines
1.9 KiB
Text

// CHANNEL OFFSET — red and blue split away from green along one axis,
// the axis itself rotatable and the split reach riding the beat, so the
// tear reads as a controlled RGB fringe rather than a fixed glitch.
{
name: "Channel Offset"
engine: "screen"
seed: 206
input0: "test"
speed: 1.0
beat_pulse: 0.5
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: "ANGLE", bind: "p0", default: 0.5},
{name: "DEPTH", bind: "p1", default: 0.5},
{name: "PUMP", 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. The split
// axis is a full rotation of ANGLE; DEPTH sets its reach; PUMP gates
// how much the eased beat pulse adds on top of the base split.
// 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 angle = self.user.x * 6.2831853
let depth = 0.002 + 0.05 * self.user.y
let pump = 1.0 + 1.4 * self.time_beat.w * clamp(self.user.z, 0.0, 1.0)
let dir = vec2(cos(angle), sin(angle)) * depth * pump
let ruv = clamp(uv + dir, vec2(0.0, 0.0), vec2(1.0, 1.0))
let buv = clamp(uv - dir, vec2(0.0, 0.0), vec2(1.0, 1.0))
let r = self.tex0.sample_as_bgra(ruv)
let b = self.tex0.sample_as_bgra(buv)
return vec4(r.x, content.y, b.z, 1.0)
}
}
}