makepad/apps/vj/resources/effects/83_confetti_swarm.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

66 lines
2.2 KiB
Text

// CONFETTI SWARM — the hard-techno flock: five hundred additive neon
// gliders, and a PREDATOR dives through the swarm on every bar so the
// whole formation detonates and re-forms in four beats. Pattern taught
// here: `predator` is the flock's bar-synced scatter (CPU-side boids, no
// binding needed), `additive: 1` flips the same engine from silhouettes
// to light streaks, and pulse-driven feedback smears the scatter into
// trails.
{
name: "Confetti Swarm"
engine: "flock"
seed: 77
birds: 500
size: 0.11
flight_speed: 3.4
flap: 4.5
bound: 6.0
spacing: 0.34
vision: 1.4
goal_beats: 1
predator: 0.85
additive: 1.0
bank: 1.6
bar_beats: 4
beat_pulse: "1.1 * (0.2 + 1.6*p1)"
cam_orbit: 0.14
fog: 0.05
glow: "0.25 + 1.5*p2"
// PERFORMANCE DIALS — mid-knob = the stock look, exact.
p0: 0.5 p1: 0.5 p2: 0.5
dials: [
{name: "TRAIL", bind: "p0", default: 0.5},
{name: "PUMP", bind: "p1", default: 0.5},
{name: "GLOW", bind: "p2", default: 0.5}
]
color_bg: #x06040c
color_a: #x22ffcc
color_b: #xff2f9a
color_c: #xffffff
stages: [
{kind: "feedback", amount: "min(0.5 + 0.25 * pulse + (p0-0.5)*0.6, 0.97)", zoom: 1.015,
rotate: 0.006, dim: 0.95},
{kind: "bloom", threshold: 0.35, strength: 1.5, levels: 3}
]
// THE LOOK LIVES HERE. This block is not a reference to the
// engine's shader — it IS the pixel math this effect runs.
// Rewrite it and the effect looks different; everything else
// (geometry, motion, the content coupling, the beat) keeps
// working, because the block SUBCLASSES the engine shader.
// Inputs: t = speed 0..1, attr = (bird, speed01, hue, flap amplitude).
// 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.DrawVjFxFlock {
fx_color: fn(t: float, attr: vec4, normal: vec3, wpos: vec3) -> vec4 {
let base = self.col_a.mix(self.col_b, attr.z)
let gain = 0.5 + 0.6 * t + self.time_beat.w * 0.35
return vec4(base.xyz * gain, 1.0)
}
}
}