Skip to content

The truly free, open-source, local-first, cross-platform CapCut replacement. Scriptable through a JSON-RPC API & MCP.

feat(effects): the colour looks and transitions on format 2 - drawn on the GPU in light, no FFmpeg chains

Jareerf7f05fdb0a93
diff --git a/src/crates/concat-cli/src/main.rs b/src/crates/concat-cli/src/main.rs
index 2edc9099..c0ce6923 100644
--- a/src/crates/concat-cli/src/main.rs
+++ b/src/crates/concat-cli/src/main.rs
@@ -351,11 +351,15 @@ fn check_probes(folder: &Path, gpu: &mut Option<WgpuCompositor>) -> Vec<String>
};
let mut problems = Vec::new();
for (n, probe) in package.probes.iter().enumerate() {
- let Some(pass) = package.probe_pass(probe) else {
- continue;
- };
let label = probe.label(n);
- match gpu.probe(&[pass], probe.input, 8, 0.0) {
+ let got = match (package.probe_pass(probe), package.probe_transition(probe)) {
+ (Some(pass), _) => gpu.probe(&[pass], probe.input, 8, 0.0),
+ (None, Some(cut)) => {
+ gpu.probe_transition(&cut, probe.input, probe.to.unwrap_or_default(), 8, 0.0)
+ }
+ (None, None) => continue,
+ };
+ match got {
Some(got) => {
if let Err(error) = probe.check(got) {
problems.push(format!("{}: {label}\n {error}", package.id()));
diff --git a/src/crates/concat-effects/packages/concat.adjust/effect.toml b/src/crates/concat-effects/packages/concat.adjust/effect.toml
index e2691ded..904709f8 100644
--- a/src/crates/concat-effects/packages/concat.adjust/effect.toml
+++ b/src/crates/concat-effects/packages/concat.adjust/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.adjust"
name = "Adjust"
@@ -145,15 +147,6 @@ default = 0
step = 1
unit = "%"
-[ffmpeg]
-let = [
- "lift = fade / 100 * 0.25",
- "low = clamp(0.25 + shadows / 100 * 0.18, 0.05, 0.45)",
- "high = clamp(0.75 + highlights / 100 * 0.18, 0.55, 0.95)",
- "black = clamp(0.1 + blacks / 100 * 0.1, 0, 0.2)",
- "white = clamp(0.9 + whites / 100 * 0.1, 0.8, 1)",
-]
-chain = "exposure=exposure={fixed(exposure, 2)},eq=brightness={fixed(brightness / 100 * 0.5, 3)}:contrast={fixed(1 + contrast / 100, 3)}:saturation={fixed(1 + saturation / 100 * 2, 3)},colortemperature=temperature={round(temperature)},colorbalance=gm={fixed(0 - tint / 100 * 0.5, 3)},curves=all='0/{fixed(lift, 3)} 0.1/{fixed(black, 3)} 0.25/{fixed(low, 3)} 0.75/{fixed(high, 3)} 0.9/{fixed(white, 3)} 1/1',unsharp=5:5:{fixed(sharpen / 100 * 2, 2)},vignette=a={fixed(vignette / 100 * 1.2, 3)}"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.adjust/effect.wgsl b/src/crates/concat-effects/packages/concat.adjust/effect.wgsl
index 804e05c3..90a63bf5 100644
--- a/src/crates/concat-effects/packages/concat.adjust/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.adjust/effect.wgsl
@@ -63,5 +63,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
c = c * (1.0 - fall * (0.4 + 0.6 * v));
}
- return vec4<f32>(clamp(c, vec3<f32>(0.0), vec3<f32>(1.0)), src.a);
+ return vec4<f32>(c, src.a);
}
diff --git a/src/crates/concat-effects/packages/concat.adjust/fixtures.toml b/src/crates/concat-effects/packages/concat.adjust/fixtures.toml
index dbcdd410..43705e6e 100644
--- a/src/crates/concat-effects/packages/concat.adjust/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.adjust/fixtures.toml
@@ -1,13 +1,22 @@
-[[case]]
-name = "default is the picture as shot"
-chain = "exposure=exposure=0.00,eq=brightness=0.000:contrast=1.000:saturation=1.000,colortemperature=temperature=6500,colorbalance=gm=0.000,curves=all='0/0.000 0.1/0.100 0.25/0.250 0.75/0.750 0.9/0.900 1/1',unsharp=5:5:0.00,vignette=a=0.000"
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
-[[case]]
-name = "everything down"
+[[probe]]
+name = "default"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.30005, 0.19995, 0.12, 1]
+
+[[probe]]
+name = "minimum"
at = "min"
-chain = "exposure=exposure=-3.00,eq=brightness=-0.500:contrast=0.000:saturation=-1.000,colortemperature=temperature=2000,colorbalance=gm=0.500,curves=all='0/0.000 0.1/0.000 0.25/0.070 0.75/0.570 0.9/0.800 1/1',unsharp=5:5:0.00,vignette=a=0.000"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.18945, 0.18945, 0.18945, 1]
-[[case]]
-name = "everything up"
+# Every knob up is far past white, where format 1 clipped it: the panel's
+# exposure scales the display encoding, +3 EV eight times over, until its
+# maths moves into light with the colour sliders (phase 2, step 5).
+[[probe]]
+name = "maximum"
at = "max"
-chain = "exposure=exposure=3.00,eq=brightness=0.500:contrast=2.000:saturation=3.000,colortemperature=temperature=11000,colorbalance=gm=-0.500,curves=all='0/0.250 0.1/0.200 0.25/0.430 0.75/0.930 0.9/1.000 1/1',unsharp=5:5:2.00,vignette=a=1.200"
+input = [0.08, 0.07, 0.06, 1]
+expect = [40.8125, 31.71875, 122.25, 1]
diff --git a/src/crates/concat-effects/packages/concat.autumn/effect.toml b/src/crates/concat-effects/packages/concat.autumn/effect.toml
index 675df45f..a56c7a7d 100644
--- a/src/crates/concat-effects/packages/concat.autumn/effect.toml
+++ b/src/crates/concat-effects/packages/concat.autumn/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.autumn"
name = "Autumn"
@@ -6,8 +8,6 @@ category = "Scenery"
order = 58
description = "Greens pulled toward amber, the picture dipped in fall light."
-[ffmpeg]
-chain = "colorbalance=rh=0.1:gh=0.04:bh=-0.08,eq=saturation=1.1"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.autumn/effect.wgsl b/src/crates/concat-effects/packages/concat.autumn/effect.wgsl
index 59d0b133..0fcad000 100644
--- a/src/crates/concat-effects/packages/concat.autumn/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.autumn/effect.wgsl
@@ -1,5 +1,5 @@
fn effect(uv: vec2<f32>) -> vec4<f32> {
let c = sample(uv);
let t = split_tone(c.rgb, vec3<f32>(0.0), vec3<f32>(0.1, 0.04, -0.08), 1.0);
- return vec4<f32>(clamp01(saturation(t, 1.1)), c.a);
+ return vec4<f32>(saturation(t, 1.1), c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.autumn/fixtures.toml b/src/crates/concat-effects/packages/concat.autumn/fixtures.toml
index b0f45f33..7c4921b0 100644
--- a/src/crates/concat-effects/packages/concat.autumn/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.autumn/fixtures.toml
@@ -1,3 +1,7 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "colorbalance=rh=0.1:gh=0.04:bh=-0.08,eq=saturation=1.1"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.32397, 0.20276, 0.10565, 1]
diff --git a/src/crates/concat-effects/packages/concat.bleach-bypass/effect.toml b/src/crates/concat-effects/packages/concat.bleach-bypass/effect.toml
index ab8f03a1..dc03ca43 100644
--- a/src/crates/concat-effects/packages/concat.bleach-bypass/effect.toml
+++ b/src/crates/concat-effects/packages/concat.bleach-bypass/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.bleach-bypass"
name = "Bleach Bypass"
@@ -6,8 +8,6 @@ category = "Cinematic"
order = 51
description = "The silver-retention film process: colour washed out, contrast pushed hard."
-[ffmpeg]
-chain = "eq=saturation=0.35:contrast=1.3:gamma=0.9"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.bleach-bypass/effect.wgsl b/src/crates/concat-effects/packages/concat.bleach-bypass/effect.wgsl
index 34b8a5ff..aea813b5 100644
--- a/src/crates/concat-effects/packages/concat.bleach-bypass/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.bleach-bypass/effect.wgsl
@@ -2,5 +2,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
let c = sample(uv);
let s = saturation(c.rgb, 0.35);
let f = film_curve(s, 0.15, 0.25);
- return vec4<f32>(clamp01(contrast(f, 1.25)), c.a);
+ return vec4<f32>(contrast(f, 1.25), c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.bleach-bypass/fixtures.toml b/src/crates/concat-effects/packages/concat.bleach-bypass/fixtures.toml
index e5a80e7f..42293f84 100644
--- a/src/crates/concat-effects/packages/concat.bleach-bypass/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.bleach-bypass/fixtures.toml
@@ -1,3 +1,7 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "eq=saturation=0.35:contrast=1.3:gamma=0.9"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.27808, 0.22925, 0.18396, 1]
diff --git a/src/crates/concat-effects/packages/concat.blur-dissolve/effect.toml b/src/crates/concat-effects/packages/concat.blur-dissolve/effect.toml
index 7b1f2b28..b7ae5daa 100644
--- a/src/crates/concat-effects/packages/concat.blur-dissolve/effect.toml
+++ b/src/crates/concat-effects/packages/concat.blur-dissolve/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.blur-dissolve"
name = "Blur Dissolve"
diff --git a/src/crates/concat-effects/packages/concat.blur-dissolve/fixtures.toml b/src/crates/concat-effects/packages/concat.blur-dissolve/fixtures.toml
new file mode 100644
index 00000000..0ebb7187
--- /dev/null
+++ b/src/crates/concat-effects/packages/concat.blur-dissolve/fixtures.toml
@@ -0,0 +1,25 @@
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. A cut from one colour to another, and its middle pixel.
+
+[[probe]]
+name = "default"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.52197, 0.37036, 0.33691, 1]
+
+[[probe]]
+name = "minimum"
+at = "min"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.52197, 0.37036, 0.33691, 1]
+
+[[probe]]
+name = "maximum"
+at = "max"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.52197, 0.37036, 0.33691, 1]
diff --git a/src/crates/concat-effects/packages/concat.bronze/effect.toml b/src/crates/concat-effects/packages/concat.bronze/effect.toml
index 70d1d28b..50680c17 100644
--- a/src/crates/concat-effects/packages/concat.bronze/effect.toml
+++ b/src/crates/concat-effects/packages/concat.bronze/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.bronze"
name = "Bronze"
@@ -25,8 +27,6 @@ default = 30
step = 1
unit = "%"
-[ffmpeg]
-chain = "hue=s={fixed(1 - tone / 100 * 0.9, 3)},colorbalance=rm={fixed(tone / 100 * 0.12, 3)}:gm={fixed(tone / 100 * 0.04, 3)}:bm={fixed(0 - tone / 100 * 0.12, 3)}:rh={fixed(tone / 100 * 0.04, 3)}:bh={fixed(0 - tone / 100 * 0.04, 3)},eq=contrast={fixed(1 + contrast / 100 * 0.3, 3)}"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.bronze/effect.wgsl b/src/crates/concat-effects/packages/concat.bronze/effect.wgsl
index 7243fc0d..42ceddf6 100644
--- a/src/crates/concat-effects/packages/concat.bronze/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.bronze/effect.wgsl
@@ -8,5 +8,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
out = tint_midtones(out, vec3<f32>(0.12, 0.04, -0.12), tone);
out = split_tone(out, vec3<f32>(0.0), vec3<f32>(0.04, 0.01, -0.04), tone);
out = s_curve(out, params.contrast / 100.0 * 0.6);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.bronze/fixtures.toml b/src/crates/concat-effects/packages/concat.bronze/fixtures.toml
index 4df76722..19daa5aa 100644
--- a/src/crates/concat-effects/packages/concat.bronze/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.bronze/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "hue=s=0.280,colorbalance=rm=0.096:gm=0.032:bm=-0.096:rh=0.032:bh=-0.032,eq=contrast=1.090"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.36328, 0.24561, 0.10272, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "hue=s=1.000,colorbalance=rm=0.000:gm=0.000:bm=0.000:rh=0.000:bh=0.000,eq=contrast=1.000"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44995, 0.3999, 0.3501, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "hue=s=0.100,colorbalance=rm=0.120:gm=0.040:bm=-0.120:rh=0.040:bh=-0.040,eq=contrast=1.300"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.10388, 0.065, 0.01962, 1]
diff --git a/src/crates/concat-effects/packages/concat.classic-chrome/effect.toml b/src/crates/concat-effects/packages/concat.classic-chrome/effect.toml
index 9b08f0e9..00cc25a2 100644
--- a/src/crates/concat-effects/packages/concat.classic-chrome/effect.toml
+++ b/src/crates/concat-effects/packages/concat.classic-chrome/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.classic-chrome"
name = "Classic Chrome"
@@ -6,8 +8,6 @@ category = "Film"
order = 61
description = "Muted highlights and deep, open shadows: the restrained look of a classic colour negative."
-[ffmpeg]
-chain = "curves=all='0/0.03 0.5/0.48 1/0.92',eq=saturation=0.9"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.classic-chrome/effect.wgsl b/src/crates/concat-effects/packages/concat.classic-chrome/effect.wgsl
index 7d19ae06..8592fe10 100644
--- a/src/crates/concat-effects/packages/concat.classic-chrome/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.classic-chrome/effect.wgsl
@@ -1,5 +1,5 @@
fn effect(uv: vec2<f32>) -> vec4<f32> {
let c = sample(uv);
let f = film_curve(c.rgb, 0.1, 0.35);
- return vec4<f32>(clamp01(saturation(f, 0.9)), c.a);
+ return vec4<f32>(saturation(f, 0.9), c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.classic-chrome/fixtures.toml b/src/crates/concat-effects/packages/concat.classic-chrome/fixtures.toml
index 5df3509e..b89b6772 100644
--- a/src/crates/concat-effects/packages/concat.classic-chrome/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.classic-chrome/fixtures.toml
@@ -1,3 +1,7 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "curves=all='0/0.03 0.5/0.48 1/0.92',eq=saturation=0.9"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.33911, 0.23218, 0.14319, 1]
diff --git a/src/crates/concat-effects/packages/concat.clean/effect.toml b/src/crates/concat-effects/packages/concat.clean/effect.toml
index fd750fbe..127d7b1a 100644
--- a/src/crates/concat-effects/packages/concat.clean/effect.toml
+++ b/src/crates/concat-effects/packages/concat.clean/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.clean"
name = "Clean"
@@ -16,8 +18,6 @@ default = 50
step = 1
unit = "%"
-[ffmpeg]
-chain = "eq=contrast={fixed(1 + amount / 100 * 0.14, 3)}:saturation={fixed(1 + amount / 100 * 0.1, 3)},selectivecolor=reds='0 {fixed(0 - amount / 100 * 0.06, 3)} 0 0'"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.clean/effect.wgsl b/src/crates/concat-effects/packages/concat.clean/effect.wgsl
index a92a6eba..dd1bb55a 100644
--- a/src/crates/concat-effects/packages/concat.clean/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.clean/effect.wgsl
@@ -7,5 +7,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
var out = s_curve(c.rgb, amount * 0.3);
out = saturation(out, 1.0 + amount * 0.1);
out = hsl_band(out, 10.0, 40.0, 0.0, 1.0 - amount * 0.12, 1.0);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.clean/fixtures.toml b/src/crates/concat-effects/packages/concat.clean/fixtures.toml
index c7e04fc7..58f0949b 100644
--- a/src/crates/concat-effects/packages/concat.clean/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.clean/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "eq=contrast=1.070:saturation=1.050,selectivecolor=reds='0 -0.030 0 0'"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.30273, 0.1969, 0.11334, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "eq=contrast=1.000:saturation=1.000,selectivecolor=reds='0 0.000 0 0'"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44946, 0.39941, 0.34961, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "eq=contrast=1.140:saturation=1.100,selectivecolor=reds='0 -0.060 0 0'"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.06989, 0.05893, 0.04831, 1]
diff --git a/src/crates/concat-effects/packages/concat.clock-wipe/effect.toml b/src/crates/concat-effects/packages/concat.clock-wipe/effect.toml
index 5509fc81..c0b7e4da 100644
--- a/src/crates/concat-effects/packages/concat.clock-wipe/effect.toml
+++ b/src/crates/concat-effects/packages/concat.clock-wipe/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.clock-wipe"
name = "Clock Wipe"
diff --git a/src/crates/concat-effects/packages/concat.clock-wipe/fixtures.toml b/src/crates/concat-effects/packages/concat.clock-wipe/fixtures.toml
new file mode 100644
index 00000000..b058470d
--- /dev/null
+++ b/src/crates/concat-effects/packages/concat.clock-wipe/fixtures.toml
@@ -0,0 +1,9 @@
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. A cut from one colour to another, and its middle pixel.
+
+[[probe]]
+name = "default"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.7998, 0.5, 0.30005, 1]
diff --git a/src/crates/concat-effects/packages/concat.cloudless-sky/effect.toml b/src/crates/concat-effects/packages/concat.cloudless-sky/effect.toml
index 3e71f607..687ad02e 100644
--- a/src/crates/concat-effects/packages/concat.cloudless-sky/effect.toml
+++ b/src/crates/concat-effects/packages/concat.cloudless-sky/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.cloudless-sky"
name = "Cloudless Sky"
@@ -25,8 +27,6 @@ default = 40
step = 1
unit = "%"
-[ffmpeg]
-chain = "selectivecolor=blues='{fixed(sky / 100 * 0.35, 3)} 0 {fixed(0 - sky / 100 * 0.25, 3)} {fixed(sky / 100 * 0.12, 3)}':cyans='{fixed(sky / 100 * 0.2, 3)} 0 {fixed(0 - sky / 100 * 0.15, 3)} 0':greens='{fixed(greens / 100 * 0.25, 3)} 0 {fixed(0 - greens / 100 * 0.25, 3)} 0'"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.cloudless-sky/effect.wgsl b/src/crates/concat-effects/packages/concat.cloudless-sky/effect.wgsl
index 05cdb56f..e3400704 100644
--- a/src/crates/concat-effects/packages/concat.cloudless-sky/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.cloudless-sky/effect.wgsl
@@ -9,5 +9,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
var out = hsl_band(c.rgb, 210.0, 70.0, -6.0 * sky, 1.0 + sky * 0.55, 1.0 - sky * 0.08);
// Foliage: toward teal, quieter.
out = hsl_band(out, 105.0, 60.0, 12.0 * greens, 1.0 - greens * 0.2, 1.0);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.cloudless-sky/fixtures.toml b/src/crates/concat-effects/packages/concat.cloudless-sky/fixtures.toml
index d5399735..e4250a10 100644
--- a/src/crates/concat-effects/packages/concat.cloudless-sky/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.cloudless-sky/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "selectivecolor=blues='0.210 0 -0.150 0.072':cyans='0.120 0 -0.090 0':greens='0.100 0 -0.100 0'"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.30005, 0.19995, 0.12, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "selectivecolor=blues='0.000 0 0.000 0.000':cyans='0.000 0 0.000 0':greens='0.000 0 0.000 0'"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44995, 0.3999, 0.3501, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "selectivecolor=blues='0.350 0 -0.250 0.120':cyans='0.200 0 -0.150 0':greens='0.250 0 -0.250 0'"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.08002, 0.07001, 0.06, 1]
diff --git a/src/crates/concat-effects/packages/concat.contrast-pop/effect.toml b/src/crates/concat-effects/packages/concat.contrast-pop/effect.toml
index 7f0b8664..7b5cb93c 100644
--- a/src/crates/concat-effects/packages/concat.contrast-pop/effect.toml
+++ b/src/crates/concat-effects/packages/concat.contrast-pop/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.contrast-pop"
name = "Contrast Pop"
@@ -16,8 +18,6 @@ max = 2
default = 1.25
step = 0.05
-[ffmpeg]
-chain = "eq=contrast={fixed(contrast, 2)}"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.contrast-pop/effect.wgsl b/src/crates/concat-effects/packages/concat.contrast-pop/effect.wgsl
index 664ce226..fe516783 100644
--- a/src/crates/concat-effects/packages/concat.contrast-pop/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.contrast-pop/effect.wgsl
@@ -7,5 +7,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
let amount = params.contrast - 1.0;
var out = contrast(c.rgb, 1.0 + amount * 0.7);
out = film_curve(out, amount * 0.5, amount * 0.5);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.contrast-pop/fixtures.toml b/src/crates/concat-effects/packages/concat.contrast-pop/fixtures.toml
index 9d58de6d..bd952be7 100644
--- a/src/crates/concat-effects/packages/concat.contrast-pop/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.contrast-pop/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "eq=contrast=1.25"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.3313, 0.20215, 0.10522, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "eq=contrast=1.00"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44995, 0.3999, 0.3501, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "eq=contrast=2.00"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.01772, 0.01134, 0.00649, 1]
diff --git a/src/crates/concat-effects/packages/concat.cool-blue/effect.toml b/src/crates/concat-effects/packages/concat.cool-blue/effect.toml
index c756ba8f..c4ad90ee 100644
--- a/src/crates/concat-effects/packages/concat.cool-blue/effect.toml
+++ b/src/crates/concat-effects/packages/concat.cool-blue/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.cool-blue"
name = "Cool Blue"
@@ -25,8 +27,6 @@ default = 30
step = 1
unit = "%"
-[ffmpeg]
-chain = "colorbalance=bs={fixed(chill / 100 * 0.25, 3)}:rs={fixed(0 - chill / 100 * 0.08, 3)}:bm={fixed(chill / 100 * 0.1, 3)},eq=contrast={fixed(1 + contrast / 100 * 0.35, 3)}"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.cool-blue/effect.wgsl b/src/crates/concat-effects/packages/concat.cool-blue/effect.wgsl
index e3ba3e40..baa9aed3 100644
--- a/src/crates/concat-effects/packages/concat.cool-blue/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.cool-blue/effect.wgsl
@@ -7,5 +7,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
var out = split_tone(c.rgb, vec3<f32>(-0.08, 0.0, 0.25), vec3<f32>(0.0), chill);
out = tint_midtones(out, vec3<f32>(0.0, 0.0, 0.1), chill);
out = s_curve(out, params.contrast / 100.0 * 0.7);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.cool-blue/fixtures.toml b/src/crates/concat-effects/packages/concat.cool-blue/fixtures.toml
index 1f7e180a..d1baf586 100644
--- a/src/crates/concat-effects/packages/concat.cool-blue/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.cool-blue/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "colorbalance=bs=0.150:rs=-0.048:bm=0.060,eq=contrast=1.105"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.31152, 0.20105, 0.13342, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "colorbalance=bs=0.000:rs=0.000:bm=0.000,eq=contrast=1.000"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44995, 0.3999, 0.3501, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "colorbalance=bs=0.250:rs=-0.080:bm=0.100,eq=contrast=1.350"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.0401, 0.04617, 0.15784, 1]
diff --git a/src/crates/concat-effects/packages/concat.cool/effect.toml b/src/crates/concat-effects/packages/concat.cool/effect.toml
index d387a97d..53354757 100644
--- a/src/crates/concat-effects/packages/concat.cool/effect.toml
+++ b/src/crates/concat-effects/packages/concat.cool/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.cool"
name = "Cool"
@@ -17,8 +19,6 @@ default = 8500
step = 50
unit = "K"
-[ffmpeg]
-chain = "colortemperature=temperature={round(temperature)}:pl=1"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.cool/effect.wgsl b/src/crates/concat-effects/packages/concat.cool/effect.wgsl
index ef620824..da773769 100644
--- a/src/crates/concat-effects/packages/concat.cool/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.cool/effect.wgsl
@@ -3,5 +3,5 @@ struct Params { temperature: f32 }
// White balance toward shade, brightness held.
fn effect(uv: vec2<f32>) -> vec4<f32> {
let c = sample(uv);
- return vec4<f32>(clamp01(white_balance(c.rgb, params.temperature)), c.a);
+ return vec4<f32>(white_balance(c.rgb, params.temperature), c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.cool/fixtures.toml b/src/crates/concat-effects/packages/concat.cool/fixtures.toml
index ce30ac4a..189d50ea 100644
--- a/src/crates/concat-effects/packages/concat.cool/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.cool/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "colortemperature=temperature=8500:pl=1"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.26367, 0.2002, 0.16687, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "colortemperature=temperature=7000:pl=1"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44312, 0.39526, 0.40723, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "colortemperature=temperature=11000:pl=1"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.06439, 0.07068, 0.0954, 1]
diff --git a/src/crates/concat-effects/packages/concat.cube/effect.toml b/src/crates/concat-effects/packages/concat.cube/effect.toml
index 851f6fd6..1f6371f3 100644
--- a/src/crates/concat-effects/packages/concat.cube/effect.toml
+++ b/src/crates/concat-effects/packages/concat.cube/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.cube"
name = "Cube"
diff --git a/src/crates/concat-effects/packages/concat.cube/effect.wgsl b/src/crates/concat-effects/packages/concat.cube/effect.wgsl
index 8a2f9c54..9929e68e 100644
--- a/src/crates/concat-effects/packages/concat.cube/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.cube/effect.wgsl
@@ -1,24 +1,31 @@
// A cheap fake of a rotating cube: each half of the cut squeezes its
// picture horizontally toward the shared edge and darkens it, the way a
// cube's face would foreshorten and fall into shadow as it turns away.
+// The shade was drawn on the display's scale; `shade` is that darkening
+// as a share of the light.
+fn shade(display: f32) -> f32 {
+ return pow(display, 2.4);
+}
+
fn transition(uv: vec2<f32>, progress: f32) -> vec4<f32> {
+ let gap = vec4<f32>(from_display(vec3<f32>(0.03)), 1.0);
let p = smoothstep(0.0, 1.0, progress);
if (p < 0.5) {
let t = p * 2.0;
let squeeze = cos(t * 1.5707963);
let cx = (uv.x - 0.5) / max(squeeze, 0.001) + 0.5;
if (cx < 0.0 || cx > 1.0) {
- return vec4<f32>(0.03, 0.03, 0.03, 1.0);
+ return gap;
}
let c = from_at(vec2<f32>(cx, uv.y));
- return vec4<f32>(c.rgb * mix(1.0, 0.35, t), c.a);
+ return vec4<f32>(c.rgb * shade(mix(1.0, 0.35, t)), c.a);
}
let t = (p - 0.5) * 2.0;
let squeeze = sin(t * 1.5707963);
let cx = (uv.x - 0.5) / max(squeeze, 0.001) + 0.5;
if (cx < 0.0 || cx > 1.0) {
- return vec4<f32>(0.03, 0.03, 0.03, 1.0);
+ return gap;
}
let c = to_at(vec2<f32>(cx, uv.y));
- return vec4<f32>(c.rgb * mix(0.35, 1.0, t), c.a);
+ return vec4<f32>(c.rgb * shade(mix(0.35, 1.0, t)), c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.cube/fixtures.toml b/src/crates/concat-effects/packages/concat.cube/fixtures.toml
new file mode 100644
index 00000000..6ee5b24a
--- /dev/null
+++ b/src/crates/concat-effects/packages/concat.cube/fixtures.toml
@@ -0,0 +1,9 @@
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. A cut from one colour to another, and its middle pixel.
+
+[[probe]]
+name = "default"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.23254, 0.14539, 0.08722, 1]
diff --git a/src/crates/concat-effects/packages/concat.cyberpunk/effect.toml b/src/crates/concat-effects/packages/concat.cyberpunk/effect.toml
index 12ffa1ab..8c845c70 100644
--- a/src/crates/concat-effects/packages/concat.cyberpunk/effect.toml
+++ b/src/crates/concat-effects/packages/concat.cyberpunk/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.cyberpunk"
name = "Cyberpunk"
@@ -6,8 +8,6 @@ category = "Cinematic"
order = 52
description = "Magenta into the shadows, cyan into the light, pushed hard and neon-bright."
-[ffmpeg]
-chain = "colorbalance=rs=0.08:bs=0.12:gs=-0.05:rh=-0.05:gh=0.06:bh=0.1,eq=contrast=1.15:saturation=1.15"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.cyberpunk/effect.wgsl b/src/crates/concat-effects/packages/concat.cyberpunk/effect.wgsl
index 5968f482..6e3f328e 100644
--- a/src/crates/concat-effects/packages/concat.cyberpunk/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.cyberpunk/effect.wgsl
@@ -1,5 +1,5 @@
fn effect(uv: vec2<f32>) -> vec4<f32> {
let c = sample(uv);
let t = split_tone(c.rgb, vec3<f32>(0.08, -0.02, 0.12), vec3<f32>(-0.05, 0.08, 0.1), 1.0);
- return vec4<f32>(clamp01(contrast(saturation(t, 1.15), 1.15)), c.a);
+ return vec4<f32>(contrast(saturation(t, 1.15), 1.15), c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.cyberpunk/fixtures.toml b/src/crates/concat-effects/packages/concat.cyberpunk/fixtures.toml
index 4b27228f..8997c3d9 100644
--- a/src/crates/concat-effects/packages/concat.cyberpunk/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.cyberpunk/fixtures.toml
@@ -1,3 +1,7 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "colorbalance=rs=0.08:bs=0.12:gs=-0.05:rh=-0.05:gh=0.06:bh=0.1,eq=contrast=1.15:saturation=1.15"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.33179, 0.20837, 0.112, 1]
diff --git a/src/crates/concat-effects/packages/concat.daydream/effect.toml b/src/crates/concat-effects/packages/concat.daydream/effect.toml
index b3871749..f5c44d96 100644
--- a/src/crates/concat-effects/packages/concat.daydream/effect.toml
+++ b/src/crates/concat-effects/packages/concat.daydream/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.daydream"
name = "Daydream"
@@ -25,8 +27,6 @@ default = 50
step = 1
unit = "%"
-[ffmpeg]
-chain = "curves=all='0/{fixed(haze / 100 * 0.08, 3)} 1/{fixed(1 - haze / 100 * 0.03, 3)}',eq=contrast={fixed(1 - haze / 100 * 0.12, 3)},colorbalance=rh={fixed(warmth / 100 * 0.08, 3)}:bh={fixed(0 - warmth / 100 * 0.05, 3)}:bs={fixed(warmth / 100 * 0.04, 3)},split[dreama{index}][dreamb{index}];[dreamb{index}]gblur=sigma=14[dreamg{index}];[dreama{index}][dreamg{index}]blend=all_mode=screen:all_opacity={fixed(haze / 100 * 0.3, 3)}"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.daydream/effect.wgsl b/src/crates/concat-effects/packages/concat.daydream/effect.wgsl
index caf20c8e..06dccd15 100644
--- a/src/crates/concat-effects/packages/concat.daydream/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.daydream/effect.wgsl
@@ -10,5 +10,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
out = contrast(out, 1.0 - haze * 0.12);
out = split_tone(out, vec3<f32>(0.0, 0.0, 0.04), vec3<f32>(0.08, 0.02, -0.05), w * keep);
out = halation(uv, out, 0.55, 14.0, vec3<f32>(1.0, 0.9, 0.75), haze * 0.5);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.daydream/fixtures.toml b/src/crates/concat-effects/packages/concat.daydream/fixtures.toml
index cdf2598e..1de89dd4 100644
--- a/src/crates/concat-effects/packages/concat.daydream/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.daydream/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "curves=all='0/0.040 1/0.985',eq=contrast=0.940,colorbalance=rh=0.040:bh=-0.025:bs=0.020,split[dreama0][dreamb0];[dreamb0]gblur=sigma=14[dreamg0];[dreama0][dreamg0]blend=all_mode=screen:all_opacity=0.150"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.30273, 0.21045, 0.13452, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "curves=all='0/0.000 1/1.000',eq=contrast=1.000,colorbalance=rh=0.000:bh=0.000:bs=0.000,split[dreama0][dreamb0];[dreamb0]gblur=sigma=14[dreamg0];[dreama0][dreamg0]blend=all_mode=screen:all_opacity=0.000"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44995, 0.3999, 0.3501, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "curves=all='0/0.080 1/0.970',eq=contrast=0.880,colorbalance=rh=0.080:bh=-0.050:bs=0.040,split[dreama0][dreamb0];[dreamb0]gblur=sigma=14[dreamg0];[dreama0][dreamg0]blend=all_mode=screen:all_opacity=0.300"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.11346, 0.1037, 0.10028, 1]
diff --git a/src/crates/concat-effects/packages/concat.delicious/effect.toml b/src/crates/concat-effects/packages/concat.delicious/effect.toml
index 86413604..cff113cf 100644
--- a/src/crates/concat-effects/packages/concat.delicious/effect.toml
+++ b/src/crates/concat-effects/packages/concat.delicious/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.delicious"
name = "Delicious"
@@ -6,8 +8,6 @@ category = "Food"
order = 54
description = "Warm and saturated, the appetising push every food shot wants."
-[ffmpeg]
-chain = "colortemperature=temperature=5200:pl=1,eq=saturation=1.3:contrast=1.1"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.delicious/effect.wgsl b/src/crates/concat-effects/packages/concat.delicious/effect.wgsl
index 1f0de76d..5eba9676 100644
--- a/src/crates/concat-effects/packages/concat.delicious/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.delicious/effect.wgsl
@@ -2,5 +2,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
let c = sample(uv);
let wb = white_balance(c.rgb, 5200.0);
let s = saturation(wb, 1.3);
- return vec4<f32>(clamp01(s_curve(s, 0.25)), c.a);
+ return vec4<f32>(s_curve(s, 0.25), c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.delicious/fixtures.toml b/src/crates/concat-effects/packages/concat.delicious/fixtures.toml
index 82859ed4..147c957f 100644
--- a/src/crates/concat-effects/packages/concat.delicious/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.delicious/fixtures.toml
@@ -1,3 +1,7 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "colortemperature=temperature=5200:pl=1,eq=saturation=1.3:contrast=1.1"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.44238, 0.18604, 0.06342, 1]
diff --git a/src/crates/concat-effects/packages/concat.digicam/effect.toml b/src/crates/concat-effects/packages/concat.digicam/effect.toml
index 33b9bb4c..0144f537 100644
--- a/src/crates/concat-effects/packages/concat.digicam/effect.toml
+++ b/src/crates/concat-effects/packages/concat.digicam/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.digicam"
name = "Digicam"
@@ -25,8 +27,6 @@ default = 40
step = 1
unit = "%"
-[ffmpeg]
-chain = "curves=all='0/0 0.6/{fixed(0.6 + flash / 100 * 0.15, 3)} 0.85/{fixed(0.85 + flash / 100 * 0.13, 3)} 1/1',eq=saturation={fixed(1 + flash / 100 * 0.3, 3)}:contrast={fixed(1 + flash / 100 * 0.15, 3)},colorbalance=bh={fixed(flash / 100 * 0.06, 3)}:gh={fixed(flash / 100 * 0.04, 3)},unsharp=5:5:{fixed(0.8 + flash / 100 * 0.8, 2)},noise=alls={round(noise / 100 * 22)}:allf=t"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.digicam/effect.wgsl b/src/crates/concat-effects/packages/concat.digicam/effect.wgsl
index 1f1c76ae..c1001a1c 100644
--- a/src/crates/concat-effects/packages/concat.digicam/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.digicam/effect.wgsl
@@ -10,5 +10,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
out = split_tone(out, vec3<f32>(0.0), vec3<f32>(-0.02, 0.04, 0.06), f);
out = out + (c.rgb - soften(uv, 2.0)) * (0.8 + f * 0.8);
out = out + grain_at(uv, params.noise / 100.0 * 0.14);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.digicam/fixtures.toml b/src/crates/concat-effects/packages/concat.digicam/fixtures.toml
index 09377854..17207edd 100644
--- a/src/crates/concat-effects/packages/concat.digicam/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.digicam/fixtures.toml
@@ -1,13 +1,20 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+# The grain at the middle pixel is format 2's: the same on every GPU.
+
+[[probe]]
name = "default"
-chain = "curves=all='0/0 0.6/0.690 0.85/0.928 1/1',eq=saturation=1.180:contrast=1.090,colorbalance=bh=0.036:gh=0.024,unsharp=5:5:1.28,noise=alls=9:allf=t"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.35645, 0.22302, 0.11841, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "curves=all='0/0 0.6/0.600 0.85/0.850 1/1',eq=saturation=1.000:contrast=1.000,colorbalance=bh=0.000:gh=0.000,unsharp=5:5:0.80,noise=alls=0:allf=t"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44995, 0.3999, 0.3501, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "curves=all='0/0 0.6/0.750 0.85/0.980 1/1',eq=saturation=1.300:contrast=1.150,colorbalance=bh=0.060:gh=0.040,unsharp=5:5:1.60,noise=alls=22:allf=t"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.06622, 0.05313, 0.04077, 1]
diff --git a/src/crates/concat-effects/packages/concat.dissolve/effect.toml b/src/crates/concat-effects/packages/concat.dissolve/effect.toml
index beb83025..5316b41b 100644
--- a/src/crates/concat-effects/packages/concat.dissolve/effect.toml
+++ b/src/crates/concat-effects/packages/concat.dissolve/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.dissolve"
name = "Dissolve"
diff --git a/src/crates/concat-effects/packages/concat.dissolve/fixtures.toml b/src/crates/concat-effects/packages/concat.dissolve/fixtures.toml
new file mode 100644
index 00000000..002f73cf
--- /dev/null
+++ b/src/crates/concat-effects/packages/concat.dissolve/fixtures.toml
@@ -0,0 +1,16 @@
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. A cut from one colour to another, and its middle pixel.
+
+[[probe]]
+name = "default"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.52197, 0.37036, 0.33691, 1]
+
+[[probe]]
+name = "halfway from white to black is half the light"
+input = [1, 1, 1, 1]
+to = [0, 0, 0, 1]
+progress = 0.5
+expect = [0.5, 0.5, 0.5, 1]
diff --git a/src/crates/concat-effects/packages/concat.dreamy/effect.toml b/src/crates/concat-effects/packages/concat.dreamy/effect.toml
index ddad0477..f6ddd8cd 100644
--- a/src/crates/concat-effects/packages/concat.dreamy/effect.toml
+++ b/src/crates/concat-effects/packages/concat.dreamy/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.dreamy"
name = "Dreamy"
@@ -6,8 +8,6 @@ category = "Vibe"
order = 66
description = "A soft, hazy bloom over lifted pastel blacks."
-[ffmpeg]
-chain = "curves=all='0/0.08 1/0.92',eq=saturation=0.9,gblur=sigma=0.6"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.dreamy/effect.wgsl b/src/crates/concat-effects/packages/concat.dreamy/effect.wgsl
index d2bb5f4e..45ab73c4 100644
--- a/src/crates/concat-effects/packages/concat.dreamy/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.dreamy/effect.wgsl
@@ -2,5 +2,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
let c = sample(uv);
let s = soften(uv, 3.0);
let f = fade(mix(c.rgb, s, 0.4), 0.08);
- return vec4<f32>(clamp01(saturation(f, 0.9)), c.a);
+ return vec4<f32>(saturation(f, 0.9), c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.dreamy/fixtures.toml b/src/crates/concat-effects/packages/concat.dreamy/fixtures.toml
index 3c758c18..e7cb27c0 100644
--- a/src/crates/concat-effects/packages/concat.dreamy/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.dreamy/fixtures.toml
@@ -1,3 +1,7 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "curves=all='0/0.08 1/0.92',eq=saturation=0.9,gblur=sigma=0.6"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.32935, 0.23975, 0.1637, 1]
diff --git a/src/crates/concat-effects/packages/concat.fair/effect.toml b/src/crates/concat-effects/packages/concat.fair/effect.toml
index 5f88e236..f0938bbc 100644
--- a/src/crates/concat-effects/packages/concat.fair/effect.toml
+++ b/src/crates/concat-effects/packages/concat.fair/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.fair"
name = "Fair"
@@ -25,8 +27,6 @@ default = 50
step = 1
unit = "%"
-[ffmpeg]
-chain = "selectivecolor=reds='0 {fixed(0 - even / 100 * 0.1, 3)} 0 {fixed(0 - brighten / 100 * 0.15, 3)}':yellows='0 0 {fixed(0 - even / 100 * 0.05, 3)} {fixed(0 - brighten / 100 * 0.1, 3)}',curves=all='0/0 0.5/{fixed(0.5 + brighten / 100 * 0.03, 3)} 1/1'"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.fair/effect.wgsl b/src/crates/concat-effects/packages/concat.fair/effect.wgsl
index 9bc854d3..a594fc60 100644
--- a/src/crates/concat-effects/packages/concat.fair/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.fair/effect.wgsl
@@ -7,5 +7,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
let e = params.even / 100.0;
var out = hsl_band(c.rgb, 20.0, 45.0, 4.0 * e, 1.0 - e * 0.15, 1.0 + b * 0.18);
out = lift_gamma_gain(out, vec3<f32>(0.0), vec3<f32>(1.0 + b * 0.08), vec3<f32>(1.0));
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.fair/fixtures.toml b/src/crates/concat-effects/packages/concat.fair/fixtures.toml
index 70ae03e5..a7eabb9b 100644
--- a/src/crates/concat-effects/packages/concat.fair/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.fair/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "selectivecolor=reds='0 -0.050 0 -0.075':yellows='0 0 -0.025 -0.050',curves=all='0/0 0.5/0.515 1/1'"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.36328, 0.24792, 0.16125, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "selectivecolor=reds='0 0.000 0 0.000':yellows='0 0 0.000 0.000',curves=all='0/0 0.5/0.500 1/1'"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44946, 0.39941, 0.34961, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "selectivecolor=reds='0 -0.100 0 -0.150':yellows='0 0 -0.050 -0.100',curves=all='0/0 0.5/0.530 1/1'"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.09894, 0.08746, 0.07605, 1]
diff --git a/src/crates/concat-effects/packages/concat.falling-dust/effect.toml b/src/crates/concat-effects/packages/concat.falling-dust/effect.toml
index fa39f5c3..8ced7a7d 100644
--- a/src/crates/concat-effects/packages/concat.falling-dust/effect.toml
+++ b/src/crates/concat-effects/packages/concat.falling-dust/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.falling-dust"
name = "Falling Dust"
@@ -25,8 +27,6 @@ default = 50
step = 1
unit = "%"
-[ffmpeg]
-chain = "colorbalance=rh={fixed(leak / 100 * 0.12, 3)}:bh={fixed(0 - leak / 100 * 0.08, 3)},curves=all='0/0.04 1/0.97',noise=alls={round(dust / 100 * 8)}:allf=t"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.falling-dust/effect.wgsl b/src/crates/concat-effects/packages/concat.falling-dust/effect.wgsl
index 91b14485..af8abaac 100644
--- a/src/crates/concat-effects/packages/concat.falling-dust/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.falling-dust/effect.wgsl
@@ -29,5 +29,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
glow += mote(uv, f32(k));
}
out = out + vec3<f32>(1.0, 0.95, 0.85) * min(glow, 1.0) * dust * 0.8;
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.falling-dust/fixtures.toml b/src/crates/concat-effects/packages/concat.falling-dust/fixtures.toml
index 3585f3a5..aa2468d6 100644
--- a/src/crates/concat-effects/packages/concat.falling-dust/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.falling-dust/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "colorbalance=rh=0.060:bh=-0.040,curves=all='0/0.04 1/0.97',noise=alls=5:allf=t"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.30811, 0.2074, 0.12537, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "colorbalance=rh=0.000:bh=0.000,curves=all='0/0.04 1/0.97',noise=alls=0:allf=t"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.43457, 0.38892, 0.34326, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "colorbalance=rh=0.120:bh=-0.080,curves=all='0/0.04 1/0.97',noise=alls=8:allf=t"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.09314, 0.08185, 0.07043, 1]
diff --git a/src/crates/concat-effects/packages/concat.film-burn/effect.toml b/src/crates/concat-effects/packages/concat.film-burn/effect.toml
index e2dd0ce3..89d9b095 100644
--- a/src/crates/concat-effects/packages/concat.film-burn/effect.toml
+++ b/src/crates/concat-effects/packages/concat.film-burn/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.film-burn"
name = "Film Burn"
diff --git a/src/crates/concat-effects/packages/concat.film-burn/effect.wgsl b/src/crates/concat-effects/packages/concat.film-burn/effect.wgsl
index 8951459a..a821026e 100644
--- a/src/crates/concat-effects/packages/concat.film-burn/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.film-burn/effect.wgsl
@@ -1,9 +1,19 @@
struct Params { heat: f32 }
-// A warm flash triangular in time, peaking at the middle of the cut.
+// Light added to `rgb` in the display encoding, up to white and no
+// further: a flash burns a picture white, and a highlight already brighter
+// than that is left as bright as it was.
+fn burn_to_white(rgb: vec3<f32>, flash: vec3<f32>) -> vec3<f32> {
+ let lit = to_display(rgb);
+ return from_display(min(lit + flash, max(lit, vec3<f32>(1.0))));
+}
+
+// A warm flash triangular in time, peaking at the middle of the cut: the
+// pictures dissolve in light, and the flash is laid on in the display
+// encoding it was drawn in, burning to white.
fn transition(uv: vec2<f32>, progress: f32) -> vec4<f32> {
let base = mix(from_at(uv), to_at(uv), progress);
let burn = smoothstep(0.0, 0.5, progress) * (1.0 - smoothstep(0.5, 1.0, progress)) * 4.0;
let warm = vec3<f32>(1.0, 0.85, 0.6) * burn * (params.heat * 0.01);
- return vec4<f32>(clamp01(base.rgb + warm), base.a);
+ return vec4<f32>(burn_to_white(base.rgb, warm), base.a);
}
diff --git a/src/crates/concat-effects/packages/concat.film-burn/fixtures.toml b/src/crates/concat-effects/packages/concat.film-burn/fixtures.toml
new file mode 100644
index 00000000..40e729ac
--- /dev/null
+++ b/src/crates/concat-effects/packages/concat.film-burn/fixtures.toml
@@ -0,0 +1,32 @@
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. A cut from one colour to another, and its middle pixel.
+
+[[probe]]
+name = "default"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [1, 1, 1, 1]
+
+[[probe]]
+name = "minimum"
+at = "min"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.52197, 0.37036, 0.33691, 1]
+
+[[probe]]
+name = "maximum"
+at = "max"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [1, 1, 1, 1]
+
+[[probe]]
+name = "a highlight brighter than white is left as bright as it was"
+input = [4, 4, 4, 1]
+to = [4, 4, 4, 1]
+progress = 0.37
+expect = [4, 4, 4, 1]
diff --git a/src/crates/concat-effects/packages/concat.film/effect.toml b/src/crates/concat-effects/packages/concat.film/effect.toml
index b843ae00..1cc275f1 100644
--- a/src/crates/concat-effects/packages/concat.film/effect.toml
+++ b/src/crates/concat-effects/packages/concat.film/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.film"
name = "Film"
@@ -25,8 +27,6 @@ default = 50
step = 1
unit = "%"
-[ffmpeg]
-chain = "curves=all='0/0.03 0.25/0.22 0.75/0.8 1/0.97',colorbalance=rm={fixed(warmth / 100 * 0.06, 3)}:bm={fixed(0 - warmth / 100 * 0.06, 3)},split[filma{index}][filmb{index}];[filmb{index}]gblur=sigma=8[filmg{index}];[filma{index}][filmg{index}]blend=all_mode=screen:all_opacity={fixed(0.12 + warmth / 100 * 0.08, 3)},noise=alls={round(grain / 100 * 30)}:allf=t"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.film/effect.wgsl b/src/crates/concat-effects/packages/concat.film/effect.wgsl
index b2bf3e14..e754a75c 100644
--- a/src/crates/concat-effects/packages/concat.film/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.film/effect.wgsl
@@ -8,5 +8,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
out = tint_midtones(out, vec3<f32>(0.06, 0.0, -0.06), w);
out = halation(uv, out, 0.7, 8.0, vec3<f32>(1.0, 0.6, 0.3), 0.15 + w * 0.1);
out = out + grain_at(uv, params.grain / 100.0 * 0.12);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.film/fixtures.toml b/src/crates/concat-effects/packages/concat.film/fixtures.toml
index 35ef662b..0c6ee3c6 100644
--- a/src/crates/concat-effects/packages/concat.film/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.film/fixtures.toml
@@ -1,13 +1,20 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+# The grain at the middle pixel is format 2's: the same on every GPU.
+
+[[probe]]
name = "default"
-chain = "curves=all='0/0.03 0.25/0.22 0.75/0.8 1/0.97',colorbalance=rm=0.030:bm=-0.030,split[filma0][filmb0];[filmb0]gblur=sigma=8[filmg0];[filma0][filmg0]blend=all_mode=screen:all_opacity=0.160,noise=alls=12:allf=t"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.35327, 0.18884, 0.0788, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "curves=all='0/0.03 0.25/0.22 0.75/0.8 1/0.97',colorbalance=rm=0.000:bm=0.000,split[filma0][filmb0];[filmb0]gblur=sigma=8[filmg0];[filma0][filmg0]blend=all_mode=screen:all_opacity=0.120,noise=alls=0:allf=t"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.50928, 0.44849, 0.3855, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "curves=all='0/0.03 0.25/0.22 0.75/0.8 1/0.97',colorbalance=rm=0.060:bm=-0.060,split[filma0][filmb0];[filmb0]gblur=sigma=8[filmg0];[filma0][filmg0]blend=all_mode=screen:all_opacity=0.200,noise=alls=30:allf=t"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.0694, 0.04459, 0.02556, 1]
diff --git a/src/crates/concat-effects/packages/concat.fresh/effect.toml b/src/crates/concat-effects/packages/concat.fresh/effect.toml
index 287ff907..9962533f 100644
--- a/src/crates/concat-effects/packages/concat.fresh/effect.toml
+++ b/src/crates/concat-effects/packages/concat.fresh/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.fresh"
name = "Fresh"
@@ -25,8 +27,6 @@ default = 40
step = 1
unit = "%"
-[ffmpeg]
-chain = "curves=all='0/0 0.5/{fixed(0.5 + brightness / 100 * 0.08, 3)} 1/1',vibrance=intensity={fixed(pop / 100 * 0.9, 3)},colorbalance=gh={fixed(pop / 100 * 0.05, 3)}:bh={fixed(pop / 100 * 0.03, 3)}"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.fresh/effect.wgsl b/src/crates/concat-effects/packages/concat.fresh/effect.wgsl
index 8320cd74..9f1a3037 100644
--- a/src/crates/concat-effects/packages/concat.fresh/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.fresh/effect.wgsl
@@ -8,5 +8,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
var out = lift_gamma_gain(c.rgb, vec3<f32>(0.0), vec3<f32>(1.0 + params.brightness / 100.0 * 0.25), vec3<f32>(1.0));
out = vibrance(out, pop * 0.9);
out = split_tone(out, vec3<f32>(0.0), vec3<f32>(0.0, 0.05, 0.03), pop);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.fresh/fixtures.toml b/src/crates/concat-effects/packages/concat.fresh/fixtures.toml
index b18d13fc..6fab21bb 100644
--- a/src/crates/concat-effects/packages/concat.fresh/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.fresh/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "curves=all='0/0 0.5/0.532 1/1',vibrance=intensity=0.450,colorbalance=gh=0.025:bh=0.015"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.37207, 0.23108, 0.11829, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "curves=all='0/0 0.5/0.500 1/1',vibrance=intensity=0.000,colorbalance=gh=0.000:bh=0.000"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44995, 0.3999, 0.3501, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "curves=all='0/0 0.5/0.580 1/1',vibrance=intensity=0.900,colorbalance=gh=0.050:bh=0.030"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.14319, 0.11768, 0.09283, 1]
diff --git a/src/crates/concat-effects/packages/concat.glitch-transition/effect.toml b/src/crates/concat-effects/packages/concat.glitch-transition/effect.toml
index 12e916ab..a2210c09 100644
--- a/src/crates/concat-effects/packages/concat.glitch-transition/effect.toml
+++ b/src/crates/concat-effects/packages/concat.glitch-transition/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.glitch-transition"
name = "Glitch"
diff --git a/src/crates/concat-effects/packages/concat.glitch-transition/fixtures.toml b/src/crates/concat-effects/packages/concat.glitch-transition/fixtures.toml
new file mode 100644
index 00000000..281947ca
--- /dev/null
+++ b/src/crates/concat-effects/packages/concat.glitch-transition/fixtures.toml
@@ -0,0 +1,25 @@
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. A cut from one colour to another, and its middle pixel.
+
+[[probe]]
+name = "default"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.56738, 0.3916, 0.33081, 1]
+
+[[probe]]
+name = "minimum"
+at = "min"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.56738, 0.3916, 0.33081, 1]
+
+[[probe]]
+name = "maximum"
+at = "max"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.56738, 0.3916, 0.33081, 1]
diff --git a/src/crates/concat-effects/packages/concat.glitch-warp/effect.toml b/src/crates/concat-effects/packages/concat.glitch-warp/effect.toml
index 2bb64c22..23041159 100644
--- a/src/crates/concat-effects/packages/concat.glitch-warp/effect.toml
+++ b/src/crates/concat-effects/packages/concat.glitch-warp/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.glitch-warp"
name = "Glitch Warp"
diff --git a/src/crates/concat-effects/packages/concat.glitch-warp/fixtures.toml b/src/crates/concat-effects/packages/concat.glitch-warp/fixtures.toml
new file mode 100644
index 00000000..0ebb7187
--- /dev/null
+++ b/src/crates/concat-effects/packages/concat.glitch-warp/fixtures.toml
@@ -0,0 +1,25 @@
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. A cut from one colour to another, and its middle pixel.
+
+[[probe]]
+name = "default"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.52197, 0.37036, 0.33691, 1]
+
+[[probe]]
+name = "minimum"
+at = "min"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.52197, 0.37036, 0.33691, 1]
+
+[[probe]]
+name = "maximum"
+at = "max"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.52197, 0.37036, 0.33691, 1]
diff --git a/src/crates/concat-effects/packages/concat.golden-hour/effect.toml b/src/crates/concat-effects/packages/concat.golden-hour/effect.toml
index 82e1849d..4a4aefc5 100644
--- a/src/crates/concat-effects/packages/concat.golden-hour/effect.toml
+++ b/src/crates/concat-effects/packages/concat.golden-hour/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.golden-hour"
name = "Golden Hour"
@@ -25,8 +27,6 @@ default = 4600
step = 50
unit = "K"
-[ffmpeg]
-chain = "colortemperature=temperature={round(warmth)}:pl=1,colorbalance=rh={fixed(glow / 100 * 0.14, 3)}:gh={fixed(glow / 100 * 0.05, 3)}:rs={fixed(glow / 100 * 0.05, 3)}:bs={fixed(glow / 100 * 0.04, 3)},curves=all='0/{fixed(glow / 100 * 0.04, 3)} 1/1'"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.golden-hour/effect.wgsl b/src/crates/concat-effects/packages/concat.golden-hour/effect.wgsl
index e4906315..1f4cd8c9 100644
--- a/src/crates/concat-effects/packages/concat.golden-hour/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.golden-hour/effect.wgsl
@@ -7,5 +7,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
var out = white_balance(c.rgb, params.warmth);
out = split_tone(out, vec3<f32>(0.05, 0.0, 0.04), vec3<f32>(0.14, 0.05, 0.0), glow);
out = matte(out, glow * 0.04, 1.0);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.golden-hour/fixtures.toml b/src/crates/concat-effects/packages/concat.golden-hour/fixtures.toml
index 4091680a..ce1a74e5 100644
--- a/src/crates/concat-effects/packages/concat.golden-hour/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.golden-hour/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "colortemperature=temperature=4600:pl=1,colorbalance=rh=0.070:gh=0.025:rs=0.025:bs=0.020,curves=all='0/0.020 1/1'"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.42261, 0.20032, 0.09229, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "colortemperature=temperature=3500:pl=1,colorbalance=rh=0.000:gh=0.000:rs=0.000:bs=0.000,curves=all='0/0.000 1/1'"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.77979, 0.35596, 0.15295, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "colortemperature=temperature=6500:pl=1,colorbalance=rh=0.140:gh=0.050:rs=0.050:bs=0.040,curves=all='0/0.040 1/1'"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.10773, 0.08441, 0.08234, 1]
diff --git a/src/crates/concat-effects/packages/concat.high-contrast-mono/effect.toml b/src/crates/concat-effects/packages/concat.high-contrast-mono/effect.toml
index a1e37a58..208c6392 100644
--- a/src/crates/concat-effects/packages/concat.high-contrast-mono/effect.toml
+++ b/src/crates/concat-effects/packages/concat.high-contrast-mono/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.high-contrast-mono"
name = "High-Contrast Mono"
@@ -6,8 +8,6 @@ category = "Black & White"
order = 64
description = "Black and white pushed hard: deep blacks, bright whites, nothing in between."
-[ffmpeg]
-chain = "hue=s=0,eq=contrast=1.6:brightness=-0.03"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.high-contrast-mono/effect.wgsl b/src/crates/concat-effects/packages/concat.high-contrast-mono/effect.wgsl
index 4d8c1ca8..9042ff5a 100644
--- a/src/crates/concat-effects/packages/concat.high-contrast-mono/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.high-contrast-mono/effect.wgsl
@@ -1,5 +1,5 @@
fn effect(uv: vec2<f32>) -> vec4<f32> {
let c = sample(uv);
let g = mono(c.rgb, vec3<f32>(0.33));
- return vec4<f32>(clamp01(contrast(g, 1.6) - vec3<f32>(0.03)), c.a);
+ return vec4<f32>(contrast(g, 1.6) - vec3<f32>(0.03), c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.high-contrast-mono/fixtures.toml b/src/crates/concat-effects/packages/concat.high-contrast-mono/fixtures.toml
index 3973c3d8..4bb89d5d 100644
--- a/src/crates/concat-effects/packages/concat.high-contrast-mono/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.high-contrast-mono/fixtures.toml
@@ -1,3 +1,7 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "hue=s=0,eq=contrast=1.6:brightness=-0.03"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.177, 0.177, 0.177, 1]
diff --git a/src/crates/concat-effects/packages/concat.iris/effect.toml b/src/crates/concat-effects/packages/concat.iris/effect.toml
index 8dc39ead..ad3e0e11 100644
--- a/src/crates/concat-effects/packages/concat.iris/effect.toml
+++ b/src/crates/concat-effects/packages/concat.iris/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.iris"
name = "Iris"
diff --git a/src/crates/concat-effects/packages/concat.iris/fixtures.toml b/src/crates/concat-effects/packages/concat.iris/fixtures.toml
new file mode 100644
index 00000000..983483bd
--- /dev/null
+++ b/src/crates/concat-effects/packages/concat.iris/fixtures.toml
@@ -0,0 +1,25 @@
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. A cut from one colour to another, and its middle pixel.
+
+[[probe]]
+name = "default"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.04999, 0.15002, 0.3999, 1]
+
+[[probe]]
+name = "minimum"
+at = "min"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.04999, 0.15002, 0.3999, 1]
+
+[[probe]]
+name = "maximum"
+at = "max"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.29736, 0.26538, 0.36694, 1]
diff --git a/src/crates/concat-effects/packages/concat.ivory/effect.toml b/src/crates/concat-effects/packages/concat.ivory/effect.toml
index 4a2905a3..4aaa06d9 100644
--- a/src/crates/concat-effects/packages/concat.ivory/effect.toml
+++ b/src/crates/concat-effects/packages/concat.ivory/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.ivory"
name = "Ivory"
@@ -25,8 +27,6 @@ default = 50
step = 1
unit = "%"
-[ffmpeg]
-chain = "curves=all='0/{fixed(matte / 100 * 0.12, 3)} 0.5/{fixed(0.5 + matte / 100 * 0.06, 3)} 1/{fixed(1 - matte / 100 * 0.04, 3)}',eq=saturation={fixed(1 - matte / 100 * 0.18, 3)},colorbalance=rh={fixed(warmth / 100 * 0.08, 3)}:gh={fixed(warmth / 100 * 0.03, 3)}:bh={fixed(0 - warmth / 100 * 0.06, 3)}:rm={fixed(warmth / 100 * 0.04, 3)}:bm={fixed(0 - warmth / 100 * 0.04, 3)}"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.ivory/effect.wgsl b/src/crates/concat-effects/packages/concat.ivory/effect.wgsl
index 1cb755b7..b5ddc7e7 100644
--- a/src/crates/concat-effects/packages/concat.ivory/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.ivory/effect.wgsl
@@ -10,5 +10,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
out = saturation(out, 1.0 - m * 0.18);
out = split_tone(out, vec3<f32>(0.0), vec3<f32>(0.08, 0.03, -0.06), w);
out = tint_midtones(out, vec3<f32>(0.04, 0.0, -0.04), w);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.ivory/fixtures.toml b/src/crates/concat-effects/packages/concat.ivory/fixtures.toml
index 62839511..6835b395 100644
--- a/src/crates/concat-effects/packages/concat.ivory/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.ivory/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "curves=all='0/0.072 0.5/0.536 1/0.976',eq=saturation=0.892,colorbalance=rh=0.040:gh=0.015:bh=-0.030:rm=0.020:bm=-0.020"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.37476, 0.25928, 0.16052, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "curves=all='0/0.000 0.5/0.500 1/1.000',eq=saturation=1.000,colorbalance=rh=0.000:gh=0.000:bh=0.000:rm=0.000:bm=0.000"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44995, 0.3999, 0.3501, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "curves=all='0/0.120 0.5/0.560 1/0.960',eq=saturation=0.820,colorbalance=rh=0.080:gh=0.030:bh=-0.060:rm=0.040:bm=-0.040"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.18896, 0.14661, 0.10907, 1]
diff --git a/src/crates/concat-effects/packages/concat.lagoon/effect.toml b/src/crates/concat-effects/packages/concat.lagoon/effect.toml
index 845054bf..1af2d703 100644
--- a/src/crates/concat-effects/packages/concat.lagoon/effect.toml
+++ b/src/crates/concat-effects/packages/concat.lagoon/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.lagoon"
name = "Lagoon"
@@ -25,8 +27,6 @@ default = 40
step = 1
unit = "%"
-[ffmpeg]
-chain = "selectivecolor=blues='{fixed(water / 100 * 0.3, 3)} {fixed(0 - water / 100 * 0.2, 3)} 0 {fixed(0 - water / 100 * 0.15, 3)}':cyans='{fixed(water / 100 * 0.35, 3)} {fixed(0 - water / 100 * 0.1, 3)} 0 {fixed(0 - water / 100 * 0.1, 3)}',curves=all='0/0 0.5/{fixed(0.5 + brightness / 100 * 0.06, 3)} 1/1',eq=saturation={fixed(1 + water / 100 * 0.12, 3)}"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.lagoon/effect.wgsl b/src/crates/concat-effects/packages/concat.lagoon/effect.wgsl
index 5750c824..5b868c06 100644
--- a/src/crates/concat-effects/packages/concat.lagoon/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.lagoon/effect.wgsl
@@ -8,5 +8,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
out = hsl_band(out, 225.0, 60.0, -25.0 * water, 1.0 + water * 0.4, 1.0 + water * 0.12);
out = hsl_band(out, 185.0, 50.0, 0.0, 1.0 + water * 0.5, 1.0 + water * 0.08);
out = saturation(out, 1.0 + water * 0.06);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.lagoon/fixtures.toml b/src/crates/concat-effects/packages/concat.lagoon/fixtures.toml
index 6fe3b822..a86012f0 100644
--- a/src/crates/concat-effects/packages/concat.lagoon/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.lagoon/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "selectivecolor=blues='0.180 -0.120 0 -0.090':cyans='0.210 -0.060 0 -0.060',curves=all='0/0 0.5/0.524 1/1',eq=saturation=1.072"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.33154, 0.22473, 0.13733, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "selectivecolor=blues='0.000 0.000 0 0.000':cyans='0.000 0.000 0 0.000',curves=all='0/0 0.5/0.500 1/1',eq=saturation=1.000"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44995, 0.3999, 0.3501, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "selectivecolor=blues='0.300 -0.200 0 -0.150':cyans='0.350 -0.100 0 -0.100',curves=all='0/0 0.5/0.560 1/1',eq=saturation=1.120"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.12256, 0.10895, 0.09503, 1]
diff --git a/src/crates/concat-effects/packages/concat.landscape-pop/effect.toml b/src/crates/concat-effects/packages/concat.landscape-pop/effect.toml
index 83e90ae1..4e268a11 100644
--- a/src/crates/concat-effects/packages/concat.landscape-pop/effect.toml
+++ b/src/crates/concat-effects/packages/concat.landscape-pop/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.landscape-pop"
name = "Vivid Landscape"
@@ -6,8 +8,6 @@ category = "Scenery"
order = 57
description = "Greens and blues pushed richer, the punch a travel shot wants."
-[ffmpeg]
-chain = "selectivecolor=greens='0 0 0.15 0':cyans='0.1 0 0 0',eq=contrast=1.12:saturation=1.15"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.landscape-pop/effect.wgsl b/src/crates/concat-effects/packages/concat.landscape-pop/effect.wgsl
index 760b4cbd..5583b20e 100644
--- a/src/crates/concat-effects/packages/concat.landscape-pop/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.landscape-pop/effect.wgsl
@@ -2,5 +2,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
let c = sample(uv);
let g = hsl_band(c.rgb, 120.0, 60.0, 0.0, 1.35, 1.05);
let b = hsl_band(g, 210.0, 50.0, 0.0, 1.25, 1.0);
- return vec4<f32>(clamp01(contrast(b, 1.12)), c.a);
+ return vec4<f32>(contrast(b, 1.12), c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.landscape-pop/fixtures.toml b/src/crates/concat-effects/packages/concat.landscape-pop/fixtures.toml
index e6423951..d45b91bc 100644
--- a/src/crates/concat-effects/packages/concat.landscape-pop/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.landscape-pop/fixtures.toml
@@ -1,3 +1,7 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "selectivecolor=greens='0 0 0.15 0':cyans='0.1 0 0 0',eq=contrast=1.12:saturation=1.15"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.31519, 0.20117, 0.11285, 1]
diff --git a/src/crates/concat-effects/packages/concat.light-leak-flash/effect.toml b/src/crates/concat-effects/packages/concat.light-leak-flash/effect.toml
index 26b579f3..1db19694 100644
--- a/src/crates/concat-effects/packages/concat.light-leak-flash/effect.toml
+++ b/src/crates/concat-effects/packages/concat.light-leak-flash/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.light-leak-flash"
name = "Light Leak Flash"
diff --git a/src/crates/concat-effects/packages/concat.light-leak-flash/effect.wgsl b/src/crates/concat-effects/packages/concat.light-leak-flash/effect.wgsl
index 59c85432..39aaf8fe 100644
--- a/src/crates/concat-effects/packages/concat.light-leak-flash/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.light-leak-flash/effect.wgsl
@@ -1,5 +1,15 @@
struct Params { strength: f32 }
+// Light added to `rgb` in the display encoding, up to white and no
+// further: a flash burns a picture white, and a highlight already brighter
+// than that is left as bright as it was.
+fn burn_to_white(rgb: vec3<f32>, flash: vec3<f32>) -> vec3<f32> {
+ let lit = to_display(rgb);
+ return from_display(min(lit + flash, max(lit, vec3<f32>(1.0))));
+}
+
+// A warm flash that sweeps across as the pictures dissolve in light, laid
+// on in the display encoding it was drawn in and burning to white.
fn transition(uv: vec2<f32>, progress: f32) -> vec4<f32> {
let base = mix(from_at(uv), to_at(uv), progress);
let flash_curve = 1.0 - abs(progress * 2.0 - 1.0);
@@ -7,5 +17,5 @@ fn transition(uv: vec2<f32>, progress: f32) -> vec4<f32> {
let leak = exp(-pow(leak_pos - progress, 2.0) * 12.0);
let burn = (flash_curve * 0.8 + leak * 0.5) * (params.strength * 0.01);
let warm_flash = vec3<f32>(1.0, 0.85, 0.6) * burn;
- return vec4<f32>(clamp01(base.rgb + warm_flash), base.a);
+ return vec4<f32>(burn_to_white(base.rgb, warm_flash), base.a);
}
diff --git a/src/crates/concat-effects/packages/concat.light-leak-flash/fixtures.toml b/src/crates/concat-effects/packages/concat.light-leak-flash/fixtures.toml
new file mode 100644
index 00000000..47c04413
--- /dev/null
+++ b/src/crates/concat-effects/packages/concat.light-leak-flash/fixtures.toml
@@ -0,0 +1,25 @@
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. A cut from one colour to another, and its middle pixel.
+
+[[probe]]
+name = "default"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [1, 1, 1, 1]
+
+[[probe]]
+name = "minimum"
+at = "min"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.52197, 0.37036, 0.33691, 1]
+
+[[probe]]
+name = "maximum"
+at = "max"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [1, 1, 1, 1]
diff --git a/src/crates/concat-effects/packages/concat.light-leak-transition/effect.toml b/src/crates/concat-effects/packages/concat.light-leak-transition/effect.toml
index bfe2eddf..9aeb3b91 100644
--- a/src/crates/concat-effects/packages/concat.light-leak-transition/effect.toml
+++ b/src/crates/concat-effects/packages/concat.light-leak-transition/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.light-leak-transition"
name = "Light Leak"
diff --git a/src/crates/concat-effects/packages/concat.light-leak-transition/effect.wgsl b/src/crates/concat-effects/packages/concat.light-leak-transition/effect.wgsl
index 7c218bb0..4a9de5c5 100644
--- a/src/crates/concat-effects/packages/concat.light-leak-transition/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.light-leak-transition/effect.wgsl
@@ -1,8 +1,17 @@
struct Params { warmth: f32 }
+// Light added to `rgb` in the display encoding, up to white and no
+// further: a flash burns a picture white, and a highlight already brighter
+// than that is left as bright as it was.
+fn burn_to_white(rgb: vec3<f32>, flash: vec3<f32>) -> vec3<f32> {
+ let lit = to_display(rgb);
+ return from_display(min(lit + flash, max(lit, vec3<f32>(1.0))));
+}
+
// A bright near-white core inside a wider warm halo, rather than one flat
// tint - the hot centre a real light leak burns and the softer colour
-// bleed around it.
+// bleed around it. The pictures dissolve in light; the leak is laid on in
+// the display encoding it was drawn in, burning to white.
fn transition(uv: vec2<f32>, progress: f32) -> vec4<f32> {
let p = smoothstep(0.0, 1.0, progress);
let base = mix(from_at(uv), to_at(uv), p);
@@ -13,5 +22,5 @@ fn transition(uv: vec2<f32>, progress: f32) -> vec4<f32> {
let hot = vec3<f32>(1.0, 0.95, 0.85);
let warm = vec3<f32>(1.0, 0.8, 0.5);
let leak = hot * core * k * 1.3 + warm * halo * k;
- return vec4<f32>(clamp01(base.rgb + leak), base.a);
+ return vec4<f32>(burn_to_white(base.rgb, leak), base.a);
}
diff --git a/src/crates/concat-effects/packages/concat.light-leak-transition/fixtures.toml b/src/crates/concat-effects/packages/concat.light-leak-transition/fixtures.toml
new file mode 100644
index 00000000..8b2846e1
--- /dev/null
+++ b/src/crates/concat-effects/packages/concat.light-leak-transition/fixtures.toml
@@ -0,0 +1,25 @@
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. A cut from one colour to another, and its middle pixel.
+
+[[probe]]
+name = "default"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.62646, 0.42969, 0.35229, 1]
+
+[[probe]]
+name = "minimum"
+at = "min"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.56738, 0.3916, 0.33081, 1]
+
+[[probe]]
+name = "maximum"
+at = "max"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.65283, 0.44653, 0.36157, 1]
diff --git a/src/crates/concat-effects/packages/concat.linear-wipe/effect.toml b/src/crates/concat-effects/packages/concat.linear-wipe/effect.toml
index 6f8a0f9a..5703280a 100644
--- a/src/crates/concat-effects/packages/concat.linear-wipe/effect.toml
+++ b/src/crates/concat-effects/packages/concat.linear-wipe/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.linear-wipe"
name = "Linear Wipe"
diff --git a/src/crates/concat-effects/packages/concat.linear-wipe/fixtures.toml b/src/crates/concat-effects/packages/concat.linear-wipe/fixtures.toml
new file mode 100644
index 00000000..569bb337
--- /dev/null
+++ b/src/crates/concat-effects/packages/concat.linear-wipe/fixtures.toml
@@ -0,0 +1,25 @@
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. A cut from one colour to another, and its middle pixel.
+
+[[probe]]
+name = "default"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.7998, 0.5, 0.30005, 1]
+
+[[probe]]
+name = "minimum"
+at = "min"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.7998, 0.5, 0.30005, 1]
+
+[[probe]]
+name = "maximum"
+at = "max"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.78662, 0.4939, 0.30176, 1]
diff --git a/src/crates/concat-effects/packages/concat.marquee/effect.toml b/src/crates/concat-effects/packages/concat.marquee/effect.toml
index d4a326f2..7e41d830 100644
--- a/src/crates/concat-effects/packages/concat.marquee/effect.toml
+++ b/src/crates/concat-effects/packages/concat.marquee/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.marquee"
name = "Marquee"
@@ -25,8 +27,6 @@ default = 40
step = 1
unit = "%"
-[ffmpeg]
-chain = "curves=all='0/0 0.2/{fixed(0.2 - depth / 100 * 0.08, 3)} 1/1',colorbalance=bs={fixed(depth / 100 * 0.1, 3)},eq=saturation={fixed(1 + lights / 100 * 0.35, 3)},split[marqa{index}][marqb{index}];[marqb{index}]gblur=sigma=8[marqg{index}];[marqa{index}][marqg{index}]blend=all_mode=screen:all_opacity={fixed(lights / 100 * 0.3, 3)}"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.marquee/effect.wgsl b/src/crates/concat-effects/packages/concat.marquee/effect.wgsl
index 7db8ffd4..bc7658b9 100644
--- a/src/crates/concat-effects/packages/concat.marquee/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.marquee/effect.wgsl
@@ -10,5 +10,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
let lit = highlights(c.rgb) * smoothstep(0.15, 0.5, chroma_of(c.rgb)) * (1.0 - skin_mask(c.rgb));
out = mix(out, saturation(out, 1.6), lit * l);
out = halation(uv, out, 0.7, 8.0, vec3<f32>(1.0), l * 0.5);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.marquee/fixtures.toml b/src/crates/concat-effects/packages/concat.marquee/fixtures.toml
index 466eafd9..169638ad 100644
--- a/src/crates/concat-effects/packages/concat.marquee/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.marquee/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "curves=all='0/0 0.2/0.168 1/1',colorbalance=bs=0.040,eq=saturation=1.210,split[marqa0][marqb0];[marqb0]gblur=sigma=8[marqg0];[marqa0][marqg0]blend=all_mode=screen:all_opacity=0.180"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.26538, 0.16516, 0.0929, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "curves=all='0/0 0.2/0.200 1/1',colorbalance=bs=0.000,eq=saturation=1.000,split[marqa0][marqb0];[marqb0]gblur=sigma=8[marqg0];[marqa0][marqg0]blend=all_mode=screen:all_opacity=0.000"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44995, 0.3999, 0.3501, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "curves=all='0/0 0.2/0.120 1/1',colorbalance=bs=0.100,eq=saturation=1.350,split[marqa0][marqb0];[marqb0]gblur=sigma=8[marqg0];[marqa0][marqg0]blend=all_mode=screen:all_opacity=0.300"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.02963, 0.02408, 0.04031, 1]
diff --git a/src/crates/concat-effects/packages/concat.matcha/effect.toml b/src/crates/concat-effects/packages/concat.matcha/effect.toml
index b14d10ba..f5279147 100644
--- a/src/crates/concat-effects/packages/concat.matcha/effect.toml
+++ b/src/crates/concat-effects/packages/concat.matcha/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.matcha"
name = "Matcha"
@@ -16,8 +18,6 @@ default = 60
step = 1
unit = "%"
-[ffmpeg]
-chain = "curves=all='0/{fixed(amount / 100 * 0.06, 3)} 1/{fixed(1 - amount / 100 * 0.03, 3)}',eq=saturation={fixed(1 - amount / 100 * 0.25, 3)},colorbalance=gm={fixed(amount / 100 * 0.08, 3)}:rm={fixed(0 - amount / 100 * 0.03, 3)}:gh={fixed(amount / 100 * 0.06, 3)}:bh={fixed(0 - amount / 100 * 0.03, 3)}"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.matcha/effect.wgsl b/src/crates/concat-effects/packages/concat.matcha/effect.wgsl
index 94e4183f..12b5c8b0 100644
--- a/src/crates/concat-effects/packages/concat.matcha/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.matcha/effect.wgsl
@@ -9,5 +9,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
out = saturation(out, 1.0 - a * 0.25);
out = tint_midtones(out, vec3<f32>(-0.03, 0.08, 0.0), a * keep);
out = split_tone(out, vec3<f32>(0.0), vec3<f32>(0.0, 0.06, -0.03), a);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.matcha/fixtures.toml b/src/crates/concat-effects/packages/concat.matcha/fixtures.toml
index f2d8d646..d92497ba 100644
--- a/src/crates/concat-effects/packages/concat.matcha/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.matcha/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "curves=all='0/0.036 1/0.982',eq=saturation=0.850,colorbalance=gm=0.048:rm=-0.018:gh=0.036:bh=-0.018"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.2793, 0.24084, 0.1394, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "curves=all='0/0.000 1/1.000',eq=saturation=1.000,colorbalance=gm=0.000:rm=0.000:gh=0.000:bh=0.000"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44995, 0.3999, 0.3501, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "curves=all='0/0.060 1/0.970',eq=saturation=0.750,colorbalance=gm=0.080:rm=-0.030:gh=0.060:bh=-0.030"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.08209, 0.12268, 0.07886, 1]
diff --git a/src/crates/concat-effects/packages/concat.midnight/effect.toml b/src/crates/concat-effects/packages/concat.midnight/effect.toml
index 5e430f5e..4a33f702 100644
--- a/src/crates/concat-effects/packages/concat.midnight/effect.toml
+++ b/src/crates/concat-effects/packages/concat.midnight/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.midnight"
name = "Midnight"
@@ -25,8 +27,6 @@ default = 25
step = 1
unit = "%"
-[ffmpeg]
-chain = "curves=all='0/0 0.2/{fixed(0.2 - depth / 100 * 0.1, 3)} 1/1',eq=saturation={fixed(1 - depth / 100 * 0.35, 3)},colorbalance=bs={fixed(depth / 100 * 0.12, 3)}:bm={fixed(depth / 100 * 0.08, 3)}:rs={fixed(0 - depth / 100 * 0.05, 3)},noise=alls={round(grain / 100 * 20)}:allf=t"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.midnight/effect.wgsl b/src/crates/concat-effects/packages/concat.midnight/effect.wgsl
index e1279d74..816af918 100644
--- a/src/crates/concat-effects/packages/concat.midnight/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.midnight/effect.wgsl
@@ -9,5 +9,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
out = split_tone(out, vec3<f32>(-0.05, 0.0, 0.12), vec3<f32>(0.0), d);
out = tint_midtones(out, vec3<f32>(0.0, 0.0, 0.08), d);
out = out + grain_at(uv, params.grain / 100.0 * 0.1);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.midnight/fixtures.toml b/src/crates/concat-effects/packages/concat.midnight/fixtures.toml
index e8ec38c7..51603b6d 100644
--- a/src/crates/concat-effects/packages/concat.midnight/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.midnight/fixtures.toml
@@ -1,13 +1,20 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+# The grain at the middle pixel is format 2's: the same on every GPU.
+
+[[probe]]
name = "default"
-chain = "curves=all='0/0 0.2/0.140 1/1',eq=saturation=0.790,colorbalance=bs=0.072:bm=0.048:rs=-0.030,noise=alls=5:allf=t"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.21082, 0.13916, 0.1156, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "curves=all='0/0 0.2/0.200 1/1',eq=saturation=1.000,colorbalance=bs=0.000:bm=0.000:rs=0.000,noise=alls=0:allf=t"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44995, 0.3999, 0.3501, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "curves=all='0/0 0.2/0.100 1/1',eq=saturation=0.650,colorbalance=bs=0.120:bm=0.080:rs=-0.050,noise=alls=20:allf=t"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.01053, 0.0155, 0.04932, 1]
diff --git a/src/crates/concat-effects/packages/concat.milk/effect.toml b/src/crates/concat-effects/packages/concat.milk/effect.toml
index e9442c69..652a1405 100644
--- a/src/crates/concat-effects/packages/concat.milk/effect.toml
+++ b/src/crates/concat-effects/packages/concat.milk/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.milk"
name = "Milk"
@@ -25,8 +27,6 @@ default = 40
step = 1
unit = "%"
-[ffmpeg]
-chain = "curves=all='0/{fixed(matte / 100 * 0.14, 3)} 0.5/{fixed(0.5 + matte / 100 * 0.08, 3)} 1/{fixed(1 - matte / 100 * 0.05, 3)}',eq=saturation={fixed(1 - matte / 100 * 0.25, 3)},colorbalance=bh={fixed(cool / 100 * 0.06, 3)}:rh={fixed(0 - cool / 100 * 0.03, 3)}"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.milk/effect.wgsl b/src/crates/concat-effects/packages/concat.milk/effect.wgsl
index 091548b7..39134c30 100644
--- a/src/crates/concat-effects/packages/concat.milk/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.milk/effect.wgsl
@@ -8,5 +8,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
out = matte(out, m * 0.14, 1.0 - m * 0.05);
out = saturation(out, 1.0 - m * 0.25);
out = split_tone(out, vec3<f32>(0.0), vec3<f32>(-0.03, 0.0, 0.06), params.cool / 100.0);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.milk/fixtures.toml b/src/crates/concat-effects/packages/concat.milk/fixtures.toml
index ad8091ee..3d808e1d 100644
--- a/src/crates/concat-effects/packages/concat.milk/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.milk/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "curves=all='0/0.084 0.5/0.548 1/0.970',eq=saturation=0.850,colorbalance=bh=0.024:rh=-0.012"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.34741, 0.27051, 0.20312, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "curves=all='0/0.000 0.5/0.500 1/1.000',eq=saturation=1.000,colorbalance=bh=0.000:rh=0.000"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44995, 0.3999, 0.3501, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "curves=all='0/0.140 0.5/0.580 1/0.950',eq=saturation=0.750,colorbalance=bh=0.060:rh=-0.030"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.17554, 0.16687, 0.15869, 1]
diff --git a/src/crates/concat-effects/packages/concat.mono/effect.toml b/src/crates/concat-effects/packages/concat.mono/effect.toml
index c03f20f2..c4f6e89d 100644
--- a/src/crates/concat-effects/packages/concat.mono/effect.toml
+++ b/src/crates/concat-effects/packages/concat.mono/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.mono"
name = "Mono"
@@ -34,13 +36,6 @@ default = 0
step = 1
unit = "%"
-[ffmpeg]
-let = [
- "r = 0.3 + 0.35 * colour / 100",
- "b = 0.11 - 0.05 * colour / 100",
- "g = 1 - r - b",
-]
-chain = "colorchannelmixer=rr={fixed(r, 3)}:rg={fixed(g, 3)}:rb={fixed(b, 3)}:gr={fixed(r, 3)}:gg={fixed(g, 3)}:gb={fixed(b, 3)}:br={fixed(r, 3)}:bg={fixed(g, 3)}:bb={fixed(b, 3)},eq=contrast={fixed(1 + contrast / 100 * 0.4, 3)},noise=alls={round(grain / 100 * 25)}:allf=t"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.mono/effect.wgsl b/src/crates/concat-effects/packages/concat.mono/effect.wgsl
index e905e79b..7d2b31a6 100644
--- a/src/crates/concat-effects/packages/concat.mono/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.mono/effect.wgsl
@@ -9,5 +9,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
var out = mono(c.rgb, vec3<f32>(r, 1.0 - r - b, b));
out = s_curve(out, params.contrast / 100.0 * 0.8);
out = out + grain_at(uv, params.grain / 100.0 * 0.1);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.mono/fixtures.toml b/src/crates/concat-effects/packages/concat.mono/fixtures.toml
index bccf0c64..5b686927 100644
--- a/src/crates/concat-effects/packages/concat.mono/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.mono/fixtures.toml
@@ -1,13 +1,20 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+# The grain at the middle pixel is format 2's: the same on every GPU.
+
+[[probe]]
name = "default"
-chain = "colorchannelmixer=rr=0.440:rg=0.470:rb=0.090:gr=0.440:gg=0.470:gb=0.090:br=0.440:bg=0.470:bb=0.090,eq=contrast=1.160,noise=alls=0:allf=t"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.23914, 0.23914, 0.23914, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "colorchannelmixer=rr=-0.050:rg=0.890:rb=0.160:gr=-0.050:gg=0.890:gb=0.160:br=-0.050:bg=0.890:bb=0.160,eq=contrast=1.000,noise=alls=0:allf=t"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.38916, 0.38916, 0.38916, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "colorchannelmixer=rr=0.650:rg=0.290:rb=0.060:gr=0.650:gg=0.290:gb=0.060:br=0.650:bg=0.290:bb=0.060,eq=contrast=1.400,noise=alls=25:allf=t"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.04605, 0.04605, 0.04605, 1]
diff --git a/src/crates/concat-effects/packages/concat.moody/effect.toml b/src/crates/concat-effects/packages/concat.moody/effect.toml
index c47ebb5d..7c317c0a 100644
--- a/src/crates/concat-effects/packages/concat.moody/effect.toml
+++ b/src/crates/concat-effects/packages/concat.moody/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.moody"
name = "Moody"
@@ -25,8 +27,6 @@ default = 50
step = 1
unit = "%"
-[ffmpeg]
-chain = "curves=all='0/0 0.15/{fixed(0.15 - depth / 100 * 0.07, 3)} 0.5/{fixed(0.5 - depth / 100 * 0.05, 3)} 1/1',eq=saturation={fixed(1 - depth / 100 * 0.4, 3)},colorbalance=rm={fixed(warmth / 100 * 0.1, 3)}:gm={fixed(warmth / 100 * 0.03, 3)}:bm={fixed(0 - warmth / 100 * 0.08, 3)}:bs={fixed(depth / 100 * 0.06, 3)},vignette=a={fixed(depth / 100 * 0.9, 3)}"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.moody/effect.wgsl b/src/crates/concat-effects/packages/concat.moody/effect.wgsl
index e9547750..b0422fa2 100644
--- a/src/crates/concat-effects/packages/concat.moody/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.moody/effect.wgsl
@@ -9,5 +9,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
out = tint_midtones(out, vec3<f32>(0.1, 0.03, -0.08), params.warmth / 100.0);
out = split_tone(out, vec3<f32>(0.0, 0.0, 0.06), vec3<f32>(0.0), depth);
out = vignette(out, uv, depth * 0.7);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.moody/fixtures.toml b/src/crates/concat-effects/packages/concat.moody/fixtures.toml
index f5d87e56..acefa5a1 100644
--- a/src/crates/concat-effects/packages/concat.moody/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.moody/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "curves=all='0/0 0.15/0.108 0.5/0.470 1/1',eq=saturation=0.760,colorbalance=rm=0.050:gm=0.015:bm=-0.040:bs=0.036,vignette=a=0.540"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.24585, 0.14417, 0.06616, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "curves=all='0/0 0.15/0.150 0.5/0.500 1/1',eq=saturation=1.000,colorbalance=rm=0.000:gm=0.000:bm=0.000:bs=0.000,vignette=a=0.000"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44995, 0.3999, 0.3501, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "curves=all='0/0 0.15/0.080 0.5/0.450 1/1',eq=saturation=0.600,colorbalance=rm=0.100:gm=0.030:bm=-0.080:bs=0.060,vignette=a=0.900"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.03073, 0.02034, 0.01834, 1]
diff --git a/src/crates/concat-effects/packages/concat.natural/effect.toml b/src/crates/concat-effects/packages/concat.natural/effect.toml
index f77a35cc..32a35b34 100644
--- a/src/crates/concat-effects/packages/concat.natural/effect.toml
+++ b/src/crates/concat-effects/packages/concat.natural/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.natural"
name = "Natural"
@@ -6,8 +8,6 @@ category = "Portrait"
order = 55
description = "A gentle, true-to-life lift: barely-there warmth, skin left alone."
-[ffmpeg]
-chain = "colortemperature=temperature=5600:pl=1,eq=saturation=1.05:contrast=1.04"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.natural/effect.wgsl b/src/crates/concat-effects/packages/concat.natural/effect.wgsl
index e04ddda4..b6101425 100644
--- a/src/crates/concat-effects/packages/concat.natural/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.natural/effect.wgsl
@@ -1,5 +1,5 @@
fn effect(uv: vec2<f32>) -> vec4<f32> {
let c = sample(uv);
let wb = white_balance(c.rgb, 5600.0);
- return vec4<f32>(clamp01(contrast(saturation(wb, 1.05), 1.04)), c.a);
+ return vec4<f32>(contrast(saturation(wb, 1.05), 1.04), c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.natural/fixtures.toml b/src/crates/concat-effects/packages/concat.natural/fixtures.toml
index 5c297f12..ca47e47c 100644
--- a/src/crates/concat-effects/packages/concat.natural/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.natural/fixtures.toml
@@ -1,3 +1,7 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "colortemperature=temperature=5600:pl=1,eq=saturation=1.05:contrast=1.04"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.35278, 0.19446, 0.09821, 1]
diff --git a/src/crates/concat-effects/packages/concat.neon/effect.toml b/src/crates/concat-effects/packages/concat.neon/effect.toml
index ee7aac7e..1832c81b 100644
--- a/src/crates/concat-effects/packages/concat.neon/effect.toml
+++ b/src/crates/concat-effects/packages/concat.neon/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.neon"
name = "Neon"
@@ -25,8 +27,6 @@ default = 50
step = 1
unit = "%"
-[ffmpeg]
-chain = "colorbalance=rs={fixed(glow / 100 * 0.18, 3)}:gs={fixed(0 - glow / 100 * 0.1, 3)}:bs={fixed(glow / 100 * 0.18, 3)}:rh={fixed(0 - glow / 100 * 0.1, 3)}:gh={fixed(glow / 100 * 0.1, 3)}:bh={fixed(glow / 100 * 0.15, 3)},eq=contrast={fixed(1 + punch / 100 * 0.5, 3)}:saturation={fixed(1 + punch / 100 * 0.6, 3)},split[neona{index}][neonb{index}];[neonb{index}]gblur=sigma=10[neong{index}];[neona{index}][neong{index}]blend=all_mode=screen:all_opacity={fixed(glow / 100 * 0.25, 3)}"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.neon/effect.wgsl b/src/crates/concat-effects/packages/concat.neon/effect.wgsl
index 2da04bea..bdd10f91 100644
--- a/src/crates/concat-effects/packages/concat.neon/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.neon/effect.wgsl
@@ -9,5 +9,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
out = contrast(out, 1.0 + punch * 0.5);
out = saturation(out, 1.0 + punch * 0.6);
out = halation(uv, out, 0.75, 10.0, vec3<f32>(1.0, 1.0, 1.0), g * 0.4);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.neon/fixtures.toml b/src/crates/concat-effects/packages/concat.neon/fixtures.toml
index 545db876..5041df1e 100644
--- a/src/crates/concat-effects/packages/concat.neon/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.neon/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "colorbalance=rs=0.108:gs=-0.060:bs=0.108:rh=-0.060:gh=0.060:bh=0.090,eq=contrast=1.250:saturation=1.300,split[neona0][neonb0];[neonb0]gblur=sigma=10[neong0];[neona0][neong0]blend=all_mode=screen:all_opacity=0.150"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.36597, 0.20288, 0.09357, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "colorbalance=rs=0.000:gs=0.000:bs=0.000:rh=0.000:gh=0.000:bh=0.000,eq=contrast=1.000:saturation=1.000,split[neona0][neonb0];[neonb0]gblur=sigma=10[neong0];[neona0][neong0]blend=all_mode=screen:all_opacity=0.000"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44995, 0.3999, 0.3501, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "colorbalance=rs=0.180:gs=-0.100:bs=0.180:rh=-0.100:gh=0.100:bh=0.150,eq=contrast=1.500:saturation=1.600,split[neona0][neonb0];[neonb0]gblur=sigma=10[neong0];[neona0][neong0]blend=all_mode=screen:all_opacity=0.250"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.16907, 0.01057, 0.0993, 1]
diff --git a/src/crates/concat-effects/packages/concat.night/effect.toml b/src/crates/concat-effects/packages/concat.night/effect.toml
index 5b5e9c57..c7ceacdb 100644
--- a/src/crates/concat-effects/packages/concat.night/effect.toml
+++ b/src/crates/concat-effects/packages/concat.night/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.night"
name = "Night"
@@ -25,8 +27,6 @@ default = 40
step = 1
unit = "%"
-[ffmpeg]
-chain = "curves=all='0/{fixed(lift / 100 * 0.05, 3)} 0.25/{fixed(0.25 + lift / 100 * 0.15, 3)} 0.5/{fixed(0.5 + lift / 100 * 0.1, 3)} 1/1',hqdn3d={fixed(clarity / 100 * 6, 2)}"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.night/effect.wgsl b/src/crates/concat-effects/packages/concat.night/effect.wgsl
index 0de4aa61..4d15535c 100644
--- a/src/crates/concat-effects/packages/concat.night/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.night/effect.wgsl
@@ -7,5 +7,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
let soft = soften(uv, 3.0);
let base = mix(c.rgb, soft, shadows(c.rgb) * params.clarity / 100.0);
let out = lift_gamma_gain(base, vec3<f32>(lift * 0.05), vec3<f32>(1.0 + lift * 0.45), vec3<f32>(1.0));
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.night/fixtures.toml b/src/crates/concat-effects/packages/concat.night/fixtures.toml
index 8bbda245..12b668b0 100644
--- a/src/crates/concat-effects/packages/concat.night/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.night/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "curves=all='0/0.030 0.25/0.340 0.5/0.560 1/1',hqdn3d=2.40"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.40186, 0.29688, 0.20374, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "curves=all='0/0.000 0.25/0.250 0.5/0.500 1/1',hqdn3d=0.00"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44995, 0.3999, 0.3501, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "curves=all='0/0.050 0.25/0.400 0.5/0.600 1/1',hqdn3d=6.00"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.203, 0.18738, 0.17102, 1]
diff --git a/src/crates/concat-effects/packages/concat.noir/effect.toml b/src/crates/concat-effects/packages/concat.noir/effect.toml
index ad03af8b..b296e791 100644
--- a/src/crates/concat-effects/packages/concat.noir/effect.toml
+++ b/src/crates/concat-effects/packages/concat.noir/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.noir"
name = "Noir"
@@ -6,8 +8,6 @@ category = "Cinematic"
order = 50
description = "Desaturated and heavy, with a cold cast into the shadows and the corners dimmed."
-[ffmpeg]
-chain = "hue=s=0,eq=contrast=1.3:brightness=-0.04,colorbalance=bs=0.06:bm=0.04,vignette=angle=0.6"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.noir/effect.wgsl b/src/crates/concat-effects/packages/concat.noir/effect.wgsl
index 07430ec5..0ad7c7a1 100644
--- a/src/crates/concat-effects/packages/concat.noir/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.noir/effect.wgsl
@@ -3,5 +3,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
let g = mono(c.rgb, vec3<f32>(0.3, 0.3, 0.4));
let toned = tint_midtones(g, vec3<f32>(-0.02, 0.0, 0.05), 1.0);
let v = vignette(toned, uv, 0.35);
- return vec4<f32>(clamp01(contrast(v, 1.3)), c.a);
+ return vec4<f32>(contrast(v, 1.3), c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.noir/fixtures.toml b/src/crates/concat-effects/packages/concat.noir/fixtures.toml
index 5201bc5a..6de6182f 100644
--- a/src/crates/concat-effects/packages/concat.noir/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.noir/fixtures.toml
@@ -1,3 +1,7 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "hue=s=0,eq=contrast=1.3:brightness=-0.04,colorbalance=bs=0.06:bm=0.04,vignette=angle=0.6"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.16711, 0.18994, 0.25439, 1]
diff --git a/src/crates/concat-effects/packages/concat.peach/effect.toml b/src/crates/concat-effects/packages/concat.peach/effect.toml
index 5543a025..24bb1316 100644
--- a/src/crates/concat-effects/packages/concat.peach/effect.toml
+++ b/src/crates/concat-effects/packages/concat.peach/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.peach"
name = "Peach"
@@ -25,8 +27,6 @@ default = 40
step = 1
unit = "%"
-[ffmpeg]
-chain = "selectivecolor=reds='0 {fixed(0 - glow / 100 * 0.08, 3)} {fixed(glow / 100 * 0.1, 3)} {fixed(0 - glow / 100 * 0.1, 3)}':yellows='0 {fixed(glow / 100 * 0.05, 3)} 0 {fixed(0 - glow / 100 * 0.06, 3)}',curves=all='0/{fixed(glow / 100 * 0.06, 3)} 1/1',eq=contrast={fixed(1 - glow / 100 * 0.1, 3)},colorbalance=rh={fixed(glow / 100 * 0.05, 3)}:gh={fixed(glow / 100 * 0.02, 3)},split[peacha{index}][peachb{index}];[peachb{index}]gblur=sigma=6[peachg{index}];[peacha{index}][peachg{index}]blend=all_mode=screen:all_opacity={fixed(softness / 100 * 0.25, 3)}"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.peach/effect.wgsl b/src/crates/concat-effects/packages/concat.peach/effect.wgsl
index 558c6db7..7dee5932 100644
--- a/src/crates/concat-effects/packages/concat.peach/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.peach/effect.wgsl
@@ -11,5 +11,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
out = matte(out, glow * 0.06, 1.0);
out = contrast(out, 1.0 - glow * 0.1);
out = split_tone(out, vec3<f32>(0.0), vec3<f32>(0.05, 0.02, 0.0), glow);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.peach/fixtures.toml b/src/crates/concat-effects/packages/concat.peach/fixtures.toml
index c3adc497..ce63354b 100644
--- a/src/crates/concat-effects/packages/concat.peach/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.peach/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "selectivecolor=reds='0 -0.040 0.050 -0.050':yellows='0 0.025 0 -0.030',curves=all='0/0.030 1/1',eq=contrast=0.950,colorbalance=rh=0.025:gh=0.010,split[peacha0][peachb0];[peachb0]gblur=sigma=6[peachg0];[peacha0][peachg0]blend=all_mode=screen:all_opacity=0.100"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.34595, 0.22803, 0.14636, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "selectivecolor=reds='0 0.000 0.000 0.000':yellows='0 0.000 0 0.000',curves=all='0/0.000 1/1',eq=contrast=1.000,colorbalance=rh=0.000:gh=0.000,split[peacha0][peachb0];[peachb0]gblur=sigma=6[peachg0];[peacha0][peachg0]blend=all_mode=screen:all_opacity=0.000"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44946, 0.39941, 0.34961, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "selectivecolor=reds='0 -0.080 0.100 -0.100':yellows='0 0.050 0 -0.060',curves=all='0/0.060 1/1',eq=contrast=0.900,colorbalance=rh=0.050:gh=0.020,split[peacha0][peachb0];[peachb0]gblur=sigma=6[peachg0];[peacha0][peachg0]blend=all_mode=screen:all_opacity=0.250"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.11188, 0.1012, 0.09058, 1]
diff --git a/src/crates/concat-effects/packages/concat.pink-fuzz/effect.toml b/src/crates/concat-effects/packages/concat.pink-fuzz/effect.toml
index 97368364..895e8439 100644
--- a/src/crates/concat-effects/packages/concat.pink-fuzz/effect.toml
+++ b/src/crates/concat-effects/packages/concat.pink-fuzz/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.pink-fuzz"
name = "Pink Fuzz"
@@ -25,8 +27,6 @@ default = 50
step = 1
unit = "%"
-[ffmpeg]
-chain = "curves=all='0/{fixed(haze / 100 * 0.1, 3)} 1/1',eq=contrast={fixed(1 - haze / 100 * 0.2, 3)}:saturation={fixed(1 - haze / 100 * 0.15, 3)},colorbalance=rh={fixed(blush / 100 * 0.1, 3)}:gh={fixed(0 - blush / 100 * 0.04, 3)}:bh={fixed(blush / 100 * 0.08, 3)},split[fuzza{index}][fuzzb{index}];[fuzzb{index}]gblur=sigma=12[fuzzg{index}];[fuzza{index}][fuzzg{index}]blend=all_mode=screen:all_opacity={fixed(haze / 100 * 0.35, 3)}"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.pink-fuzz/effect.wgsl b/src/crates/concat-effects/packages/concat.pink-fuzz/effect.wgsl
index 0c886555..663db0f6 100644
--- a/src/crates/concat-effects/packages/concat.pink-fuzz/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.pink-fuzz/effect.wgsl
@@ -9,5 +9,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
out = saturation(out, 1.0 - haze * 0.15);
out = split_tone(out, vec3<f32>(0.0), vec3<f32>(0.1, -0.04, 0.08), params.blush / 100.0);
out = halation(uv, out, 0.5, 12.0, vec3<f32>(1.0, 0.85, 0.95), haze * 0.55);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.pink-fuzz/fixtures.toml b/src/crates/concat-effects/packages/concat.pink-fuzz/fixtures.toml
index ee7a7e88..c4fb13b4 100644
--- a/src/crates/concat-effects/packages/concat.pink-fuzz/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.pink-fuzz/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "curves=all='0/0.060 1/1',eq=contrast=0.880:saturation=0.910,colorbalance=rh=0.050:gh=-0.020:bh=0.040,split[fuzza0][fuzzb0];[fuzzb0]gblur=sigma=12[fuzzg0];[fuzza0][fuzzg0]blend=all_mode=screen:all_opacity=0.210"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.31201, 0.22205, 0.16284, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "curves=all='0/0.000 1/1',eq=contrast=1.000:saturation=1.000,colorbalance=rh=0.000:gh=0.000:bh=0.000,split[fuzza0][fuzzb0];[fuzzb0]gblur=sigma=12[fuzzg0];[fuzza0][fuzzg0]blend=all_mode=screen:all_opacity=0.000"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44995, 0.3999, 0.3501, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "curves=all='0/0.100 1/1',eq=contrast=0.800:saturation=0.850,colorbalance=rh=0.100:gh=-0.040:bh=0.080,split[fuzza0][fuzzb0];[fuzzb0]gblur=sigma=12[fuzzg0];[fuzza0][fuzzg0]blend=all_mode=screen:all_opacity=0.350"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.13184, 0.12317, 0.11469, 1]
diff --git a/src/crates/concat-effects/packages/concat.polaroid/effect.toml b/src/crates/concat-effects/packages/concat.polaroid/effect.toml
index 3c208f2a..e7238c02 100644
--- a/src/crates/concat-effects/packages/concat.polaroid/effect.toml
+++ b/src/crates/concat-effects/packages/concat.polaroid/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.polaroid"
name = "Polaroid"
@@ -25,8 +27,6 @@ default = 50
step = 1
unit = "%"
-[ffmpeg]
-chain = "curves=all='0/{fixed(fade / 100 * 0.1, 3)} 1/{fixed(1 - fade / 100 * 0.05, 3)}',eq=contrast={fixed(1 - fade / 100 * 0.1, 3)}:saturation={fixed(1 - fade / 100 * 0.15, 3)},colorbalance=rh={fixed(warmth / 100 * 0.1, 3)}:gh={fixed(warmth / 100 * 0.05, 3)}:bh={fixed(0 - warmth / 100 * 0.06, 3)}:gs={fixed(fade / 100 * 0.05, 3)}:bs={fixed(fade / 100 * 0.08, 3)}:rs={fixed(0 - fade / 100 * 0.06, 3)},vignette=a={fixed(fade / 100 * 0.35, 3)}"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.polaroid/effect.wgsl b/src/crates/concat-effects/packages/concat.polaroid/effect.wgsl
index dfc9b94a..f4955f6e 100644
--- a/src/crates/concat-effects/packages/concat.polaroid/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.polaroid/effect.wgsl
@@ -11,5 +11,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
out = split_tone(out, vec3<f32>(-0.06, 0.05, 0.08) * f, vec3<f32>(0.1, 0.05, -0.06) * w, 1.0);
out = mix(out, soften(uv, 3.0), smoothstep(0.5, 1.0, distance(uv, vec2<f32>(0.5)) * 1.4142) * f * 0.6);
out = vignette(out, uv, f * 0.3);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.polaroid/fixtures.toml b/src/crates/concat-effects/packages/concat.polaroid/fixtures.toml
index 6bf60bbc..8eb7ef6f 100644
--- a/src/crates/concat-effects/packages/concat.polaroid/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.polaroid/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "curves=all='0/0.060 1/0.970',eq=contrast=0.940:saturation=0.910,colorbalance=rh=0.050:gh=0.025:bh=-0.030:gs=0.030:bs=0.048:rs=-0.036,vignette=a=0.210"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.29736, 0.21692, 0.14417, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "curves=all='0/0.000 1/1.000',eq=contrast=1.000:saturation=1.000,colorbalance=rh=0.000:gh=0.000:bh=0.000:gs=0.000:bs=0.000:rs=0.000,vignette=a=0.000"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44995, 0.3999, 0.3501, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "curves=all='0/0.100 1/0.950',eq=contrast=0.900:saturation=0.850,colorbalance=rh=0.100:gh=0.050:bh=-0.060:gs=0.050:bs=0.080:rs=-0.060,vignette=a=0.350"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.10364, 0.11523, 0.11169, 1]
diff --git a/src/crates/concat-effects/packages/concat.push/effect.toml b/src/crates/concat-effects/packages/concat.push/effect.toml
index 50de9652..3df33d34 100644
--- a/src/crates/concat-effects/packages/concat.push/effect.toml
+++ b/src/crates/concat-effects/packages/concat.push/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.push"
name = "Push"
diff --git a/src/crates/concat-effects/packages/concat.push/fixtures.toml b/src/crates/concat-effects/packages/concat.push/fixtures.toml
new file mode 100644
index 00000000..f5880c66
--- /dev/null
+++ b/src/crates/concat-effects/packages/concat.push/fixtures.toml
@@ -0,0 +1,25 @@
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. A cut from one colour to another, and its middle pixel.
+
+[[probe]]
+name = "default"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.7998, 0.5, 0.30005, 1]
+
+[[probe]]
+name = "minimum"
+at = "min"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.7998, 0.5, 0.30005, 1]
+
+[[probe]]
+name = "maximum"
+at = "max"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.7998, 0.5, 0.30005, 1]
diff --git a/src/crates/concat-effects/packages/concat.rain/effect.toml b/src/crates/concat-effects/packages/concat.rain/effect.toml
index 75693a71..56c469e0 100644
--- a/src/crates/concat-effects/packages/concat.rain/effect.toml
+++ b/src/crates/concat-effects/packages/concat.rain/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.rain"
name = "Rain"
@@ -25,8 +27,6 @@ default = 50
step = 1
unit = "%"
-[ffmpeg]
-chain = "curves=all='0/{fixed(haze / 100 * 0.08, 3)} 1/{fixed(1 - haze / 100 * 0.02, 3)}',eq=saturation={fixed(1 - haze / 100 * 0.4, 3)}:contrast={fixed(1 - haze / 100 * 0.08, 3)},colorbalance=bs={fixed(chill / 100 * 0.1, 3)}:bm={fixed(chill / 100 * 0.06, 3)},split[raina{index}][rainb{index}];[rainb{index}]gblur=sigma=12[raing{index}];[raina{index}][raing{index}]blend=all_mode=screen:all_opacity={fixed(haze / 100 * 0.25, 3)}"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.rain/effect.wgsl b/src/crates/concat-effects/packages/concat.rain/effect.wgsl
index b0f85193..4c7cf608 100644
--- a/src/crates/concat-effects/packages/concat.rain/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.rain/effect.wgsl
@@ -11,5 +11,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
out = split_tone(out, vec3<f32>(0.0, 0.0, 0.1), vec3<f32>(0.0), ch);
out = tint_midtones(out, vec3<f32>(0.0, 0.0, 0.06), ch);
out = halation(uv, out, 0.65, 12.0, vec3<f32>(0.85, 0.92, 1.0), h * 0.45);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.rain/fixtures.toml b/src/crates/concat-effects/packages/concat.rain/fixtures.toml
index c85142c2..eea576d7 100644
--- a/src/crates/concat-effects/packages/concat.rain/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.rain/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "curves=all='0/0.048 1/0.988',eq=saturation=0.760:contrast=0.952,colorbalance=bs=0.050:bm=0.030,split[raina0][rainb0];[rainb0]gblur=sigma=12[raing0];[raina0][raing0]blend=all_mode=screen:all_opacity=0.150"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.28662, 0.2179, 0.18274, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "curves=all='0/0.000 1/1.000',eq=saturation=1.000:contrast=1.000,colorbalance=bs=0.000:bm=0.000,split[raina0][rainb0];[rainb0]gblur=sigma=12[raing0];[raina0][raing0]blend=all_mode=screen:all_opacity=0.000"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44995, 0.3999, 0.3501, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "curves=all='0/0.080 1/0.980',eq=saturation=0.600:contrast=0.920,colorbalance=bs=0.100:bm=0.060,split[raina0][rainb0];[rainb0]gblur=sigma=12[raing0];[raina0][raing0]blend=all_mode=screen:all_opacity=0.250"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.10907, 0.10297, 0.14941, 1]
diff --git a/src/crates/concat-effects/packages/concat.retro-70s/effect.toml b/src/crates/concat-effects/packages/concat.retro-70s/effect.toml
index 08e4cd3b..07a4067c 100644
--- a/src/crates/concat-effects/packages/concat.retro-70s/effect.toml
+++ b/src/crates/concat-effects/packages/concat.retro-70s/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.retro-70s"
name = "Retro 70s"
@@ -6,8 +8,6 @@ category = "Film"
order = 63
description = "A heavy warm fade with a yellowed, sun-bleached cast."
-[ffmpeg]
-chain = "curves=all='0/0.1 1/0.88',colorbalance=rm=0.1:gm=0.06:bm=-0.12,eq=saturation=0.85"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.retro-70s/effect.wgsl b/src/crates/concat-effects/packages/concat.retro-70s/effect.wgsl
index 8e96d845..3b9f32c4 100644
--- a/src/crates/concat-effects/packages/concat.retro-70s/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.retro-70s/effect.wgsl
@@ -2,5 +2,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
let c = sample(uv);
let f = fade(c.rgb, 0.1);
let t = tint_midtones(f, vec3<f32>(0.1, 0.06, -0.12), 1.0);
- return vec4<f32>(clamp01(saturation(t, 0.85)), c.a);
+ return vec4<f32>(saturation(t, 0.85), c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.retro-70s/fixtures.toml b/src/crates/concat-effects/packages/concat.retro-70s/fixtures.toml
index 0993cf86..6817677e 100644
--- a/src/crates/concat-effects/packages/concat.retro-70s/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.retro-70s/fixtures.toml
@@ -1,3 +1,7 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "curves=all='0/0.1 1/0.88',colorbalance=rm=0.1:gm=0.06:bm=-0.12,eq=saturation=0.85"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.44531, 0.30859, 0.11542, 1]
diff --git a/src/crates/concat-effects/packages/concat.retro-cartoon/effect.toml b/src/crates/concat-effects/packages/concat.retro-cartoon/effect.toml
index ca6367f4..73938f66 100644
--- a/src/crates/concat-effects/packages/concat.retro-cartoon/effect.toml
+++ b/src/crates/concat-effects/packages/concat.retro-cartoon/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.retro-cartoon"
name = "Retro Cartoon"
@@ -24,11 +26,6 @@ default = 60
step = 1
unit = "%"
-[ffmpeg]
-let = [
- "size = round(256 / max(round(levels), 2))",
-]
-chain = "lutrgb=r=trunc(val/{size})*{size}:g=trunc(val/{size})*{size}:b=trunc(val/{size})*{size},split[inka{index}][inkb{index}];[inkb{index}]edgedetect=mode=colormix:low=0.08:high=0.25[inke{index}];[inka{index}][inke{index}]blend=all_mode=normal:all_opacity={fixed(ink / 100, 3)}"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.retro-cartoon/effect.wgsl b/src/crates/concat-effects/packages/concat.retro-cartoon/effect.wgsl
index cd465962..ce257163 100644
--- a/src/crates/concat-effects/packages/concat.retro-cartoon/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.retro-cartoon/effect.wgsl
@@ -6,5 +6,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
let levels = max(round(params.levels), 2.0);
let flat = floor(c.rgb * levels) / (levels - 1.0);
let ink = edge_at(uv) * params.ink / 100.0;
- return vec4<f32>(clamp01(flat * (1.0 - ink)), c.a);
+ return vec4<f32>(flat * (1.0 - ink), c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.retro-cartoon/fixtures.toml b/src/crates/concat-effects/packages/concat.retro-cartoon/fixtures.toml
index 3357b440..71182829 100644
--- a/src/crates/concat-effects/packages/concat.retro-cartoon/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.retro-cartoon/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "lutrgb=r=trunc(val/51)*51:g=trunc(val/51)*51:b=trunc(val/51)*51,split[inka0][inkb0];[inkb0]edgedetect=mode=colormix:low=0.08:high=0.25[inke0];[inka0][inke0]blend=all_mode=normal:all_opacity=0.600"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.50098, 0.18945, 0.18945, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "lutrgb=r=trunc(val/128)*128:g=trunc(val/128)*128:b=trunc(val/128)*128,split[inka0][inkb0];[inkb0]edgedetect=mode=colormix:low=0.08:high=0.25[inke0];[inka0][inke0]blend=all_mode=normal:all_opacity=0.000"
+input = [0.45, 0.4, 0.35, 1]
+expect = [1, 1, 1, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "lutrgb=r=trunc(val/32)*32:g=trunc(val/32)*32:b=trunc(val/32)*32,split[inka0][inkb0];[inkb0]edgedetect=mode=colormix:low=0.08:high=0.25[inke0];[inka0][inke0]blend=all_mode=normal:all_opacity=1.000"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.04944, 0.04944, 0.04944, 1]
diff --git a/src/crates/concat-effects/packages/concat.rgb-split-wipe/effect.toml b/src/crates/concat-effects/packages/concat.rgb-split-wipe/effect.toml
index 3d8cd4d8..d15a9614 100644
--- a/src/crates/concat-effects/packages/concat.rgb-split-wipe/effect.toml
+++ b/src/crates/concat-effects/packages/concat.rgb-split-wipe/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.rgb-split-wipe"
name = "RGB Split"
diff --git a/src/crates/concat-effects/packages/concat.rgb-split-wipe/fixtures.toml b/src/crates/concat-effects/packages/concat.rgb-split-wipe/fixtures.toml
new file mode 100644
index 00000000..281947ca
--- /dev/null
+++ b/src/crates/concat-effects/packages/concat.rgb-split-wipe/fixtures.toml
@@ -0,0 +1,25 @@
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. A cut from one colour to another, and its middle pixel.
+
+[[probe]]
+name = "default"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.56738, 0.3916, 0.33081, 1]
+
+[[probe]]
+name = "minimum"
+at = "min"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.56738, 0.3916, 0.33081, 1]
+
+[[probe]]
+name = "maximum"
+at = "max"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.56738, 0.3916, 0.33081, 1]
diff --git a/src/crates/concat-effects/packages/concat.rosy/effect.toml b/src/crates/concat-effects/packages/concat.rosy/effect.toml
index 75900bd9..2e3e1b1c 100644
--- a/src/crates/concat-effects/packages/concat.rosy/effect.toml
+++ b/src/crates/concat-effects/packages/concat.rosy/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.rosy"
name = "Rosy"
@@ -6,8 +8,6 @@ category = "Portrait"
order = 56
description = "A soft pink lift into the highlights, flattering and warm."
-[ffmpeg]
-chain = "colorbalance=rh=0.08:gh=0.02:bh=0.03,eq=saturation=1.08"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.rosy/effect.wgsl b/src/crates/concat-effects/packages/concat.rosy/effect.wgsl
index 2e3af568..f50336fe 100644
--- a/src/crates/concat-effects/packages/concat.rosy/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.rosy/effect.wgsl
@@ -1,5 +1,5 @@
fn effect(uv: vec2<f32>) -> vec4<f32> {
let c = sample(uv);
let t = split_tone(c.rgb, vec3<f32>(0.0), vec3<f32>(0.08, 0.02, 0.03), 1.0);
- return vec4<f32>(clamp01(saturation(t, 1.08)), c.a);
+ return vec4<f32>(saturation(t, 1.08), c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.rosy/fixtures.toml b/src/crates/concat-effects/packages/concat.rosy/fixtures.toml
index fc1bfca3..71d0c2d5 100644
--- a/src/crates/concat-effects/packages/concat.rosy/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.rosy/fixtures.toml
@@ -1,3 +1,7 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "colorbalance=rh=0.08:gh=0.02:bh=0.03,eq=saturation=1.08"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.31909, 0.20093, 0.11609, 1]
diff --git a/src/crates/concat-effects/packages/concat.sage/effect.toml b/src/crates/concat-effects/packages/concat.sage/effect.toml
index 1265adcc..80f2e2e7 100644
--- a/src/crates/concat-effects/packages/concat.sage/effect.toml
+++ b/src/crates/concat-effects/packages/concat.sage/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.sage"
name = "Sage"
@@ -16,8 +18,6 @@ default = 60
step = 1
unit = "%"
-[ffmpeg]
-chain = "eq=saturation={fixed(1 - amount / 100 * 0.3, 3)},colorbalance=gm={fixed(amount / 100 * 0.06, 3)}:bm={fixed(amount / 100 * 0.04, 3)}:rm={fixed(0 - amount / 100 * 0.04, 3)},curves=all='0/0.02 0.5/0.48 1/0.98'"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.sage/effect.wgsl b/src/crates/concat-effects/packages/concat.sage/effect.wgsl
index 573fe2c9..58e726c1 100644
--- a/src/crates/concat-effects/packages/concat.sage/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.sage/effect.wgsl
@@ -8,5 +8,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
var out = saturation(c.rgb, 1.0 - a * 0.3);
out = tint_midtones(out, vec3<f32>(-0.04, 0.06, 0.04), a * keep);
out = matte(film_curve(out, 0.3 * a, 0.3 * a), 0.02 * a, 1.0 - 0.02 * a);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.sage/fixtures.toml b/src/crates/concat-effects/packages/concat.sage/fixtures.toml
index bc1fcfa8..31015052 100644
--- a/src/crates/concat-effects/packages/concat.sage/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.sage/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "eq=saturation=0.820,colorbalance=gm=0.036:bm=0.024:rm=-0.024,curves=all='0/0.02 0.5/0.48 1/0.98'"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.28003, 0.21289, 0.13574, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "eq=saturation=1.000,colorbalance=gm=0.000:bm=0.000:rm=0.000,curves=all='0/0.02 0.5/0.48 1/0.98'"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44995, 0.3999, 0.3501, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "eq=saturation=0.700,colorbalance=gm=0.060:bm=0.040:rm=-0.040,curves=all='0/0.02 0.5/0.48 1/0.98'"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.05533, 0.08167, 0.06653, 1]
diff --git a/src/crates/concat-effects/packages/concat.sci-fi/effect.toml b/src/crates/concat-effects/packages/concat.sci-fi/effect.toml
index 6c564d33..3a519089 100644
--- a/src/crates/concat-effects/packages/concat.sci-fi/effect.toml
+++ b/src/crates/concat-effects/packages/concat.sci-fi/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.sci-fi"
name = "Sci-Fi"
@@ -6,8 +8,6 @@ category = "Cinematic"
order = 53
description = "A cool, sterile steel-and-teal grade, saturation held back."
-[ffmpeg]
-chain = "colortemperature=temperature=8200:pl=1,colorbalance=bs=0.06:bh=0.04,eq=saturation=0.85"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.sci-fi/effect.wgsl b/src/crates/concat-effects/packages/concat.sci-fi/effect.wgsl
index bd942ee0..0e714e6c 100644
--- a/src/crates/concat-effects/packages/concat.sci-fi/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.sci-fi/effect.wgsl
@@ -2,5 +2,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
let c = sample(uv);
let wb = white_balance(c.rgb, 8200.0);
let t = split_tone(wb, vec3<f32>(-0.02, 0.03, 0.06), vec3<f32>(0.0, 0.02, 0.03), 1.0);
- return vec4<f32>(clamp01(saturation(t, 0.85)), c.a);
+ return vec4<f32>(saturation(t, 0.85), c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.sci-fi/fixtures.toml b/src/crates/concat-effects/packages/concat.sci-fi/fixtures.toml
index b6226359..b7d4c93d 100644
--- a/src/crates/concat-effects/packages/concat.sci-fi/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.sci-fi/fixtures.toml
@@ -1,3 +1,7 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "colortemperature=temperature=8200:pl=1,colorbalance=bs=0.06:bh=0.04,eq=saturation=0.85"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.2583, 0.20471, 0.17419, 1]
diff --git a/src/crates/concat-effects/packages/concat.shape-wipe/effect.toml b/src/crates/concat-effects/packages/concat.shape-wipe/effect.toml
index ab3fa91e..8417553f 100644
--- a/src/crates/concat-effects/packages/concat.shape-wipe/effect.toml
+++ b/src/crates/concat-effects/packages/concat.shape-wipe/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.shape-wipe"
name = "Shape Wipe"
diff --git a/src/crates/concat-effects/packages/concat.shape-wipe/fixtures.toml b/src/crates/concat-effects/packages/concat.shape-wipe/fixtures.toml
new file mode 100644
index 00000000..1d5620fc
--- /dev/null
+++ b/src/crates/concat-effects/packages/concat.shape-wipe/fixtures.toml
@@ -0,0 +1,25 @@
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. A cut from one colour to another, and its middle pixel.
+
+[[probe]]
+name = "default"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.7998, 0.5, 0.30005, 1]
+
+[[probe]]
+name = "minimum"
+at = "min"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.7998, 0.5, 0.30005, 1]
+
+[[probe]]
+name = "maximum"
+at = "max"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.25342, 0.245, 0.37256, 1]
diff --git a/src/crates/concat-effects/packages/concat.silver/effect.toml b/src/crates/concat-effects/packages/concat.silver/effect.toml
index 78af5013..d049d20c 100644
--- a/src/crates/concat-effects/packages/concat.silver/effect.toml
+++ b/src/crates/concat-effects/packages/concat.silver/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.silver"
name = "Silver"
@@ -6,8 +8,6 @@ category = "Black & White"
order = 65
description = "A cool, soft black and white with the shadows lifted, like a silver print."
-[ffmpeg]
-chain = "hue=s=0,curves=all='0/0.05 1/0.95',colorbalance=bs=0.05:bh=0.03"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.silver/effect.wgsl b/src/crates/concat-effects/packages/concat.silver/effect.wgsl
index fda6a30b..2704bc6d 100644
--- a/src/crates/concat-effects/packages/concat.silver/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.silver/effect.wgsl
@@ -3,5 +3,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
let g = mono(c.rgb, vec3<f32>(0.3, 0.33, 0.37));
let f = fade(g, 0.05);
let t = tint_midtones(f, vec3<f32>(-0.02, 0.0, 0.03), 1.0);
- return vec4<f32>(clamp01(t), c.a);
+ return vec4<f32>(t, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.silver/fixtures.toml b/src/crates/concat-effects/packages/concat.silver/fixtures.toml
index 1385700c..e8e7927a 100644
--- a/src/crates/concat-effects/packages/concat.silver/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.silver/fixtures.toml
@@ -1,3 +1,7 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "hue=s=0,curves=all='0/0.05 1/0.95',colorbalance=bs=0.05:bh=0.03"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.198, 0.21606, 0.24487, 1]
diff --git a/src/crates/concat-effects/packages/concat.slide/effect.toml b/src/crates/concat-effects/packages/concat.slide/effect.toml
index 5635905b..7a4cb99c 100644
--- a/src/crates/concat-effects/packages/concat.slide/effect.toml
+++ b/src/crates/concat-effects/packages/concat.slide/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.slide"
name = "Slide"
diff --git a/src/crates/concat-effects/packages/concat.slide/fixtures.toml b/src/crates/concat-effects/packages/concat.slide/fixtures.toml
new file mode 100644
index 00000000..f5880c66
--- /dev/null
+++ b/src/crates/concat-effects/packages/concat.slide/fixtures.toml
@@ -0,0 +1,25 @@
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. A cut from one colour to another, and its middle pixel.
+
+[[probe]]
+name = "default"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.7998, 0.5, 0.30005, 1]
+
+[[probe]]
+name = "minimum"
+at = "min"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.7998, 0.5, 0.30005, 1]
+
+[[probe]]
+name = "maximum"
+at = "max"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.7998, 0.5, 0.30005, 1]
diff --git a/src/crates/concat-effects/packages/concat.soft-light/effect.toml b/src/crates/concat-effects/packages/concat.soft-light/effect.toml
index 7b2ee784..66e855ce 100644
--- a/src/crates/concat-effects/packages/concat.soft-light/effect.toml
+++ b/src/crates/concat-effects/packages/concat.soft-light/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.soft-light"
name = "Soft Light"
@@ -25,8 +27,6 @@ default = 40
step = 1
unit = "%"
-[ffmpeg]
-chain = "curves=all='0/{fixed(lift / 100 * 0.1, 3)} 1/{fixed(1 - lift / 100 * 0.04, 3)}',eq=contrast={fixed(1 - lift / 100 * 0.18, 3)}:saturation={fixed(1 - lift / 100 * 0.12, 3)},colorbalance=rh={fixed(warmth / 100 * 0.07, 3)}:bh={fixed(0 - warmth / 100 * 0.06, 3)},split[softa{index}][softb{index}];[softb{index}]gblur=sigma=10[softg{index}];[softa{index}][softg{index}]blend=all_mode=screen:all_opacity={fixed(lift / 100 * 0.2, 3)}"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.soft-light/effect.wgsl b/src/crates/concat-effects/packages/concat.soft-light/effect.wgsl
index a517fff9..523dcaa9 100644
--- a/src/crates/concat-effects/packages/concat.soft-light/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.soft-light/effect.wgsl
@@ -9,5 +9,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
out = saturation(out, 1.0 - lift * 0.12);
out = split_tone(out, vec3<f32>(0.0), vec3<f32>(0.07, 0.02, -0.06), params.warmth / 100.0);
out = halation(uv, out, 0.6, 10.0, vec3<f32>(1.0, 0.97, 0.9), lift * 0.35);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.soft-light/fixtures.toml b/src/crates/concat-effects/packages/concat.soft-light/fixtures.toml
index bdc91369..c18e4503 100644
--- a/src/crates/concat-effects/packages/concat.soft-light/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.soft-light/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "curves=all='0/0.050 1/0.980',eq=contrast=0.910:saturation=0.940,colorbalance=rh=0.028:bh=-0.024,split[softa0][softb0];[softb0]gblur=sigma=10[softg0];[softa0][softg0]blend=all_mode=screen:all_opacity=0.100"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.29614, 0.21289, 0.1416, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "curves=all='0/0.000 1/1.000',eq=contrast=1.000:saturation=1.000,colorbalance=rh=0.000:bh=0.000,split[softa0][softb0];[softb0]gblur=sigma=10[softg0];[softa0][softg0]blend=all_mode=screen:all_opacity=0.000"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44995, 0.3999, 0.3501, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "curves=all='0/0.100 1/0.960',eq=contrast=0.820:saturation=0.880,colorbalance=rh=0.070:bh=-0.060,split[softa0][softb0];[softb0]gblur=sigma=10[softg0];[softa0][softg0]blend=all_mode=screen:all_opacity=0.200"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.12244, 0.11432, 0.10583, 1]
diff --git a/src/crates/concat-effects/packages/concat.spin/effect.toml b/src/crates/concat-effects/packages/concat.spin/effect.toml
index 371a1e88..3222723c 100644
--- a/src/crates/concat-effects/packages/concat.spin/effect.toml
+++ b/src/crates/concat-effects/packages/concat.spin/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.spin"
name = "Spin"
diff --git a/src/crates/concat-effects/packages/concat.spin/fixtures.toml b/src/crates/concat-effects/packages/concat.spin/fixtures.toml
new file mode 100644
index 00000000..281947ca
--- /dev/null
+++ b/src/crates/concat-effects/packages/concat.spin/fixtures.toml
@@ -0,0 +1,25 @@
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. A cut from one colour to another, and its middle pixel.
+
+[[probe]]
+name = "default"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.56738, 0.3916, 0.33081, 1]
+
+[[probe]]
+name = "minimum"
+at = "min"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.56738, 0.3916, 0.33081, 1]
+
+[[probe]]
+name = "maximum"
+at = "max"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.56738, 0.3916, 0.33081, 1]
diff --git a/src/crates/concat-effects/packages/concat.spooky/effect.toml b/src/crates/concat-effects/packages/concat.spooky/effect.toml
index ab452c87..a5aac910 100644
--- a/src/crates/concat-effects/packages/concat.spooky/effect.toml
+++ b/src/crates/concat-effects/packages/concat.spooky/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.spooky"
name = "Spooky"
@@ -16,8 +18,6 @@ default = 60
step = 1
unit = "%"
-[ffmpeg]
-chain = "eq=saturation={fixed(1 - dread / 100 * 0.6, 3)}:contrast={fixed(1 + dread / 100 * 0.3, 3)},curves=all='0/0 0.2/{fixed(0.2 - dread / 100 * 0.1, 3)} 1/1',colorbalance=rm={fixed(0 - dread / 100 * 0.08, 3)}:gm={fixed(dread / 100 * 0.1, 3)}:bm={fixed(dread / 100 * 0.06, 3)},vignette=a={fixed(dread / 100 * 1.1, 3)}"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.spooky/effect.wgsl b/src/crates/concat-effects/packages/concat.spooky/effect.wgsl
index 20d0bc75..bf14ae57 100644
--- a/src/crates/concat-effects/packages/concat.spooky/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.spooky/effect.wgsl
@@ -9,5 +9,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
out = contrast(out, 1.0 + dread * 0.2);
out = tint_midtones(out, vec3<f32>(-0.08, 0.1, 0.06), dread);
out = vignette(out, uv, dread * 0.85);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.spooky/fixtures.toml b/src/crates/concat-effects/packages/concat.spooky/fixtures.toml
index 0f38d259..fdbbb36b 100644
--- a/src/crates/concat-effects/packages/concat.spooky/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.spooky/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "eq=saturation=0.640:contrast=1.180,curves=all='0/0 0.2/0.140 1/1',colorbalance=rm=-0.048:gm=0.060:bm=0.036,vignette=a=0.660"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.16577, 0.18079, 0.10364, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "eq=saturation=1.000:contrast=1.000,curves=all='0/0 0.2/0.200 1/1',colorbalance=rm=0.000:gm=0.000:bm=0.000,vignette=a=0.000"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44995, 0.3999, 0.3501, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "eq=saturation=0.400:contrast=1.300,curves=all='0/0 0.2/0.100 1/1',colorbalance=rm=-0.080:gm=0.100:bm=0.060,vignette=a=1.100"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.005, 0.00965, 0.00682, 1]
diff --git a/src/crates/concat-effects/packages/concat.super-8/effect.toml b/src/crates/concat-effects/packages/concat.super-8/effect.toml
index 692b4c62..211f983d 100644
--- a/src/crates/concat-effects/packages/concat.super-8/effect.toml
+++ b/src/crates/concat-effects/packages/concat.super-8/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.super-8"
name = "Super 8"
@@ -6,8 +8,6 @@ category = "Film"
order = 62
description = "Faded, warm and grainy: an old home movie run through a projector."
-[ffmpeg]
-chain = "curves=all='0/0.08 1/0.9',colorbalance=rh=0.08:bh=-0.06,noise=alls=8:allf=t"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.super-8/effect.wgsl b/src/crates/concat-effects/packages/concat.super-8/effect.wgsl
index 38afdb21..0c80bfde 100644
--- a/src/crates/concat-effects/packages/concat.super-8/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.super-8/effect.wgsl
@@ -3,5 +3,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
let f = fade(c.rgb, 0.08);
let t = split_tone(f, vec3<f32>(0.0), vec3<f32>(0.08, 0.0, -0.06), 1.0);
let g = grain_at(uv, 0.05);
- return vec4<f32>(clamp01(t + g), c.a);
+ return vec4<f32>(t + g, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.super-8/fixtures.toml b/src/crates/concat-effects/packages/concat.super-8/fixtures.toml
index 264b4706..29203775 100644
--- a/src/crates/concat-effects/packages/concat.super-8/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.super-8/fixtures.toml
@@ -1,3 +1,8 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+# The grain at the middle pixel is format 2's: the same on every GPU.
+
+[[probe]]
name = "default"
-chain = "curves=all='0/0.08 1/0.9',colorbalance=rh=0.08:bh=-0.06,noise=alls=8:allf=t"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.35303, 0.23511, 0.14404, 1]
diff --git a/src/crates/concat-effects/packages/concat.swirl/effect.toml b/src/crates/concat-effects/packages/concat.swirl/effect.toml
index 12d3bf2e..2de7f00d 100644
--- a/src/crates/concat-effects/packages/concat.swirl/effect.toml
+++ b/src/crates/concat-effects/packages/concat.swirl/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.swirl"
name = "Swirl"
diff --git a/src/crates/concat-effects/packages/concat.swirl/fixtures.toml b/src/crates/concat-effects/packages/concat.swirl/fixtures.toml
new file mode 100644
index 00000000..281947ca
--- /dev/null
+++ b/src/crates/concat-effects/packages/concat.swirl/fixtures.toml
@@ -0,0 +1,25 @@
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. A cut from one colour to another, and its middle pixel.
+
+[[probe]]
+name = "default"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.56738, 0.3916, 0.33081, 1]
+
+[[probe]]
+name = "minimum"
+at = "min"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.56738, 0.3916, 0.33081, 1]
+
+[[probe]]
+name = "maximum"
+at = "max"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.56738, 0.3916, 0.33081, 1]
diff --git a/src/crates/concat-effects/packages/concat.teal-orange/effect.toml b/src/crates/concat-effects/packages/concat.teal-orange/effect.toml
index 0bf3ff76..10b20076 100644
--- a/src/crates/concat-effects/packages/concat.teal-orange/effect.toml
+++ b/src/crates/concat-effects/packages/concat.teal-orange/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.teal-orange"
name = "Teal & Orange"
@@ -34,8 +36,6 @@ default = 80
step = 1
unit = "%"
-[ffmpeg]
-chain = "colorbalance=rs={fixed(0 - amount / 100 * 0.12, 3)}:gs={fixed(amount / 100 * 0.04, 3)}:bs={fixed(amount / 100 * 0.16, 3)}:rh={fixed(amount / 100 * 0.16, 3)}:gh={fixed(amount / 100 * 0.04, 3)}:bh={fixed(0 - amount / 100 * 0.12, 3)},eq=contrast={fixed(1 + contrast / 100 * 0.35, 3)}"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.teal-orange/effect.wgsl b/src/crates/concat-effects/packages/concat.teal-orange/effect.wgsl
index c3b5289a..1f0b042c 100644
--- a/src/crates/concat-effects/packages/concat.teal-orange/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.teal-orange/effect.wgsl
@@ -6,5 +6,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
let keep = 1.0 - skin_mask(c.rgb) * params.skin / 100.0;
var out = split_tone(c.rgb, vec3<f32>(-0.12, 0.04, 0.16), vec3<f32>(0.16, 0.04, -0.12), params.amount / 100.0 * keep);
out = film_curve(out, params.contrast / 100.0 * 0.6, params.contrast / 100.0 * 0.5);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.teal-orange/fixtures.toml b/src/crates/concat-effects/packages/concat.teal-orange/fixtures.toml
index d0c536c6..097ff738 100644
--- a/src/crates/concat-effects/packages/concat.teal-orange/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.teal-orange/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "colorbalance=rs=-0.084:gs=0.028:bs=0.112:rh=0.112:gh=0.028:bh=-0.084,eq=contrast=1.087"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.30786, 0.19849, 0.11237, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "colorbalance=rs=0.000:gs=0.000:bs=0.000:rh=0.000:gh=0.000:bh=0.000,eq=contrast=1.000"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44995, 0.3999, 0.3501, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "colorbalance=rs=-0.120:gs=0.040:bs=0.160:rh=0.160:gh=0.040:bh=-0.120,eq=contrast=1.350"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.03, 0.04776, 0.06155, 1]
diff --git a/src/crates/concat-effects/packages/concat.tropical/effect.toml b/src/crates/concat-effects/packages/concat.tropical/effect.toml
index 6fa8d03d..edf356e5 100644
--- a/src/crates/concat-effects/packages/concat.tropical/effect.toml
+++ b/src/crates/concat-effects/packages/concat.tropical/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.tropical"
name = "Tropical"
@@ -6,8 +8,6 @@ category = "Scenery"
order = 60
description = "Saturated and bright, the water pushed teal."
-[ffmpeg]
-chain = "colorbalance=rh=-0.06:gh=0.05:bh=0.08,eq=saturation=1.35:contrast=1.1"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.tropical/effect.wgsl b/src/crates/concat-effects/packages/concat.tropical/effect.wgsl
index f58cb25c..325a26c7 100644
--- a/src/crates/concat-effects/packages/concat.tropical/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.tropical/effect.wgsl
@@ -1,5 +1,5 @@
fn effect(uv: vec2<f32>) -> vec4<f32> {
let c = sample(uv);
let t = split_tone(c.rgb, vec3<f32>(0.0), vec3<f32>(-0.06, 0.05, 0.08), 1.0);
- return vec4<f32>(clamp01(contrast(saturation(t, 1.35), 1.1)), c.a);
+ return vec4<f32>(contrast(saturation(t, 1.35), 1.1), c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.tropical/fixtures.toml b/src/crates/concat-effects/packages/concat.tropical/fixtures.toml
index 5fe092de..cab22fcf 100644
--- a/src/crates/concat-effects/packages/concat.tropical/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.tropical/fixtures.toml
@@ -1,3 +1,7 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "colorbalance=rh=-0.06:gh=0.05:bh=0.08,eq=saturation=1.35:contrast=1.1"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.33789, 0.20288, 0.0943, 1]
diff --git a/src/crates/concat-effects/packages/concat.umber/effect.toml b/src/crates/concat-effects/packages/concat.umber/effect.toml
index 46d11977..56e4e262 100644
--- a/src/crates/concat-effects/packages/concat.umber/effect.toml
+++ b/src/crates/concat-effects/packages/concat.umber/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.umber"
name = "Umber"
@@ -25,8 +27,6 @@ default = 40
step = 1
unit = "%"
-[ffmpeg]
-chain = "colorbalance=rm={fixed(warmth / 100 * 0.1, 3)}:gm={fixed(warmth / 100 * 0.03, 3)}:bm={fixed(0 - warmth / 100 * 0.1, 3)}:rs={fixed(warmth / 100 * 0.04, 3)}:bs={fixed(0 - warmth / 100 * 0.04, 3)},selectivecolor=greens='0 {fixed(warmth / 100 * 0.1, 3)} {fixed(warmth / 100 * 0.2, 3)} {fixed(warmth / 100 * 0.1, 3)}',eq=contrast={fixed(1 - soften / 100 * 0.12, 3)},curves=all='0/{fixed(soften / 100 * 0.05, 3)} 1/1'"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.umber/effect.wgsl b/src/crates/concat-effects/packages/concat.umber/effect.wgsl
index 00924831..e2ecfa9e 100644
--- a/src/crates/concat-effects/packages/concat.umber/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.umber/effect.wgsl
@@ -10,5 +10,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
out = hsl_band(out, 110.0, 60.0, -20.0 * w, 1.0 - w * 0.3, 1.0 - w * 0.08);
out = contrast(out, 1.0 - s * 0.12);
out = matte(out, s * 0.05, 1.0);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.umber/fixtures.toml b/src/crates/concat-effects/packages/concat.umber/fixtures.toml
index 60d4f9b4..15a0bbba 100644
--- a/src/crates/concat-effects/packages/concat.umber/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.umber/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "colorbalance=rm=0.060:gm=0.018:bm=-0.060:rs=0.024:bs=-0.024,selectivecolor=greens='0 0.060 0.120 0.060',eq=contrast=0.952,curves=all='0/0.020 1/1'"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.37183, 0.22437, 0.09515, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "colorbalance=rm=0.000:gm=0.000:bm=0.000:rs=0.000:bs=0.000,selectivecolor=greens='0 0.000 0.000 0.000',eq=contrast=1.000,curves=all='0/0.000 1/1'"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44995, 0.3999, 0.3501, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "colorbalance=rm=0.100:gm=0.030:bm=-0.100:rs=0.040:bs=-0.040,selectivecolor=greens='0 0.100 0.200 0.100',eq=contrast=0.880,curves=all='0/0.050 1/1'"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.1604, 0.11072, 0.05478, 1]
diff --git a/src/crates/concat-effects/packages/concat.vaporwave/effect.toml b/src/crates/concat-effects/packages/concat.vaporwave/effect.toml
index 366b314f..15e2b120 100644
--- a/src/crates/concat-effects/packages/concat.vaporwave/effect.toml
+++ b/src/crates/concat-effects/packages/concat.vaporwave/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.vaporwave"
name = "Vaporwave"
@@ -6,8 +8,6 @@ category = "Vibe"
order = 67
description = "Magenta and cyan pushed hard, a saturated retro-synth cast."
-[ffmpeg]
-chain = "colorbalance=rs=0.1:bs=0.15:rh=0.08:bh=0.12,eq=saturation=1.3"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.vaporwave/effect.wgsl b/src/crates/concat-effects/packages/concat.vaporwave/effect.wgsl
index 3eee5af8..1df711cc 100644
--- a/src/crates/concat-effects/packages/concat.vaporwave/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.vaporwave/effect.wgsl
@@ -1,5 +1,5 @@
fn effect(uv: vec2<f32>) -> vec4<f32> {
let c = sample(uv);
let t = split_tone(c.rgb, vec3<f32>(0.1, 0.0, 0.15), vec3<f32>(0.0, 0.08, 0.12), 1.0);
- return vec4<f32>(clamp01(saturation(t, 1.3)), c.a);
+ return vec4<f32>(saturation(t, 1.3), c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.vaporwave/fixtures.toml b/src/crates/concat-effects/packages/concat.vaporwave/fixtures.toml
index 6df6b8a4..28e4f071 100644
--- a/src/crates/concat-effects/packages/concat.vaporwave/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.vaporwave/fixtures.toml
@@ -1,3 +1,7 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "colorbalance=rs=0.1:bs=0.15:rh=0.08:bh=0.12,eq=saturation=1.3"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.3335, 0.20471, 0.1131, 1]
diff --git a/src/crates/concat-effects/packages/concat.vhs/effect.toml b/src/crates/concat-effects/packages/concat.vhs/effect.toml
index cdb6d851..5c021252 100644
--- a/src/crates/concat-effects/packages/concat.vhs/effect.toml
+++ b/src/crates/concat-effects/packages/concat.vhs/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.vhs"
name = "VHS"
@@ -25,8 +27,6 @@ default = 50
step = 1
unit = "%"
-[ffmpeg]
-chain = "chromashift=crh={round(0 - bleed / 100 * 6)}:cbh={round(bleed / 100 * 6)},gblur=sigma={fixed(0.2 + bleed / 100 * 0.8, 2)},eq=saturation=1.3,noise=alls={round(lines / 100 * 20)}:allf=t"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.vhs/effect.wgsl b/src/crates/concat-effects/packages/concat.vhs/effect.wgsl
index d344ce7e..49e17a58 100644
--- a/src/crates/concat-effects/packages/concat.vhs/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.vhs/effect.wgsl
@@ -15,5 +15,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
let row = fract(uv.y * frame.size.y / 3.0);
out = out * (1.0 - lines * 0.25 * step(0.5, row));
out = out + grain_at(uv, lines * 0.08);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.vhs/fixtures.toml b/src/crates/concat-effects/packages/concat.vhs/fixtures.toml
index 376f9f19..b3657234 100644
--- a/src/crates/concat-effects/packages/concat.vhs/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.vhs/fixtures.toml
@@ -1,13 +1,20 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+# The grain at the middle pixel is format 2's: the same on every GPU.
+
+[[probe]]
name = "default"
-chain = "chromashift=crh=-4:cbh=4,gblur=sigma=0.68,eq=saturation=1.3,noise=alls=10:allf=t"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.23657, 0.14038, 0.06976, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "chromashift=crh=0:cbh=0,gblur=sigma=0.20,eq=saturation=1.3,noise=alls=0:allf=t"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.46338, 0.39771, 0.33398, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "chromashift=crh=-6:cbh=6,gblur=sigma=1.00,eq=saturation=1.3,noise=alls=20:allf=t"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.03946, 0.03308, 0.02687, 1]
diff --git a/src/crates/concat-effects/packages/concat.vibrance/effect.toml b/src/crates/concat-effects/packages/concat.vibrance/effect.toml
index c21fb091..72be76c6 100644
--- a/src/crates/concat-effects/packages/concat.vibrance/effect.toml
+++ b/src/crates/concat-effects/packages/concat.vibrance/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.vibrance"
name = "Vibrance"
@@ -19,8 +21,6 @@ max = 2
default = 0.7
step = 0.05
-[ffmpeg]
-chain = "vibrance=intensity={fixed(amount, 2)}"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.vibrance/effect.wgsl b/src/crates/concat-effects/packages/concat.vibrance/effect.wgsl
index c48449ef..331da5b5 100644
--- a/src/crates/concat-effects/packages/concat.vibrance/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.vibrance/effect.wgsl
@@ -6,5 +6,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
let c = sample(uv);
let boosted = vibrance(c.rgb, params.amount);
let out = mix(boosted, c.rgb, skin_mask(c.rgb) * 0.6);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.vibrance/fixtures.toml b/src/crates/concat-effects/packages/concat.vibrance/fixtures.toml
index d6ffbaaf..377cccec 100644
--- a/src/crates/concat-effects/packages/concat.vibrance/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.vibrance/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "vibrance=intensity=0.70"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.3269, 0.19666, 0.09998, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "vibrance=intensity=0.10"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.45361, 0.39917, 0.34546, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "vibrance=intensity=2.00"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.0976, 0.06763, 0.04205, 1]
diff --git a/src/crates/concat-effects/packages/concat.vintage/effect.toml b/src/crates/concat-effects/packages/concat.vintage/effect.toml
index d9eb2f8c..8556760c 100644
--- a/src/crates/concat-effects/packages/concat.vintage/effect.toml
+++ b/src/crates/concat-effects/packages/concat.vintage/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.vintage"
name = "Vintage"
@@ -25,8 +27,6 @@ default = 50
step = 1
unit = "%"
-[ffmpeg]
-chain = "curves=all='0/{fixed(age / 100 * 0.12, 3)} 1/{fixed(1 - age / 100 * 0.06, 3)}',eq=saturation={fixed(1 - age / 100 * 0.35, 3)}:contrast={fixed(1 - age / 100 * 0.1, 3)},selectivecolor=greens='0 0 {fixed(tint / 100 * 0.4, 3)} 0':cyans='0 0 {fixed(tint / 100 * 0.2, 3)} 0',colorbalance=rm={fixed(tint / 100 * 0.05, 3)}:bm={fixed(0 - tint / 100 * 0.08, 3)},vignette=a={fixed(age / 100 * 0.5, 3)}"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.vintage/effect.wgsl b/src/crates/concat-effects/packages/concat.vintage/effect.wgsl
index 0df96b42..83a306e5 100644
--- a/src/crates/concat-effects/packages/concat.vintage/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.vintage/effect.wgsl
@@ -11,5 +11,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
out = hsl_band(out, 120.0, 70.0, -35.0 * t, 1.0 - t * 0.1, 1.0);
out = tint_midtones(out, vec3<f32>(0.05, 0.03, -0.08), t);
out = vignette(out, uv, age * 0.4);
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.vintage/fixtures.toml b/src/crates/concat-effects/packages/concat.vintage/fixtures.toml
index 84110f01..18c31914 100644
--- a/src/crates/concat-effects/packages/concat.vintage/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.vintage/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "curves=all='0/0.072 1/0.964',eq=saturation=0.790:contrast=0.940,selectivecolor=greens='0 0 0.200 0':cyans='0 0 0.100 0',colorbalance=rm=0.025:bm=-0.040,vignette=a=0.300"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.3103, 0.23047, 0.12952, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "curves=all='0/0.000 1/1.000',eq=saturation=1.000:contrast=1.000,selectivecolor=greens='0 0 0.000 0':cyans='0 0 0.000 0',colorbalance=rm=0.000:bm=0.000,vignette=a=0.000"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44995, 0.3999, 0.3501, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "curves=all='0/0.120 1/0.940',eq=saturation=0.650:contrast=0.900,selectivecolor=greens='0 0 0.400 0':cyans='0 0 0.200 0',colorbalance=rm=0.050:bm=-0.080,vignette=a=0.500"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.14844, 0.12939, 0.06879, 1]
diff --git a/src/crates/concat-effects/packages/concat.vivid/effect.toml b/src/crates/concat-effects/packages/concat.vivid/effect.toml
index ec302c82..774fe403 100644
--- a/src/crates/concat-effects/packages/concat.vivid/effect.toml
+++ b/src/crates/concat-effects/packages/concat.vivid/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.vivid"
name = "Vivid"
@@ -25,8 +27,6 @@ default = 50
step = 1
unit = "%"
-[ffmpeg]
-chain = "eq=contrast={fixed(1 + punch / 100 * 0.35, 3)},vibrance=intensity={fixed(colour / 100 * 1.4, 3)},unsharp=5:5:{fixed(punch / 100 * 0.7, 3)}"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.vivid/effect.wgsl b/src/crates/concat-effects/packages/concat.vivid/effect.wgsl
index 03748ed7..846e2027 100644
--- a/src/crates/concat-effects/packages/concat.vivid/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.vivid/effect.wgsl
@@ -8,5 +8,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
var out = s_curve(c.rgb, punch * 0.7);
out = mix(out, vibrance(out, params.colour / 100.0 * 1.4), keep);
out = out + (c.rgb - soften(uv, 2.0)) * punch * 0.7;
- return vec4<f32>(clamp01(out), c.a);
+ return vec4<f32>(out, c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.vivid/fixtures.toml b/src/crates/concat-effects/packages/concat.vivid/fixtures.toml
index 8cddd7d2..985c8b12 100644
--- a/src/crates/concat-effects/packages/concat.vivid/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.vivid/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "eq=contrast=1.175,vibrance=intensity=0.840,unsharp=5:5:0.350"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.35938, 0.19727, 0.0849, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "eq=contrast=1.000,vibrance=intensity=0.000,unsharp=5:5:0.000"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.44995, 0.3999, 0.3501, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "eq=contrast=1.350,vibrance=intensity=1.400,unsharp=5:5:0.700"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.06842, 0.04456, 0.02547, 1]
diff --git a/src/crates/concat-effects/packages/concat.warm/effect.toml b/src/crates/concat-effects/packages/concat.warm/effect.toml
index 5f6ab1db..c41e6f66 100644
--- a/src/crates/concat-effects/packages/concat.warm/effect.toml
+++ b/src/crates/concat-effects/packages/concat.warm/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.warm"
name = "Warm"
@@ -17,8 +19,6 @@ default = 4600
step = 50
unit = "K"
-[ffmpeg]
-chain = "colortemperature=temperature={round(temperature)}:pl=1"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.warm/effect.wgsl b/src/crates/concat-effects/packages/concat.warm/effect.wgsl
index 0d0b9ecb..87f325b1 100644
--- a/src/crates/concat-effects/packages/concat.warm/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.warm/effect.wgsl
@@ -3,5 +3,5 @@ struct Params { temperature: f32 }
// White balance toward candlelight, brightness held.
fn effect(uv: vec2<f32>) -> vec4<f32> {
let c = sample(uv);
- return vec4<f32>(clamp01(white_balance(c.rgb, params.temperature)), c.a);
+ return vec4<f32>(white_balance(c.rgb, params.temperature), c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.warm/fixtures.toml b/src/crates/concat-effects/packages/concat.warm/fixtures.toml
index 81757f03..9178f0ad 100644
--- a/src/crates/concat-effects/packages/concat.warm/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.warm/fixtures.toml
@@ -1,13 +1,19 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "colortemperature=temperature=4600:pl=1"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.40088, 0.18835, 0.08435, 1]
-[[case]]
+[[probe]]
name = "minimum"
at = "min"
-chain = "colortemperature=temperature=3000:pl=1"
+input = [0.45, 0.4, 0.35, 1]
+expect = [0.91748, 0.34326, 0.0993, 1]
-[[case]]
+[[probe]]
name = "maximum"
at = "max"
-chain = "colortemperature=temperature=6000:pl=1"
+input = [0.08, 0.07, 0.06, 1]
+expect = [0.08527, 0.06909, 0.05612, 1]
diff --git a/src/crates/concat-effects/packages/concat.whip-pan/effect.toml b/src/crates/concat-effects/packages/concat.whip-pan/effect.toml
index ccd2fee1..c17bcf1e 100644
--- a/src/crates/concat-effects/packages/concat.whip-pan/effect.toml
+++ b/src/crates/concat-effects/packages/concat.whip-pan/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.whip-pan"
name = "Whip Pan"
diff --git a/src/crates/concat-effects/packages/concat.whip-pan/fixtures.toml b/src/crates/concat-effects/packages/concat.whip-pan/fixtures.toml
new file mode 100644
index 00000000..f5880c66
--- /dev/null
+++ b/src/crates/concat-effects/packages/concat.whip-pan/fixtures.toml
@@ -0,0 +1,25 @@
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. A cut from one colour to another, and its middle pixel.
+
+[[probe]]
+name = "default"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.7998, 0.5, 0.30005, 1]
+
+[[probe]]
+name = "minimum"
+at = "min"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.7998, 0.5, 0.30005, 1]
+
+[[probe]]
+name = "maximum"
+at = "max"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.7998, 0.5, 0.30005, 1]
diff --git a/src/crates/concat-effects/packages/concat.winter-cool/effect.toml b/src/crates/concat-effects/packages/concat.winter-cool/effect.toml
index 2300ba9b..a68be447 100644
--- a/src/crates/concat-effects/packages/concat.winter-cool/effect.toml
+++ b/src/crates/concat-effects/packages/concat.winter-cool/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.winter-cool"
name = "Winter Cool"
@@ -6,8 +8,6 @@ category = "Scenery"
order = 59
description = "Desaturated and blue, the blacks lifted to a matte wintry haze."
-[ffmpeg]
-chain = "colortemperature=temperature=8800:pl=1,curves=all='0/0.06 1/0.95',eq=saturation=0.8"
-
[wgsl]
entry = "effect.wgsl"
+space = "display"
diff --git a/src/crates/concat-effects/packages/concat.winter-cool/effect.wgsl b/src/crates/concat-effects/packages/concat.winter-cool/effect.wgsl
index b3f5b91b..5d3637e3 100644
--- a/src/crates/concat-effects/packages/concat.winter-cool/effect.wgsl
+++ b/src/crates/concat-effects/packages/concat.winter-cool/effect.wgsl
@@ -2,5 +2,5 @@ fn effect(uv: vec2<f32>) -> vec4<f32> {
let c = sample(uv);
let wb = white_balance(c.rgb, 8800.0);
let f = fade(wb, 0.06);
- return vec4<f32>(clamp01(saturation(f, 0.8)), c.a);
+ return vec4<f32>(saturation(f, 0.8), c.a);
}
diff --git a/src/crates/concat-effects/packages/concat.winter-cool/fixtures.toml b/src/crates/concat-effects/packages/concat.winter-cool/fixtures.toml
index 910ca6b3..0cf4561d 100644
--- a/src/crates/concat-effects/packages/concat.winter-cool/fixtures.toml
+++ b/src/crates/concat-effects/packages/concat.winter-cool/fixtures.toml
@@ -1,3 +1,7 @@
-[[case]]
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. Pinned from the format 1 shader, so the look is what it was.
+
+[[probe]]
name = "default"
-chain = "colortemperature=temperature=8800:pl=1,curves=all='0/0.06 1/0.95',eq=saturation=0.8"
+input = [0.3, 0.2, 0.12, 1]
+expect = [0.27856, 0.23108, 0.2063, 1]
diff --git a/src/crates/concat-effects/packages/concat.zoom-blur-transition/effect.toml b/src/crates/concat-effects/packages/concat.zoom-blur-transition/effect.toml
index 60d200ba..24bc10e0 100644
--- a/src/crates/concat-effects/packages/concat.zoom-blur-transition/effect.toml
+++ b/src/crates/concat-effects/packages/concat.zoom-blur-transition/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.zoom-blur-transition"
name = "Zoom Blur"
diff --git a/src/crates/concat-effects/packages/concat.zoom-blur-transition/fixtures.toml b/src/crates/concat-effects/packages/concat.zoom-blur-transition/fixtures.toml
new file mode 100644
index 00000000..0ebb7187
--- /dev/null
+++ b/src/crates/concat-effects/packages/concat.zoom-blur-transition/fixtures.toml
@@ -0,0 +1,25 @@
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. A cut from one colour to another, and its middle pixel.
+
+[[probe]]
+name = "default"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.52197, 0.37036, 0.33691, 1]
+
+[[probe]]
+name = "minimum"
+at = "min"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.52197, 0.37036, 0.33691, 1]
+
+[[probe]]
+name = "maximum"
+at = "max"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.52197, 0.37036, 0.33691, 1]
diff --git a/src/crates/concat-effects/packages/concat.zoom-transition/effect.toml b/src/crates/concat-effects/packages/concat.zoom-transition/effect.toml
index b39f2058..80228c1c 100644
--- a/src/crates/concat-effects/packages/concat.zoom-transition/effect.toml
+++ b/src/crates/concat-effects/packages/concat.zoom-transition/effect.toml
@@ -1,3 +1,5 @@
+format = 2
+
[effect]
id = "concat.zoom-transition"
name = "Zoom"
diff --git a/src/crates/concat-effects/packages/concat.zoom-transition/fixtures.toml b/src/crates/concat-effects/packages/concat.zoom-transition/fixtures.toml
new file mode 100644
index 00000000..281947ca
--- /dev/null
+++ b/src/crates/concat-effects/packages/concat.zoom-transition/fixtures.toml
@@ -0,0 +1,25 @@
+# Colours in the working space: linear light, 1.0 the white of an SDR
+# picture. A cut from one colour to another, and its middle pixel.
+
+[[probe]]
+name = "default"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.56738, 0.3916, 0.33081, 1]
+
+[[probe]]
+name = "minimum"
+at = "min"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.56738, 0.3916, 0.33081, 1]
+
+[[probe]]
+name = "maximum"
+at = "max"
+input = [0.8, 0.5, 0.3, 1]
+to = [0.05, 0.15, 0.4, 1]
+progress = 0.37
+expect = [0.56738, 0.3916, 0.33081, 1]
diff --git a/src/crates/concat-effects/src/catalogue.rs b/src/crates/concat-effects/src/catalogue.rs
index b07f601c..0f663a6d 100644
--- a/src/crates/concat-effects/src/catalogue.rs
+++ b/src/crates/concat-effects/src/catalogue.rs
@@ -127,10 +127,12 @@ pub struct Fixture {
/// One pinned colour from `fixtures.toml`'s `[[probe]]`s: a picture of one
/// colour through the package's shader at these parameters comes out as
-/// this colour. Both are in the compositor's working space - linear light,
-/// 1.0 the white of an SDR picture - and the check is made on a GPU, where
-/// the shader runs: concat-render's suite for the built-ins, `concat-cli
-/// check` for anyone's.
+/// this colour - or, for a transition, a cut from a picture of one colour
+/// to a picture of another, at one point of it. Every colour is in the
+/// compositor's working space - linear light, 1.0 the white of an SDR
+/// picture - and the check is made on a GPU, where the shader runs:
+/// concat-render's suite for the built-ins, `concat-cli check` for
+/// anyone's.
#[derive(Deserialize, Clone, PartialEq, Debug)]
#[serde(deny_unknown_fields)]
pub struct Probe {
@@ -143,8 +145,15 @@ pub struct Probe {
/// Parameters set on top of `at`, a filter's `intensity` among them.
#[serde(default)]
pub params: BTreeMap<String, f64>,
- /// The colour of every pixel going in, straight RGBA.
+ /// The colour of every pixel going in, straight RGBA: a transition's
+ /// outgoing picture.
pub input: [f32; 4],
+ /// A transition's incoming picture, and nothing else's.
+ #[serde(default)]
+ pub to: Option<[f32; 4]>,
+ /// How far through a transition's cut, `0..=1`, and nothing else's.
+ #[serde(default)]
+ pub progress: Option<f32>,
/// The colour the middle pixel must come out as.
pub expect: [f32; 4],
/// How far a channel may land from `expect`, as a fraction of the
@@ -345,13 +354,26 @@ impl Package {
(file.cases, file.probes)
}
};
- if !probes.is_empty() && shader.is_none() {
+ if !probes.is_empty() && shader.is_none() && transition.is_none() {
return Err(invalid(
- "fixtures: a [[probe]] pins what a [wgsl] shader draws, and the package has none"
+ "fixtures: a [[probe]] pins what a shader draws, and the package has none"
.to_owned(),
));
}
for (n, probe) in probes.iter().enumerate() {
+ let cut = probe.to.is_some() || probe.progress.is_some();
+ if transition.is_some() && (probe.to.is_none() || probe.progress.is_none()) {
+ return Err(invalid(format!(
+ "fixtures: probe `{}` of a transition needs `to` and `progress`",
+ probe.label(n)
+ )));
+ }
+ if transition.is_none() && cut {
+ return Err(invalid(format!(
+ "fixtures: probe `{}` sets `to` or `progress`, which only a transition has",
+ probe.label(n)
+ )));
+ }
let filter = manifest.effect.kind == Kind::Filter;
if let Some(key) = probe
.params
@@ -568,6 +590,19 @@ impl Package {
self.pass(&self.set_at(probe.at, &probe.params), None)
}
+ /// The combine a transition's probe checks, at its progress. None for
+ /// a package that is not a transition.
+ pub fn probe_transition(&self, probe: &Probe) -> Option<TransitionPass> {
+ let shader = self.transition.as_ref()?;
+ let values = self.resolve(&self.set_at(probe.at, &probe.params));
+ Some(shader.pass(
+ &values,
+ &self.manifest.params,
+ probe.progress.unwrap_or(0.0).clamp(0.0, 1.0),
+ self.lut.clone(),
+ ))
+ }
+
/// The shader, when the package renders on the GPU.
pub fn shader(&self) -> Option<&Shader> {
self.shader.as_ref()
diff --git a/src/crates/concat-effects/src/lib.rs b/src/crates/concat-effects/src/lib.rs
index 217edd1f..27100209 100644
--- a/src/crates/concat-effects/src/lib.rs
+++ b/src/crates/concat-effects/src/lib.rs
@@ -37,7 +37,7 @@ mod builtins {
}
pub use catalogue::{At, Catalogue, Fixture, Package, Probe, package_folders, package_stamp};
-pub use manifest::{FORMAT, Kind, Manifest, Param, ParamType};
+pub use manifest::{FORMAT, Kind, Manifest, Param, ParamType, Space};
pub use shader::{Contract, Shader, TransitionShader};
/// Why a package could not be loaded.
@@ -87,12 +87,25 @@ mod tests {
/// never mixes: intensity is a filter's word.
#[test]
fn a_filter_mixes_by_its_intensity_and_an_effect_does_not() {
- let catalogue = Catalogue::builtin();
- let full = catalogue.video_chain(&[applied("concat.warm", &[])]);
+ // A format 1 look of someone's own: the built-in looks are shaders
+ // alone.
+ let mut catalogue = Catalogue::builtin().clone();
+ catalogue
+ .add(
+ Package::from_sources(
+ "[effect]\nid = \"alice.warm\"\nname = \"Warm\"\nkind = \"filter\"\n\
+ [ffmpeg]\nchain = \"colortemperature=temperature=4600:pl=1\"\n",
+ None,
+ None,
+ )
+ .expect("loads"),
+ )
+ .expect("a new id");
+ let full = catalogue.video_chain(&[applied("alice.warm", &[])]);
assert_eq!(full, "colortemperature=temperature=4600:pl=1");
let half = catalogue.video_chain(&[
applied("concat.sepia", &[]),
- applied("concat.warm", &[("intensity", 50.0)]),
+ applied("alice.warm", &[("intensity", 50.0)]),
]);
assert!(half.starts_with("colorchannelmixer"), "{half}");
assert!(
@@ -201,7 +214,8 @@ mod tests {
let mut gaps = Vec::new();
let mut linear = 0;
for package in Catalogue::builtin().packages() {
- if !package.manifest.scene_linear() || package.shader().is_none() {
+ let drawn = package.shader().is_some() || package.transition().is_some();
+ if !package.manifest.scene_linear() || !drawn {
continue;
}
linear += 1;
@@ -268,7 +282,41 @@ mod tests {
let error = Package::from_sources(TINT, Some(&probe("hue = 1")), None)
.expect_err("a chain has no shader to probe")
.to_string();
- assert!(error.contains("[wgsl]"), "{error}");
+ assert!(
+ error.contains("no shader") || error.contains("has none"),
+ "{error}"
+ );
+ let error = Package::from_sources(
+ EXPOSED,
+ Some(&probe("stops = 1").replace("[[probe]]", "[[probe]]\nprogress = 0.5")),
+ Some(EXPOSE),
+ )
+ .expect_err("an effect has no cut")
+ .to_string();
+ assert!(error.contains("only a transition"), "{error}");
+ }
+
+ /// A transition's probe is a cut between two colours at one point of
+ /// it, so it names both and the point.
+ #[test]
+ fn a_transition_probe_names_its_cut() {
+ const CUT: &str = "format = 2\n[effect]\nid = \"a.cut\"\nname = \"Cut\"\nkind = \"transition\"\n[transition]\nentry = \"effect.wgsl\"\n";
+ const MIX: &str = "fn transition(uv: vec2<f32>, progress: f32) -> vec4<f32> { return mix(from_at(uv), to_at(uv), progress); }";
+ let probe = "[[probe]]\ninput = [1, 1, 1, 1]\nto = [0, 0, 0, 1]\nprogress = 0.25\nexpect = [0.75, 0.75, 0.75, 1]\n";
+ let package = Package::from_sources(CUT, Some(probe), Some(MIX)).expect("loads");
+ let pass = package
+ .probe_transition(&package.probes[0])
+ .expect("a transition's combine");
+ assert_eq!(pass.progress, 0.25);
+ assert!(package.probe_pass(&package.probes[0]).is_none());
+ let error = Package::from_sources(
+ CUT,
+ Some(&probe.replace("progress = 0.25\n", "")),
+ Some(MIX),
+ )
+ .expect_err("no progress")
+ .to_string();
+ assert!(error.contains("`to` and `progress`"), "{error}");
}
/// A probe allows a fraction of the expected value, with a floor near
@@ -280,6 +328,8 @@ mod tests {
at: At::Default,
params: BTreeMap::new(),
input: [0.0; 4],
+ to: None,
+ progress: None,
expect: [2.0, 0.5, 0.0, 1.0],
tolerance: 0.01,
};
diff --git a/src/crates/concat-effects/src/manifest.rs b/src/crates/concat-effects/src/manifest.rs
index ec60f198..dc331b45 100644
--- a/src/crates/concat-effects/src/manifest.rs
+++ b/src/crates/concat-effects/src/manifest.rs
@@ -220,6 +220,26 @@ pub struct Wgsl {
/// Render passes, in order. Empty means one pass to the output.
#[serde(default, rename = "pass")]
pub passes: Vec<Pass>,
+ /// What a format 2 shader works in; see [`Space`].
+ #[serde(default)]
+ pub space: Space,
+}
+
+/// What a format 2 shader's `sample()` hands it, and what its result is
+/// read back as.
+#[derive(Deserialize, Clone, Copy, PartialEq, Eq, Debug, Default)]
+#[serde(rename_all = "lowercase")]
+pub enum Space {
+ /// The working space as it is: linear light, 1.0 the white of an SDR
+ /// picture. Where light is added, scaled, blurred or keyed.
+ #[default]
+ Linear,
+ /// The display encoding: BT.1886's 2.4 gamma over the working space,
+ /// SDR white at 1.0, but extended - a highlight climbs past 1.0 and a
+ /// colour outside Rec. 709 keeps its negative channel - and nothing
+ /// clipped. Where a colour look drawn by eye on an SDR picture reads as
+ /// it was drawn; its result is taken back into light and mixed there.
+ Display,
}
/// The `[transition]` table: a two-input shader that combines the outgoing
@@ -481,6 +501,15 @@ impl Manifest {
if self.wgsl.is_some() && self.effect.kind == Kind::Audio {
return Err(self.invalid("a [wgsl] package cannot be audio"));
}
+ if let Some(wgsl) = &self.wgsl
+ && wgsl.space != Space::Linear
+ && !self.scene_linear()
+ {
+ return Err(self.invalid(format!(
+ "[wgsl] space is a format {SCENE_LINEAR} setting: a format 1 shader \
+ is handed the gamma-encoded 0..1 picture already"
+ )));
+ }
// The picture is drawn on the GPU, in light, and nowhere else:
// a chain would run on eight bits the shader never sees.
if self.scene_linear() && self.effect.kind.is_visual() && self.ffmpeg.is_some() {
@@ -609,6 +638,23 @@ mod tests {
rejects(&format!("format = \"1\"\n{GOOD}"), "format");
}
+ /// A shader may work in the display encoding from format 2, where the
+ /// host has one to hand it.
+ #[test]
+ fn a_display_space_is_a_format_2_setting() {
+ let display = GOOD.replace(
+ "[ffmpeg]\n chain = \"gblur=sigma={fixed(radius, 1)}\"",
+ "[wgsl]\n entry = \"effect.wgsl\"\n space = \"display\"",
+ );
+ let manifest = Manifest::parse(&format!("format = 2\n{display}")).expect("parses");
+ assert_eq!(manifest.wgsl.map(|wgsl| wgsl.space), Some(Space::Display));
+ rejects(&display, "format 2 setting");
+ rejects(
+ &format!("format = 2\n{}", display.replace("\"display\"", "\"log\"")),
+ "unknown variant",
+ );
+ }
+
/// From format 2 a picture is drawn on the GPU alone, so a chain beside
/// the shader is refused; sound is FFmpeg's, and keeps its chain.
#[test]
diff --git a/src/crates/concat-effects/src/shader.rs b/src/crates/concat-effects/src/shader.rs
index 9b55dc66..d2abb45d 100644
--- a/src/crates/concat-effects/src/shader.rs
+++ b/src/crates/concat-effects/src/shader.rs
@@ -11,15 +11,19 @@
//! and is stitched on here so every package shares one contract and no
//! package can bind things differently.
//!
-//! The contract has two editions, chosen by the manifest's `format`
-//! ([`Contract`]). From format 2 a shader samples the compositor's working
-//! space as it is - linear light, unclipped, 1.0 the white of an SDR
-//! picture - and is given the scene-linear library: exposure in stops, a
-//! log space for what the eye judges, contrast and saturation that never
-//! clip. A format 1 shader, written before the working space was linear,
-//! is handed the gamma-encoded `0..1` picture it expects and the
-//! display-referred grading library it was written against, and its
-//! result is taken back into light, so it looks as it always did.
+//! The contract comes in editions, chosen by the manifest's `format` and
+//! its `[wgsl]` space ([`Contract`]). From format 2 a shader samples the
+//! compositor's working space as it is - linear light, unclipped, 1.0 the
+//! white of an SDR picture - and is given the scene-linear library:
+//! exposure in stops, a log space for what the eye judges, contrast and
+//! saturation that never clip. A format 2 look that asks for the display
+//! space is handed the same picture in the display encoding, still
+//! unclipped, with the grading helpers it was drawn with made safe past
+//! white, and its result is taken back into light before it is mixed. A
+//! format 1 shader, written before the working space was linear, is
+//! handed the gamma-encoded `0..1` picture it expects and the library it
+//! was written against, and its result is taken back into light, so it
+//! looks as it always did.
//!
//! The stitched module is parsed and validated when the package loads, the
//! same way a chain template is, so a broken shader is a load error and not
@@ -33,7 +37,7 @@ use std::sync::Arc;
use concat_core::{Lut, RevealMap, ShaderPass, TransitionPass};
-use crate::manifest::{Manifest, Param, ParamType};
+use crate::manifest::{Manifest, Param, ParamType, Space};
/// What an effect's shader binds: the layer at group 0, the host's frame
/// block and the package's own parameters at group 1, its table at group 2
@@ -96,6 +100,18 @@ fn sample(uv: vec2<f32>) -> vec4<f32> {
}
"#;
+/// An effect's `sample` under the scene-linear contract in the display
+/// space.
+const EFFECT_SAMPLE_DISPLAY: &str = r#"
+/// The layer's colour at `uv`, straight alpha, in the display encoding
+/// (see `to_display`): the picture a look drawn by eye on an SDR display
+/// reads, not clipped at white.
+fn sample(uv: vec2<f32>) -> vec4<f32> {
+ let c = textureSample(source, source_sampler, uv);
+ return vec4<f32>(to_display(c.rgb), c.a);
+}
+"#;
+
/// What a transition's shader binds: the outgoing picture and the incoming
/// one at group 0, the frame block - its spare slot the progress - and the
/// parameters at group 1, the table at group 2, and no reveal map.
@@ -155,7 +171,7 @@ fn to_at(uv: vec2<f32>) -> vec4<f32> {
/// What every shader is given whatever it is and whichever contract it
/// keeps: they read only the frame's size and the table, which both heads
-/// declare.
+/// declare. (`hash` is each edition's own: see the libraries.)
const BASICS: &str = r#"
/// One pixel, as a fraction of the layer.
fn texel() -> vec2<f32> {
@@ -175,12 +191,6 @@ fn lut(rgb: vec3<f32>) -> vec3<f32> {
let uvw = clamp(rgb, vec3<f32>(0.0), vec3<f32>(1.0)) * (n - 1.0) / n + vec3<f32>(0.5 / n);
return textureSampleLevel(lut_texture, lut_sampler, uvw, 0.0).rgb;
}
-
-/// A hash in 0..1 from a point and a seed, for grain and dither.
-fn hash(p: vec2<f32>, seed: f32) -> f32 {
- let q = vec3<f32>(p, seed);
- return fract(sin(dot(q, vec3<f32>(12.9898, 78.233, 37.719))) * 43758.5453);
-}
"#;
/// The format 1 library: the way into and out of the gamma-encoded picture
@@ -204,6 +214,12 @@ fn legacy_in(colour: vec4<f32>) -> vec4<f32> {
fn legacy_out(colour: vec4<f32>) -> vec4<f32> {
return vec4<f32>(pow(max(colour.rgb, vec3<f32>(0.0)), vec3<f32>(2.4)), colour.a);
}
+
+/// A hash in 0..1 from a point and a seed, for grain and dither.
+fn hash(p: vec2<f32>, seed: f32) -> f32 {
+ let q = vec3<f32>(p, seed);
+ return fract(sin(dot(q, vec3<f32>(12.9898, 78.233, 37.719))) * 43758.5453);
+}
//
// Every look is a few of these in different amounts, so they live here,
// once, rather than in each package. Each has an FFmpeg twin a manifest's
@@ -469,6 +485,306 @@ fn edge_at(uv: vec2<f32>) -> f32 {
}
"#;
+/// The display-space library (format 2, `space = "display"`): the grading
+/// helpers the looks are built from, safe past white.
+const DISPLAY_LIBRARY: &str = r#"
+// ── the display-space library (format 2, `space = "display"`) ──
+//
+// A look drawn by eye on an SDR picture is maths on the display encoding,
+// and this is the format 1 grading library for it, with one difference:
+// nothing clips. Between black and white every helper computes what its
+// format 1 twin did, so a look ported here reads as it did on SDR; past
+// white a curve carries a highlight on rather than bending it back, and a
+// blend treats it as the brightest thing there.
+
+/// `over` screened onto `base`: both inverted, multiplied, inverted back -
+/// light added the way two projectors add it. A level of `base` beyond
+/// white stays beyond it by as much.
+fn screen(base: vec3<f32>, over: vec3<f32>) -> vec3<f32> {
+ let b = min(base, vec3<f32>(1.0));
+ return vec3<f32>(1.0) - (vec3<f32>(1.0) - b) * (vec3<f32>(1.0) - over) + (base - b);
+}
+
+/// Saturation about luminance: 1 as shot, 0 grey, above 1 richer.
+fn saturation(rgb: vec3<f32>, amount: f32) -> vec3<f32> {
+ return mix(vec3<f32>(luma(rgb)), rgb, amount);
+}
+
+/// Vibrance: the muted colours saturated more than the vivid ones, so a
+/// face does not go orange before a sky goes blue. 0 as shot.
+fn vibrance(rgb: vec3<f32>, amount: f32) -> vec3<f32> {
+ let mx = max(max(rgb.r, rgb.g), rgb.b);
+ let mn = min(min(rgb.r, rgb.g), rgb.b);
+ return saturation(rgb, 1.0 + amount * max(1.0 - (mx - mn), 0.0));
+}
+
+/// Contrast about middle grey (0.5 here, 0.19 of the light): 1 as shot.
+fn contrast(rgb: vec3<f32>, amount: f32) -> vec3<f32> {
+ return (rgb - vec3<f32>(0.5)) * amount + vec3<f32>(0.5);
+}
+
+/// An S-curve: shadows down, highlights up, the midtones held. 0 as shot,
+/// 1 the whole curve. The curve spans black to white; beyond them a level
+/// is left where it is, so a highlight is not bent back down.
+fn s_curve(rgb: vec3<f32>, amount: f32) -> vec3<f32> {
+ let c = clamp(rgb, vec3<f32>(0.0), vec3<f32>(1.0));
+ return mix(c, c * c * (vec3<f32>(3.0) - 2.0 * c), amount) + (rgb - c);
+}
+
+/// A fade: the blacks lifted to `lift` and the rest compressed to fit,
+/// which is what an old print and every faded look does.
+fn fade(rgb: vec3<f32>, lift: f32) -> vec3<f32> {
+ return rgb * (1.0 - lift) + vec3<f32>(lift);
+}
+
+/// Lift, gamma, gain: the three-way grade. Lift moves the shadows, gain
+/// scales the highlights, gamma bends the midtones; (0, 1, 1) in every
+/// channel is as shot.
+fn lift_gamma_gain(rgb: vec3<f32>, lift: vec3<f32>, gamma: vec3<f32>, gain: vec3<f32>) -> vec3<f32> {
+ let lifted = rgb * (vec3<f32>(1.0) - lift) + lift;
+ let gained = max(lifted * gain, vec3<f32>(0.0));
+ return pow(gained, vec3<f32>(1.0) / max(gamma, vec3<f32>(0.01)));
+}
+
+/// How much of a pixel is shadow, highlight or midtone, by luminance:
+/// the weights a tint on one end of the picture and not the other needs.
+fn shadows(rgb: vec3<f32>) -> f32 {
+ return 1.0 - smoothstep(0.0, 0.6, luma(rgb));
+}
+fn highlights(rgb: vec3<f32>) -> f32 {
+ return smoothstep(0.4, 1.0, luma(rgb));
+}
+fn midtones(rgb: vec3<f32>) -> f32 {
+ return 1.0 - min(abs(luma(rgb) - 0.5) * 2.0, 1.0);
+}
+
+/// A split tone: one tint into the shadows and another into the
+/// highlights, each a signed offset per channel, so zero is as shot.
+fn split_tone(rgb: vec3<f32>, shadow: vec3<f32>, highlight: vec3<f32>, amount: f32) -> vec3<f32> {
+ return rgb + (shadow * shadows(rgb) + highlight * highlights(rgb)) * amount;
+}
+
+/// A tint over the midtones alone, the same signed offset.
+fn tint_midtones(rgb: vec3<f32>, tint: vec3<f32>, amount: f32) -> vec3<f32> {
+ return rgb + tint * midtones(rgb) * amount;
+}
+
+/// The colour of black-body light at `k` kelvin.
+fn kelvin(k: f32) -> vec3<f32> {
+ let t = clamp(k, 1000.0, 40000.0) / 100.0;
+ var r: f32;
+ var g: f32;
+ var b: f32;
+ if (t <= 66.0) {
+ r = 1.0;
+ g = clamp((99.4708 * log(t) - 161.1196) / 255.0, 0.0, 1.0);
+ if (t <= 19.0) {
+ b = 0.0;
+ } else {
+ b = clamp((138.5177 * log(t - 10.0) - 305.0448) / 255.0, 0.0, 1.0);
+ }
+ } else {
+ r = clamp(329.6987 * pow(t - 60.0, -0.1332) / 255.0, 0.0, 1.0);
+ g = clamp(288.1222 * pow(t - 60.0, -0.0755) / 255.0, 0.0, 1.0);
+ b = 1.0;
+ }
+ return vec3<f32>(r, g, b);
+}
+
+/// White balance: the picture as if lit at `k` kelvin while the camera
+/// was set for daylight. 6500 is as shot.
+fn white_balance(rgb: vec3<f32>, k: f32) -> vec3<f32> {
+ let tint = kelvin(k) / kelvin(6500.0);
+ return rgb * (tint / max(luma(tint), 0.001));
+}
+
+/// A vignette: the corners darkened by `amount` from a clear middle.
+fn vignette(rgb: vec3<f32>, uv: vec2<f32>, amount: f32) -> vec3<f32> {
+ let d = distance(uv, vec2<f32>(0.5)) * 1.4142;
+ return rgb * (1.0 - smoothstep(0.35, 1.1, d) * amount);
+}
+
+/// Black and white through a coloured filter: the channel weights, made
+/// to sum to one. A red filter darkens skies and lightens skin.
+fn mono(rgb: vec3<f32>, weights: vec3<f32>) -> vec3<f32> {
+ let w = weights / max(weights.r + weights.g + weights.b, 0.001);
+ return vec3<f32>(dot(rgb, w));
+}
+
+/// A matte: the blacks lifted to `black` and the whites pulled down to
+/// `white`, the range between them kept in proportion. The print look
+/// every faded, milky and instant-camera grade is built on; (0, 1) is as
+/// shot.
+fn matte(rgb: vec3<f32>, black: f32, white: f32) -> vec3<f32> {
+ return rgb * (white - black) + vec3<f32>(black);
+}
+
+/// A film curve: a toe that rolls the shadows into black by `toe` and a
+/// shoulder that rolls the highlights into white by `shoulder`, both
+/// `0..1`, the midtones left on the line. Unlike a contrast, it never
+/// clips: it compresses the ends the way a negative does. The curve spans
+/// black to white; a highlight beyond white is carried on above it.
+fn film_curve(rgb: vec3<f32>, toe: f32, shoulder: f32) -> vec3<f32> {
+ let c = clamp(rgb, vec3<f32>(0.0), vec3<f32>(1.0));
+ let t = mix(c, c * c, vec3<f32>(toe) * (vec3<f32>(1.0) - c));
+ let curved = mix(t, vec3<f32>(1.0) - (vec3<f32>(1.0) - t) * (vec3<f32>(1.0) - t), vec3<f32>(shoulder) * t);
+ return curved + (rgb - c);
+}
+
+/// Every hue turned by `degrees`, brightness held: a rotation in the
+/// YIQ plane, the same for every pixel.
+fn hue_rotate(rgb: vec3<f32>, degrees: f32) -> vec3<f32> {
+ let a = radians(degrees);
+ let y = luma(rgb);
+ let i = dot(rgb, vec3<f32>(0.596, -0.274, -0.322));
+ let q = dot(rgb, vec3<f32>(0.211, -0.523, 0.312));
+ let i2 = i * cos(a) - q * sin(a);
+ let q2 = i * sin(a) + q * cos(a);
+ return vec3<f32>(
+ y + 0.956 * i2 + 0.621 * q2,
+ y - 0.272 * i2 - 0.647 * q2,
+ y - 1.106 * i2 + 1.703 * q2,
+ );
+}
+
+/// One band of hues adjusted and the rest untouched: the band `width`
+/// degrees around `centre` has its hue turned by `turn` degrees, its
+/// saturation scaled by `sat` and its brightness by `lum`, weighted by
+/// `hue_mask` so the edges of the band blend. What a grading panel's HSL
+/// sliders do, and what keeps a sky change off a face.
+fn hsl_band(rgb: vec3<f32>, centre: f32, width: f32, turn: f32, sat: f32, lum: f32) -> vec3<f32> {
+ let w = hue_mask(rgb, centre, width);
+ var out = hue_rotate(rgb, turn);
+ out = saturation(out, sat);
+ out = out * lum;
+ return mix(rgb, out, w);
+}
+
+/// Halation: the brights above `threshold` gathered from `radius` pixels
+/// around, tinted, and screened back over the picture by `amount`. The
+/// glow around a lamp on film, and the bloom every soft look leans on.
+fn halation(uv: vec2<f32>, rgb: vec3<f32>, threshold: f32, radius: f32, tint: vec3<f32>, amount: f32) -> vec3<f32> {
+ let t = texel() * radius * 0.5;
+ var sum = vec3<f32>(0.0);
+ for (var y: i32 = -2; y <= 2; y++) {
+ for (var x: i32 = -2; x <= 2; x++) {
+ let s = sample(uv + vec2<f32>(f32(x), f32(y)) * t).rgb;
+ let bright = smoothstep(threshold, 1.0, luma(s));
+ sum += s * bright;
+ }
+ }
+ let glow = clamp(sum / 25.0 * tint * amount, vec3<f32>(0.0), vec3<f32>(1.0));
+ return screen(rgb, glow);
+}
+
+// ── targeting and texture: the taps a look takes around a pixel, and the
+// bands of colour it singles out.
+
+/// Hue in degrees, 0..360; 0 for a grey.
+fn hue_of(rgb: vec3<f32>) -> f32 {
+ let mx = max(max(rgb.r, rgb.g), rgb.b);
+ let mn = min(min(rgb.r, rgb.g), rgb.b);
+ let d = mx - mn;
+ if (d < 0.0001) {
+ return 0.0;
+ }
+ var h: f32;
+ if (mx == rgb.r) {
+ h = (rgb.g - rgb.b) / d;
+ } else if (mx == rgb.g) {
+ h = 2.0 + (rgb.b - rgb.r) / d;
+ } else {
+ h = 4.0 + (rgb.r - rgb.g) / d;
+ }
+ return fract(h / 6.0) * 360.0;
+}
+
+/// Chroma, 0..1: how far from grey.
+fn chroma_of(rgb: vec3<f32>) -> f32 {
+ return max(max(rgb.r, rgb.g), rgb.b) - min(min(rgb.r, rgb.g), rgb.b);
+}
+
+/// How much a pixel belongs to the hues within `width` degrees of
+/// `centre`, weighted by chroma so a grey belongs to no band.
+fn hue_mask(rgb: vec3<f32>, centre: f32, width: f32) -> f32 {
+ let d = abs(fract((hue_of(rgb) - centre) / 360.0 + 0.5) * 360.0 - 180.0);
+ return (1.0 - smoothstep(width * 0.5, width, d)) * smoothstep(0.0, 0.25, chroma_of(rgb));
+}
+
+/// The weight of skin: the orange band, a warm tan to a pale cheek.
+fn skin_mask(rgb: vec3<f32>) -> f32 {
+ return hue_mask(rgb, 25.0, 40.0);
+}
+
+/// The layer averaged over a square of taps `radius` pixels across: a
+/// bloom, a soft denoise, the blur an unsharp mask subtracts.
+fn soften(uv: vec2<f32>, radius: f32) -> vec3<f32> {
+ let t = texel() * radius * 0.5;
+ var sum = vec3<f32>(0.0);
+ for (var y: i32 = -2; y <= 2; y++) {
+ for (var x: i32 = -2; x <= 2; x++) {
+ sum += sample(uv + vec2<f32>(f32(x), f32(y)) * t).rgb;
+ }
+ }
+ return sum / 25.0;
+}
+
+/// Grain: noise that changes every frame, centred on zero, `amount` as a
+/// fraction of the range. Seeded by the pixel and the frame's time, so the
+/// monitor and the export show the same grain on the same frame.
+fn grain_at(uv: vec2<f32>, amount: f32) -> vec3<f32> {
+ let n = hash(floor(uv * frame.size), fract(frame.time * 7.31)) - 0.5;
+ return vec3<f32>(n * amount);
+}
+
+/// The strength of an edge at `uv`: Sobel on luminance, 0..1.
+fn edge_at(uv: vec2<f32>) -> f32 {
+ let t = texel();
+ let tl = luma(sample(uv + vec2<f32>(-t.x, -t.y)).rgb);
+ let tc = luma(sample(uv + vec2<f32>(0.0, -t.y)).rgb);
+ let tr = luma(sample(uv + vec2<f32>(t.x, -t.y)).rgb);
+ let ml = luma(sample(uv + vec2<f32>(-t.x, 0.0)).rgb);
+ let mr = luma(sample(uv + vec2<f32>(t.x, 0.0)).rgb);
+ let bl = luma(sample(uv + vec2<f32>(-t.x, t.y)).rgb);
+ let bc = luma(sample(uv + vec2<f32>(0.0, t.y)).rgb);
+ let br = luma(sample(uv + vec2<f32>(t.x, t.y)).rgb);
+ let gx = (tr + 2.0 * mr + br) - (tl + 2.0 * ml + bl);
+ let gy = (bl + 2.0 * bc + br) - (tl + 2.0 * tc + tr);
+ return clamp(sqrt(gx * gx + gy * gy), 0.0, 1.0);
+}
+"#;
+
+/// What every format 2 shader is given beside its library: the display
+/// encoding - a look's space, and where a linear shader goes to do a sum
+/// an eye drew - and a hash every GPU agrees on.
+const FORMAT2_BASICS: &str = r#"
+/// A hash in 0..1 from a point and a seed, for grain and dither: the bits
+/// of all three mixed in integer arithmetic, so every GPU - and the
+/// software one an export may run on - draws the same number, where the
+/// last bits of a sine do not agree. Whole numbers make the steadiest
+/// points: a pixel, a slice, a cell.
+fn hash(p: vec2<f32>, seed: f32) -> f32 {
+ var h = bitcast<u32>(p.x) ^ (bitcast<u32>(p.y) * 0x9e3779b9u) ^ (bitcast<u32>(seed) * 0x85ebca6bu);
+ h = (h ^ (h >> 16u)) * 0x7feb352du;
+ h = (h ^ (h >> 15u)) * 0x846ca68bu;
+ h = h ^ (h >> 16u);
+ return f32(h >> 8u) / 16777216.0;
+}
+
+/// Light into the display encoding: BT.1886's 2.4 gamma, the curve an SDR
+/// picture is written in, so SDR white is 1.0 and middle grey 0.49 - but
+/// extended rather than clipped: a highlight climbs past 1.0, and a channel
+/// negative outside Rec. 709's gamut stays negative.
+fn to_display(rgb: vec3<f32>) -> vec3<f32> {
+ return sign(rgb) * pow(abs(rgb), vec3<f32>(1.0 / 2.4));
+}
+
+/// The display encoding back into light.
+fn from_display(encoded: vec3<f32>) -> vec3<f32> {
+ return sign(encoded) * pow(abs(encoded), vec3<f32>(2.4));
+}
+"#;
+
/// The format 2 library: helpers that hold for any level of light.
const LINEAR_LIBRARY: &str = r#"
// ── the scene-linear library (format 2) ──
@@ -563,6 +879,18 @@ fn fs_main(in: VsOut) -> @location(0) vec4<f32> {
}
"#;
+/// An effect's fragment in the display space: the package's colour taken
+/// back into light, then mixed over the untouched layer by intensity there.
+const EFFECT_FRAGMENT_DISPLAY: &str = r#"
+@fragment
+fn fs_main(in: VsOut) -> @location(0) vec4<f32> {
+ let base = textureSample(source, source_sampler, in.uv);
+ let treated = effect(in.uv);
+ let light = vec4<f32>(from_display(treated.rgb), treated.a);
+ return mix(base, light, clamp(frame.intensity, 0.0, 1.0));
+}
+"#;
+
/// A transition's fragment under the format 1 contract: the package owns
/// the blend, so the pipeline does no mixing of its own.
const TRANSITION_FRAGMENT_LEGACY: &str = r#"
@@ -590,15 +918,23 @@ pub enum Contract {
/// Format 2 on: the working space as it is, and the scene-linear
/// library.
Linear,
+ /// Format 2 on, `space = "display"`: the picture in the display
+ /// encoding, unclipped, the display-space library, and the result
+ /// taken back into light and mixed there.
+ Display,
}
impl Contract {
/// The edition `manifest` asks for.
pub fn of(manifest: &Manifest) -> Contract {
- if manifest.scene_linear() {
- Contract::Linear
- } else {
- Contract::Legacy
+ let display = manifest
+ .wgsl
+ .as_ref()
+ .is_some_and(|wgsl| wgsl.space == Space::Display);
+ match (manifest.scene_linear(), display) {
+ (false, _) => Contract::Legacy,
+ (true, false) => Contract::Linear,
+ (true, true) => Contract::Display,
}
}
@@ -612,22 +948,29 @@ impl Contract {
(Entry::Effect, Contract::Linear) => {
(EFFECT_HEAD, EFFECT_SAMPLE_LINEAR, EFFECT_FRAGMENT_LINEAR)
}
+ (Entry::Effect, Contract::Display) => {
+ (EFFECT_HEAD, EFFECT_SAMPLE_DISPLAY, EFFECT_FRAGMENT_DISPLAY)
+ }
(Entry::Transition, Contract::Legacy) => (
TRANSITION_HEAD,
TRANSITION_SAMPLE_LEGACY,
TRANSITION_FRAGMENT_LEGACY,
),
- (Entry::Transition, Contract::Linear) => (
+ // A transition has no [wgsl] table to ask for another space.
+ (Entry::Transition, Contract::Linear | Contract::Display) => (
TRANSITION_HEAD,
TRANSITION_SAMPLE_LINEAR,
TRANSITION_FRAGMENT_LINEAR,
),
};
- let library = match self {
- Contract::Legacy => LEGACY_LIBRARY,
- Contract::Linear => LINEAR_LIBRARY,
+ let library: &[&str] = match (entry, self) {
+ (_, Contract::Legacy) => &[LEGACY_LIBRARY],
+ (Entry::Effect, Contract::Display) => &[FORMAT2_BASICS, DISPLAY_LIBRARY],
+ _ => &[FORMAT2_BASICS, LINEAR_LIBRARY],
};
- [head, sampling, BASICS, library, VERTEX, fragment].concat()
+ [&[head, sampling, BASICS][..], library, &[VERTEX, fragment]]
+ .concat()
+ .concat()
}
}
diff --git a/src/crates/concat-render/src/gpu.rs b/src/crates/concat-render/src/gpu.rs
index 60164cc7..28f3c422 100644
--- a/src/crates/concat-render/src/gpu.rs
+++ b/src/crates/concat-render/src/gpu.rs
@@ -1354,14 +1354,66 @@ impl WgpuCompositor {
let side = side.max(1);
self.used.values_mut().for_each(|used| *used = 0);
self.composites += 1;
- let source = self.claim(side, side);
+ let source = self.filled(side, colour);
+ let drawn = self.run_passes(side, side, source, passes, seconds, seconds);
+ self.middle_of(side, drawn)
+ }
+
+ /// [`WgpuCompositor::probe`] for a transition: `pass` combining a
+ /// picture of `from` with one of `to`, and the middle pixel of the cut.
+ /// None when the device is dead, the shader will not build, or the
+ /// read-back fails.
+ pub fn probe_transition(
+ &mut self,
+ pass: &TransitionPass,
+ from: [f32; 4],
+ to: [f32; 4],
+ side: u32,
+ seconds: f32,
+ ) -> Option<[f32; 4]> {
+ if self.dead {
+ return None;
+ }
+ let side = side.max(1);
+ self.used.values_mut().for_each(|used| *used = 0);
+ self.composites += 1;
+ let from_index = self.filled(side, from);
+ let to_index = self.filled(side, to);
+ let target = self.claim(side, side);
+ let pool = &self.pool[&(side, side)];
+ let view = |index: usize| {
+ pool[index]
+ .texture
+ .create_view(&wgpu::TextureViewDescriptor::default())
+ };
+ let (from_view, to_view, target_view) = (view(from_index), view(to_index), view(target));
+ let Some(encoder) = self.encode_transition(
+ side,
+ side,
+ seconds,
+ &from_view,
+ &to_view,
+ pass,
+ &target_view,
+ ) else {
+ self.retire();
+ return None;
+ };
+ self.queue.submit([encoder.finish()]);
+ self.middle_of(side, target)
+ }
+
+ /// A pooled texture `side` square claimed and filled with `colour`,
+ /// written straight into its half floats.
+ fn filled(&mut self, side: u32, colour: [f32; 4]) -> usize {
+ let index = self.claim(side, side);
let texel: Vec<u8> = colour
.iter()
.flat_map(|channel| half::f16::from_f32(*channel).to_le_bytes())
.collect();
self.queue.write_texture(
wgpu::TexelCopyTextureInfo {
- texture: &self.pool[&(side, side)][source].texture,
+ texture: &self.pool[&(side, side)][index].texture,
mip_level: 0,
origin: wgpu::Origin3d::ZERO,
aspect: wgpu::TextureAspect::All,
@@ -1378,8 +1430,12 @@ impl WgpuCompositor {
depth_or_array_layers: 1,
},
);
- let drawn = self.run_passes(side, side, source, passes, seconds, seconds);
+ index
+ }
+ /// The middle texel of the pooled texture at `index`, `side` square,
+ /// read back as floats; the composite retired whether or not it reads.
+ fn middle_of(&mut self, side: u32, index: usize) -> Option<[f32; 4]> {
let buffer = self.device.create_buffer(&wgpu::BufferDescriptor {
label: Some("concat probe"),
size: wgpu::COPY_BYTES_PER_ROW_ALIGNMENT.into(),
@@ -1393,7 +1449,7 @@ impl WgpuCompositor {
});
encoder.copy_texture_to_buffer(
wgpu::TexelCopyTextureInfo {
- texture: &self.pool[&(side, side)][drawn].texture,
+ texture: &self.pool[&(side, side)][index].texture,
mip_level: 0,
origin: wgpu::Origin3d {
x: side / 2,
diff --git a/src/crates/concat-render/src/gpu/tests.rs b/src/crates/concat-render/src/gpu/tests.rs
index 08446585..adf11ef7 100644
--- a/src/crates/concat-render/src/gpu/tests.rs
+++ b/src/crates/concat-render/src/gpu/tests.rs
@@ -927,10 +927,14 @@ fn every_package_probe_holds() {
let mut probed = 0;
for package in concat_effects::Catalogue::builtin().packages() {
for (n, probe) in package.probes.iter().enumerate() {
- let pass = package
- .probe_pass(probe)
- .expect("a probed package has a shader");
- let got = gpu.probe(&[pass], probe.input, 8, 0.0).expect("reads back");
+ let got = match (package.probe_pass(probe), package.probe_transition(probe)) {
+ (Some(pass), _) => gpu.probe(&[pass], probe.input, 8, 0.0),
+ (None, Some(cut)) => {
+ gpu.probe_transition(&cut, probe.input, probe.to.unwrap_or_default(), 8, 0.0)
+ }
+ (None, None) => panic!("{}: a probe with no shader", package.id()),
+ }
+ .expect("reads back");
probed += 1;
if let Err(error) = probe.check(got) {
failures.push(format!("{}: {}\n {error}", package.id(), probe.label(n)));
@@ -1013,3 +1017,37 @@ fn a_scene_linear_pass_mixes_by_intensity_in_light() {
.expect("reads back");
assert!(near(got, [0.4, 0.4, 0.4, 1.0], 0.004), "{got:?}");
}
+
+/// No look clips: a highlight four times SDR white comes out of every
+/// built-in look drawn in the display space brighter than white does, as
+/// light that went in brighter should.
+#[test]
+fn every_look_carries_a_highlight_past_white() {
+ let Some(mut gpu) = gpu() else { return };
+ let luma = |c: [f32; 4]| 0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2];
+ let mut clipped = Vec::new();
+ for package in concat_effects::Catalogue::builtin().packages() {
+ let display = package
+ .manifest
+ .wgsl
+ .as_ref()
+ .is_some_and(|wgsl| wgsl.space == concat_effects::Space::Display);
+ if !display {
+ continue;
+ }
+ let pass = package.trial_pass().expect("a shader");
+ let white = gpu
+ .probe(std::slice::from_ref(&pass), [1.0, 1.0, 1.0, 1.0], 8, 0.0)
+ .expect("reads back");
+ let bright = gpu
+ .probe(&[pass], [4.0, 4.0, 4.0, 1.0], 8, 0.0)
+ .expect("reads back");
+ if luma(bright) <= luma(white) * 1.5 {
+ clipped.push(format!(
+ "{}: white {white:?}, 4x white {bright:?}",
+ package.id()
+ ));
+ }
+ }
+ assert!(clipped.is_empty(), "\n{}", clipped.join("\n"));
+}