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.
27 lines
1.1 KiB
Text
27 lines
1.1 KiB
Text
// DOORS V — the reverse of Barn Doors V: deck B's two panels swing in
|
|
// from the top and bottom edges and shut over deck A at the horizontal
|
|
// centre seam. FLIP swaps which deck does the closing.
|
|
{
|
|
name: "Doors V"
|
|
engine: "transition"
|
|
dials: [
|
|
{name: "SOFT", bind: "p0", default: 0.1},
|
|
{name: "FLIP", bind: "p1", default: 0.0},
|
|
{name: "DIP", bind: "p2", default: 0.0}
|
|
]
|
|
shader: draw.DrawVjFxDuo {
|
|
trans: fn(uv: vec2, t: float) -> vec4 {
|
|
let field = min(uv.y, 1.0 - uv.y) * 2.0
|
|
let soft = 0.005 + self.user.x * 0.2
|
|
let flip = step(0.5, self.user.y)
|
|
let tt = mix(t, 1.0 - t, flip)
|
|
let edge = tt * (1.0 + 2.0 * soft) - soft
|
|
let inside = smoothstep(edge + soft, edge - soft, field)
|
|
let cin = self.deck_b(uv).mix(self.deck_a(uv), flip)
|
|
let cout = self.deck_a(uv).mix(self.deck_b(uv), flip)
|
|
let c = cout.mix(cin, inside)
|
|
let dim = 1.0 - 4.0 * clamp(t, 0.0, 1.0) * (1.0 - clamp(t, 0.0, 1.0)) * self.user.z * 0.9
|
|
return vec4(c.xyz * dim, 1.0)
|
|
}
|
|
}
|
|
}
|