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.
30 lines
1.1 KiB
Text
30 lines
1.1 KiB
Text
// BAR CURTAIN H — vertical bars close toward alternating edges: even
|
|
// bars slide in from the left, odd bars from the right. SAW staggers
|
|
// each bar's start by a per-bar hash so the curtain does not close in
|
|
// lockstep.
|
|
{
|
|
name: "Bar Curtain H"
|
|
engine: "transition"
|
|
p1: 0.5
|
|
dials: [
|
|
{name: "SOFT", bind: "p0", default: 0.15},
|
|
{name: "BARS", bind: "p1", default: 0.5},
|
|
{name: "SAW", bind: "p2", default: 0.3}
|
|
]
|
|
shader: draw.DrawVjFxDuo {
|
|
trans: fn(uv: vec2, t: float) -> vec4 {
|
|
let n = 6.0 + floor(self.user.y * 14.0)
|
|
let col = floor(uv.x * n)
|
|
let cellx = fract(uv.x * n)
|
|
let parity = modf(col, 2.0)
|
|
let local = mix(cellx, 1.0 - cellx, parity)
|
|
let soft = 0.02 + self.user.x * 0.3
|
|
let hash = fract(sin(col * 12.9898 + 4.0) * 43758.5453)
|
|
let saw = (hash - 0.5) * self.user.z * 0.6
|
|
let tt = t * (1.0 + 2.0 * soft) - soft + saw
|
|
let m = smoothstep(tt - soft, tt + soft, local)
|
|
let c = self.deck_b(uv).mix(self.deck_a(uv), m)
|
|
return vec4(c.xyz, 1.0)
|
|
}
|
|
}
|
|
}
|