makepad/apps/vj/resources/effects/151_trans_add_fade.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

29 lines
1.1 KiB
Text

// ADD FADE — a crossfade that blows out additively through the middle:
// as deck B fades in, its light also pours on top of the mix (mid-fade
// only), then the transition lands clean on pure B. CURVE bends both the
// fade law and where the bloom peaks, BOOST sets the bloom's strength,
// DIP ducks through black just before it.
{
name: "Add Fade"
engine: "transition"
p0: 0.5
dials: [
{name: "CURVE", bind: "p0", default: 0.5},
{name: "BOOST", bind: "p1", default: 0.35},
{name: "DIP", bind: "p2", default: 0.0}
]
shader: draw.DrawVjFxDuo {
trans: fn(uv: vec2, t: float) -> vec4 {
let tt0 = clamp(t, 0.0, 1.0)
let curved = pow(tt0, pow(4.0, self.user.x * 2.0 - 1.0))
let a = self.deck_a(uv)
let b = self.deck_b(uv)
let base = a.xyz.mix(b.xyz, curved)
let mid = 4.0 * curved * (1.0 - curved)
let bloom = mid * self.user.y * 1.2
let dim = 1.0 - mid * self.user.z * 0.9
let c = (base + b.xyz * bloom) * dim
return vec4(min(c.x, 1.0), min(c.y, 1.0), min(c.z, 1.0), 1.0)
}
}
}