makepad/apps/vj/resources/effects/230_video_box.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

48 lines
1.6 KiB
Text

// VIDEO BOX — five video-faced boxes riding a slow carousel, each tumbling
// at its own hashed rate while bobbing on detuned sines. The whole ring
// drifts past the orbiting camera so there is always a face arriving and a
// face leaving. Pattern taught here: a multi-instance fx_place — carousel
// angle from the instance id plus per-instance spin from the stream hash.
{
name: "Video Box"
engine: "videomesh"
shape: "box"
seed: 8
instances: 5
size: 1.5
spread: 3.4
fly: 0.7
beat_pulse: 0.4
input0: "test"
color_bg: #x070510
color_a: #xf0a840
color_b: #x40c8f0
color_c: #xffe9c8
fog: 0.02
glow: 1.0
stages: [
{kind: "bloom", threshold: 0.72, strength: 0.7, levels: 2}
]
// THE LOOK LIVES HERE — carousel placement + the lit face.
shader: draw.DrawVjFxVideomesh {
fx_place: fn(id: float, hash: float, t: float) -> vec4 {
let a = (id / 5.0 + t * 0.03) * 6.2831853
let r = self.shape.w
let y = 0.55 * sin(t * 0.6 + id * 2.3)
let spin = t * (0.35 + hash * 0.5) * (1.0 + clamp(self.user.x, 0.0, 4.0))
return vec4(sin(a) * r, y, cos(a) * r, spin)
}
fx_color: fn(t: float, attr: vec4, content: vec4, cmix: float) -> vec4 {
let lit = content.xyz * (t * (0.5 + 0.5 * attr.z))
let rim = self.col_a.xyz.mix(self.col_b.xyz, attr.x) * (1.0 - attr.z)
* (0.35 + self.time_beat.w * 1.0 + clamp(self.user.z, 0.0, 4.0))
return vec4((lit + rim) * self.fog.y, 1.0)
}
}
}