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.
31 lines
1.3 KiB
Text
31 lines
1.3 KiB
Text
// NEGATIVE MIX — the MX50 party trick: deck B's brightness INVERTS deck A
|
|
// (solarize where B burns). At rest nothing; ride the fader into the burn.
|
|
{
|
|
name: "Negative Mix"
|
|
engine: "transition"
|
|
// Overlay semantics: ridden to the fader's end the key STAYS fully
|
|
// applied (the composite is the destination) — never a snap to
|
|
// plain B. Zero only at the A end.
|
|
engage: "ramp"
|
|
p2: 0.5
|
|
dials: [
|
|
{name: "DRIVE", bind: "p0", default: 0.5},
|
|
{name: "THRS", bind: "p1", default: 0.0},
|
|
{name: "CURVE", bind: "p2", default: 0.5}
|
|
]
|
|
shader: draw.DrawVjFxDuo {
|
|
trans: fn(uv: vec2, t: float) -> vec4 {
|
|
let a = self.deck_a(uv)
|
|
let b = self.deck_b(uv)
|
|
let luma = dot(b.xyz, vec3(0.2126, 0.7152, 0.0722))
|
|
// THRS narrows the burn to B's highlights (0 = the stock
|
|
// linear response).
|
|
let l2 = mix(luma, smoothstep(0.3, 0.9, luma), self.user.y)
|
|
// CURVE bends the fader response (1:1 at mid-knob).
|
|
let tt = pow(clamp(t, 0.0, 1.0), pow(4.0, self.user.z * 2.0 - 1.0))
|
|
let burn = clamp(l2 * (0.5 + self.user.x * 1.5) * tt, 0.0, 1.0)
|
|
let neg = vec3(1.0, 1.0, 1.0) - a.xyz
|
|
return vec4(a.xyz.mix(neg, burn), 1.0)
|
|
}
|
|
}
|
|
}
|