Skip to content

AI media harness for planning, generating, and editing locally

TypeScript

Replace Look effect with Opacity

Bitti0568b1acbdb8
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index ada4914..7992f2d 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -30,6 +30,7 @@ This alpha update adds Linux support, LAN generation workers, expanded color gra
## Fixes and improvements
- The Add effect menu lists effects alphabetically.
+- Renamed the Look effect to Opacity and removed its Temperature control. Temperature adjustment is available in Basic Corrections.
- New empty images created while browsing child images stay in the same image family.
- The Save button keeps its label while saving, preventing the top bar tabs from shifting.
- The Image toolbar spans the workspace, with canvas tools and view controls grouped in the center.
diff --git a/docs/video-effects.md b/docs/video-effects.md
index 3e07808..6e7cc7a 100644
--- a/docs/video-effects.md
+++ b/docs/video-effects.md
@@ -5,6 +5,7 @@ Each effect can be adjusted or removed independently. Locked tracks cannot be ed
| Effect | Controls |
| --- | --- |
+| Opacity | Clip opacity, 0–100%. Temperature is available in Basic Corrections. |
| Sharpen | Edge enhancement, 0–200%; zero bypasses sharpening. |
| Gaussian Blur | Radius, 0–24 source pixels; zero bypasses blur. |
| Basic Corrections | Temperature, tint, highlights, shadows, whites and blacks −100 to +100%; exposure −4 to +4 stops; contrast −100 to +100%; saturation 0–200%. The existing brightness control remains available. |
@@ -14,7 +15,7 @@ Each effect can be adjusted or removed independently. Locked tracks cannot be ed
| Vignette | Amount −100 to +100% (positive darkens, negative lightens), midpoint 0–100%, roundness −100 to +100%, and feather 0–100%. |
| 3D LUT | Import or replace a `.cube` file and blend it at 0–100% intensity. |
-The render order is Chroma Key → Gaussian Blur → Sharpen (standalone + Creative) → Basic Corrections → Creative look / faded film / vibrance → Curves → Color Wheels → LUT → Vignette → Look temperature. Transform, opacity, and transitions composite the result into the timeline. This order is fixed; the inspector is not a reorderable effect stack. Blur radii refer to source resolution, so preview and export use the same radius even at different output sizes.
+The render order is Chroma Key → Gaussian Blur → Sharpen (standalone + Creative) → Basic Corrections → Creative look / faded film / vibrance → Curves → Color Wheels → LUT → Vignette. Transform, opacity, and transitions composite the result into the timeline. This order is fixed; the inspector is not a reorderable effect stack. Blur radii refer to source resolution, so preview and export use the same radius even at different output sizes.
Creative includes **Teal & Orange**, **Warm Film**, **Cool Blue**, **Bleach Bypass**, **Faded Matte**, **Monochrome**, **Golden Hour**, and **Night**. These are shader colour transforms, not LUT files. None and zero look intensity leave the look unchanged; faded film, sharpening and vibrance remain independently adjustable. Vibrance gives less saturated colours more weight.
diff --git a/src-tauri/src/project/timeline.rs b/src-tauri/src/project/timeline.rs
index d3ae0c6..93e2e31 100644
--- a/src-tauri/src/project/timeline.rs
+++ b/src-tauri/src/project/timeline.rs
@@ -71,7 +71,6 @@ pub(crate) struct ClipTransform {
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub(crate) struct ClipLook {
pub(crate) opacity: f64,
- pub(crate) temperature: f64,
/// Effect bypass: `Some(false)` keeps the settings but renders without
/// them. Absent in every project written before bypass existed.
#[serde(default, skip_serializing_if = "Option::is_none")]
diff --git a/src-tauri/src/project/validation/timeline.rs b/src-tauri/src/project/validation/timeline.rs
index 5140563..04340ce 100644
--- a/src-tauri/src/project/validation/timeline.rs
+++ b/src-tauri/src/project/validation/timeline.rs
@@ -36,10 +36,8 @@ pub(super) fn validate(config: &mut ProjectConfig) -> Result<(), String> {
if let Some(look) = &clip.look {
if !look.opacity.is_finite()
|| !(0.0..=100.0).contains(&look.opacity)
- || !look.temperature.is_finite()
- || !(-100.0..=100.0).contains(&look.temperature)
{
- return Err(format!("Clip '{}' has an invalid look.", clip.id));
+ return Err(format!("Clip '{}' has an invalid opacity.", clip.id));
}
}
if let Some(key) = &clip.chroma_key {
diff --git a/src-tauri/src/tests/persistence.rs b/src-tauri/src/tests/persistence.rs
index b931ae2..f068bb5 100644
--- a/src-tauri/src/tests/persistence.rs
+++ b/src-tauri/src/tests/persistence.rs
@@ -117,7 +117,6 @@ fn effect_bypass_round_trips_and_stays_absent_when_unset() {
});
clip.look = Some(ClipLook {
opacity: 80.0,
- temperature: 0.0,
enabled: None,
});
let config = without_derived_project_state(validate_and_normalize_config(config).unwrap());
@@ -136,6 +135,7 @@ fn effect_bypass_round_trips_and_stays_absent_when_unset() {
assert_eq!(parsed.enabled, Some(false));
let legacy: ClipLook = serde_json::from_str(r#"{"opacity":50,"temperature":10}"#).unwrap();
assert_eq!(legacy.enabled, None);
+ assert_eq!(serde_json::to_value(&legacy).unwrap(), serde_json::json!({"opacity":50.0}));
}
#[test]
diff --git a/src/components/workspace/ClipEffects.test.tsx b/src/components/workspace/ClipEffects.test.tsx
index 86a6e81..ff598d5 100644
--- a/src/components/workspace/ClipEffects.test.tsx
+++ b/src/components/workspace/ClipEffects.test.tsx
@@ -49,7 +49,7 @@ describe("clip effects", () => {
});
it.each([
- { name: "Look", patch: { look: { opacity: 65, temperature: -30, enabled: false } } },
+ { name: "Opacity", patch: { look: { opacity: 65, enabled: false } } },
{ name: "Transition", patch: { transition: { type: "wipe-left", durationMs: 1200 } } },
{ name: "Chroma key", patch: { chromaKey: { color: "#123456", tolerance: 43 } } },
{ name: "Sharpen", patch: { sharpen: { amount: 125 } } },
@@ -129,7 +129,7 @@ describe("clip effects", () => {
it("bypasses an effect from its header checkbox, keeping its settings", () => {
render(<Harness />);
add("Sharpen");
- add("Look");
+ add("Opacity");
fireEvent.change(screen.getByLabelText("Sharpen amount"), { target: { value: "120" } });
const sharpenOn = screen.getByRole("checkbox", { name: "Sharpen on" }) as HTMLInputElement;
expect(sharpenOn.checked).toBe(true);
@@ -145,7 +145,7 @@ describe("clip effects", () => {
expect(saved().sharpen).toEqual({ amount: 50, enabled: false });
fireEvent.click(sharpenOn);
expect(saved().sharpen).toEqual({ amount: 50 });
- fireEvent.click(screen.getByRole("checkbox", { name: "Look on" }));
+ fireEvent.click(screen.getByRole("checkbox", { name: "Opacity on" }));
expect(saved().look).toMatchObject({ enabled: false });
});
@@ -291,12 +291,12 @@ describe("clip effects", () => {
it("adds only chosen effects, and removes them without changing other effects", () => {
render(<Harness />);
- expect(screen.queryByRole("heading", { name: "Look" })).toBeNull();
+ expect(screen.queryByRole("heading", { name: "Opacity" })).toBeNull();
add("Chroma key");
fireEvent.click(screen.getByRole("button", { name: "Add effect" }));
const picker = screen.getByRole("group", { name: "Available effects" });
expect(within(picker).queryByRole("button", { name: "Chroma key" })).toBeNull();
- fireEvent.click(within(picker).getByRole("button", { name: "Look" }));
+ fireEvent.click(within(picker).getByRole("button", { name: "Opacity" }));
fireEvent.change(screen.getByLabelText("Clip opacity"), { target: { value: "65" } });
remove("Chroma key");
expect(saved().chromaKey).toBeUndefined();
diff --git a/src/components/workspace/ClipEffects.tsx b/src/components/workspace/ClipEffects.tsx
index 52abd7b..5bcb536 100644
--- a/src/components/workspace/ClipEffects.tsx
+++ b/src/components/workspace/ClipEffects.tsx
@@ -96,19 +96,12 @@ function LutEditor({ clip, update, disabled }: EditorProps) {
}
// One catalogue drives the picker, defaults and editors. Missing settings mean
-// the effect is absent; older projects with Look/Transition keep their edits.
+// the effect is absent; opacity retains the legacy `look` project key.
const EFFECTS: readonly EffectDefinition[] = [
{
- id: "look", name: "Look", description: "Opacity and colour temperature",
+ id: "look", name: "Opacity", description: "Control clip transparency",
defaults: { look: DEFAULT_CLIP_LOOK },
- editor: ({ clip, update, disabled }) => {
- const look = clip.look!;
- return <>
- <Param label="Opacity" ariaLabel="Clip opacity" value={look.opacity} defaultValue={DEFAULT_CLIP_LOOK.opacity} disabled={disabled} onChange={(opacity) => update({ look: { ...look, opacity } })} />
- <Param label="Temperature" ariaLabel="Clip temperature" value={look.temperature} min={-100} max={100} defaultValue={DEFAULT_CLIP_LOOK.temperature} disabled={disabled}
- format={(value) => `${value > 0 ? "+" : ""}${value}`} onChange={(temperature) => update({ look: { ...look, temperature } })} />
- </>;
- },
+ editor: ({ clip, update, disabled }) => <Param label="Opacity" ariaLabel="Clip opacity" value={clip.look!.opacity} defaultValue={DEFAULT_CLIP_LOOK.opacity} disabled={disabled} onChange={(opacity) => update({ look: { ...clip.look!, opacity } })} />,
},
{
id: "transition", name: "Transition", description: "Fade or wipe into the clip",
diff --git a/src/components/workspace/ProgramLayer.tsx b/src/components/workspace/ProgramLayer.tsx
index 5cb968a..aecb0a6 100644
--- a/src/components/workspace/ProgramLayer.tsx
+++ b/src/components/workspace/ProgramLayer.tsx
@@ -1,7 +1,7 @@
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from "react";
import { clipFrameStyle, clipVisualSettings, type ClipFrameStyle } from "../../lib/export";
import { PreviewSources } from "../../lib/exportPipeline";
-import { clipChromaKey, clipLook, type ProjectAsset, type TimelineClip } from "../../lib/project";
+import { clipChromaKey, type ProjectAsset, type TimelineClip } from "../../lib/project";
import { ChromaKeyPreview } from "./ChromaKeyPreview";
import { VideoEffectsPreview } from "./VideoEffectsPreview";
import { activeVideoEffects, hasVideoEffects } from "../../lib/effectSettings";
@@ -10,12 +10,10 @@ import { isTauri } from "../../lib/persistence";
import type { PreviewMedia } from "../../lib/previewPresentation";
export function previewMediaStyle(frame: ClipFrameStyle): CSSProperties {
- const { transform, look, opacity, revealStart, revealEnd } = frame;
- const warmth = look.temperature / 100;
+ const { transform, opacity, revealStart, revealEnd } = frame;
return {
transform: `translate(${transform.positionX}%, ${transform.positionY}%) scale(${transform.scale / 100}) rotate(${transform.rotation}deg)`,
opacity,
- filter: warmth === 0 || hasVideoEffects(frame) ? "none" : `sepia(${Math.abs(warmth) * 0.22}) saturate(${1 + Math.abs(warmth) * 0.3}) hue-rotate(${warmth > 0 ? -8 : 172}deg)`,
clipPath: `inset(0 ${(1 - revealEnd) * 100}% 0 ${revealStart * 100}%)`,
};
}
@@ -96,7 +94,7 @@ export function ProgramLayer({ clip, asset, sources, playheadMs, playing, rate =
const style = previewMediaStyle(clipFrameStyle(clipVisualSettings(clip), playheadMs - clip.startMs));
/* Bypassed effects are dropped here, the way the export drops them. Kept
per clip object so the effect canvases only redraw when the clip does. */
- const gpuEffects = useMemo<GpuEffects>(() => ({ ...activeVideoEffects(clip), chromaKey: clipChromaKey(clip), look: clipLook(clip) }), [clip]);
+ const gpuEffects = useMemo<GpuEffects>(() => ({ ...activeVideoEffects(clip), chromaKey: clipChromaKey(clip) }), [clip]);
const chromaKey = gpuEffects.chromaKey;
const effects = hasVideoEffects(gpuEffects);
const sourceStyle: CSSProperties = composited || chromaKey || effects ? { ...style, visibility: "hidden", position: "absolute" } : style;
diff --git a/src/components/workspace/ProgramMonitor.test.tsx b/src/components/workspace/ProgramMonitor.test.tsx
index 6c80797..d2ac7a8 100644
--- a/src/components/workspace/ProgramMonitor.test.tsx
+++ b/src/components/workspace/ProgramMonitor.test.tsx
@@ -161,7 +161,7 @@ describe("the program monitor", () => {
callbacks.forEach((callback) => callback(now));
});
};
- const config = project([clip({ startMs: 0, sourceStartMs: 0, look: { opacity: 50, temperature: 0 } })]);
+ const config = project([clip({ startMs: 0, sourceStartMs: 0, look: { opacity: 50 } })]);
config.assets.push({ ...config.assets[0], id: "asset-long", sourcePath: "D:/rushes/long.mp4" });
config.timeline.tracks.push({
...config.timeline.tracks.find((track) => track.id === STORY_TRACK_ID)!,
diff --git a/src/lib/effectSettings.test.ts b/src/lib/effectSettings.test.ts
index a0c5503..ef5f135 100644
--- a/src/lib/effectSettings.test.ts
+++ b/src/lib/effectSettings.test.ts
@@ -63,10 +63,10 @@ it("retains effects through project parsing and export frame planning", () => {
describe("effect bypass", () => {
const base = { id: "clip", assetId: "asset", trackId: "video", label: "Clip", startMs: 0, durationMs: 2000 };
- it("loads projects written before bypass unchanged and keeps an explicit flag", () => {
+ it("loads legacy opacity settings, drops retired temperature and keeps an explicit bypass flag", () => {
const legacy = timelineClipSchema.parse({ ...base, sharpen: { amount: 40 }, look: { opacity: 70, temperature: 5 } });
expect(JSON.parse(JSON.stringify(legacy)).sharpen).toEqual({ amount: 40 });
- expect(JSON.parse(JSON.stringify(legacy)).look).toEqual({ opacity: 70, temperature: 5 });
+ expect(JSON.parse(JSON.stringify(legacy)).look).toEqual({ opacity: 70 });
const off = timelineClipSchema.parse({ ...base, sharpen: { amount: 40, enabled: false }, chromaKey: { color: "#00ff00", tolerance: 20, enabled: false } });
expect(off.sharpen?.enabled).toBe(false);
expect(off.chromaKey?.enabled).toBe(false);
diff --git a/src/lib/export.test.ts b/src/lib/export.test.ts
index 00fc905..a834c5e 100644
--- a/src/lib/export.test.ts
+++ b/src/lib/export.test.ts
@@ -255,7 +255,7 @@ describe("the plan", () => {
it("carries clip transforms, looks, and transitions into every rendered segment", () => {
const treated = clip("a", "track-story", 0, 2_000, {
transform: { scale: 125, rotation: 8, positionX: -12, positionY: 6 },
- look: { opacity: 80, temperature: 35 },
+ look: { opacity: 80 },
transition: { type: "fade", durationMs: 500 },
});
const plan = buildExportPlan(project([treated], [asset("asset-a")]), settings());
diff --git a/src/lib/export.ts b/src/lib/export.ts
index 7bcd5c2..a0298c8 100644
--- a/src/lib/export.ts
+++ b/src/lib/export.ts
@@ -52,7 +52,7 @@ export interface ClipVisualSettings extends VideoEffects {
}
export interface ClipFrameStyle extends ClipVisualSettings {
- /** Opacity after both Look and the transition at this moment are applied. */
+ /** Opacity after both the Opacity effect and the transition at this moment are applied. */
opacity: number;
/** Horizontal source reveal, used by wipe transitions. */
revealStart: number;
diff --git a/src/lib/exportPipeline.test.ts b/src/lib/exportPipeline.test.ts
index d26dcf9..694d3cb 100644
--- a/src/lib/exportPipeline.test.ts
+++ b/src/lib/exportPipeline.test.ts
@@ -707,8 +707,8 @@ describe("running an export of external media", () => {
const track = config.timeline.tracks.find((track) => track.kind === "video" && track.clips.length)!;
track.clips[0].durationMs = Math.floor(frames * 1000 / 30);
if (layered) {
- track.clips[0].look = { opacity: 50, temperature: 0 };
- config.timeline.tracks.push({ ...track, id: "lower", clips: [{ ...track.clips[0], id: "lower-clip", trackId: "lower", look: { opacity: 100, temperature: 0 } }] });
+ track.clips[0].look = { opacity: 50 };
+ config.timeline.tracks.push({ ...track, id: "lower", clips: [{ ...track.clips[0], id: "lower-clip", trackId: "lower", look: { opacity: 100 } }] });
}
const settings = defaultExportSettings(config);
const plan = buildExportPlan(config, settings);
diff --git a/src/lib/exportPipeline.ts b/src/lib/exportPipeline.ts
index f2aa17d..26f2736 100644
--- a/src/lib/exportPipeline.ts
+++ b/src/lib/exportPipeline.ts
@@ -163,7 +163,7 @@ struct VertexOut {
// x0, y0, x1, y1 of the fitted and transformed picture in clip space.
@group(0) @binding(0) var<uniform> rect: vec4f;
-// rotation, opacity, temperature, reveal start / reveal end.
+// rotation, opacity, reserved, reveal start / reveal end.
struct Style {
primary: vec4f,
secondary: vec4f,
@@ -198,14 +198,12 @@ fn vs(@builtin(vertex_index) index: u32) -> VertexOut {
fn fs(@location(0) uv: vec2f) -> @location(0) vec4f {
if (uv.x < style.primary.w || uv.x > style.secondary.x) { discard; }
let sampled = textureSampleBaseClampToEdge(source, source_sampler, uv);
- let temperature = style.primary.z;
- let rgb = clamp(sampled.rgb + vec3f(temperature * 0.1, 0.0, -temperature * 0.1), vec3f(0.0), vec3f(1.0));
var alpha = sampled.a * style.primary.y;
if (style.secondary.y > 0.0) {
let difference = distance(sampled.rgb, style.key.rgb) / ${RGB_DISTANCE_SCALE};
alpha *= smoothstep(style.key.a, style.key.a + ${KEY_FEATHER}, difference);
}
- return vec4f(rgb, alpha);
+ return vec4f(sampled.rgb, alpha);
}
`;
@@ -326,7 +324,7 @@ async function createWebGpuCompositor(width: number, height: number, background:
device.queue.writeBuffer(styleUniform, 0, new Float32Array([
(style.transform.rotation * Math.PI) / 180,
style.opacity,
- processed ? 0 : style.look.temperature / 100,
+ 0,
style.revealStart,
style.revealEnd,
style.chromaKey && !processed ? 1 : 0,
@@ -410,15 +408,11 @@ function createCanvasCompositor(width: number, height: number, background: strin
const drawHeight = fitted.height * scale;
const centreX = fitted.x + fitted.width / 2 + (style.transform.positionX / 100) * width;
const centreY = fitted.y + fitted.height / 2 + (style.transform.positionY / 100) * height;
- const warmth = style.look.temperature / 100;
context.save();
context.beginPath();
context.rect(style.revealStart * width, 0, (style.revealEnd - style.revealStart) * width, height);
context.clip();
context.globalAlpha = style.opacity;
- context.filter = warmth === 0
- ? "none"
- : `sepia(${Math.abs(warmth) * 0.22}) saturate(${1 + Math.abs(warmth) * 0.3}) hue-rotate(${warmth > 0 ? -8 : 172}deg)`;
context.translate(centreX, centreY);
context.rotate((style.transform.rotation * Math.PI) / 180);
context.drawImage(picture, -drawWidth / 2, -drawHeight / 2, drawWidth, drawHeight);
diff --git a/src/lib/project.test.ts b/src/lib/project.test.ts
index 6a39bed..86451dc 100644
--- a/src/lib/project.test.ts
+++ b/src/lib/project.test.ts
@@ -180,13 +180,13 @@ describe("project schema", () => {
color: null,
status: "approved",
transform: { scale: 115, rotation: -4, positionX: 8, positionY: -3 },
- look: { opacity: 72, temperature: 20 },
+ look: { opacity: 72 },
transition: { type: "wipe-left", durationMs: 600 },
});
expect(parseProjectConfig(project).timeline.tracks[0].clips[0]).toMatchObject({
transform: { scale: 115, rotation: -4, positionX: 8, positionY: -3 },
- look: { opacity: 72, temperature: 20 },
+ look: { opacity: 72 },
transition: { type: "wipe-left", durationMs: 600 },
});
});
diff --git a/src/lib/project.ts b/src/lib/project.ts
index c73b5b3..906cc35 100644
--- a/src/lib/project.ts
+++ b/src/lib/project.ts
@@ -236,7 +236,7 @@ export const clipTransformSchema = z.object({
positionY: z.number().min(-100).max(100),
});
-/* Look, transition and chroma key are effects in the inspector too, so they
+/* Opacity, transition and chroma key are effects in the inspector too, so they
take the same bypass flag as the GPU effects (see effectSettings.ts). */
export const clipChromaKeySchema = z.object({
color: z.string().regex(/^#[0-9a-fA-F]{6}$/),
@@ -244,10 +244,9 @@ export const clipChromaKeySchema = z.object({
enabled: effectEnabledSchema,
});
+// Keep the legacy `look` key for opacity; retired temperature values are stripped on load.
export const clipLookSchema = z.object({
opacity: z.number().min(0).max(100),
- /** Cool at -100, neutral at 0, warm at +100. */
- temperature: z.number().min(-100).max(100),
enabled: effectEnabledSchema,
});
@@ -654,7 +653,7 @@ export type ClipChromaKey = z.infer<typeof clipChromaKeySchema>;
export type ClipTransition = z.infer<typeof clipTransitionSchema>;
export const DEFAULT_CLIP_TRANSFORM: ClipTransform = { scale: 100, rotation: 0, positionX: 0, positionY: 0 };
-export const DEFAULT_CLIP_LOOK: ClipLook = { opacity: 100, temperature: 0 };
+export const DEFAULT_CLIP_LOOK: ClipLook = { opacity: 100 };
export const DEFAULT_CLIP_CHROMA_KEY: ClipChromaKey = { color: "#00ff00", tolerance: 20 };
export const DEFAULT_CLIP_TRANSITION: ClipTransition = { type: "cut", durationMs: 500 };
@@ -669,7 +668,7 @@ export const roundClipTransform = (transform: ClipTransform): ClipTransform => (
positionY: roundTransformValue(transform.positionY),
});
export const clipTransform = (clip: TimelineClip): ClipTransform => roundClipTransform(clip.transform ?? DEFAULT_CLIP_TRANSFORM);
-/* A bypassed Look or transition renders as if it were not there. */
+/* A bypassed Opacity or transition renders as if it were not there. */
export const clipLook = (clip: TimelineClip): ClipLook => isEffectOn(clip.look) ? clip.look : DEFAULT_CLIP_LOOK;
export const clipTransition = (clip: TimelineClip): ClipTransition => isEffectOn(clip.transition) ? clip.transition : DEFAULT_CLIP_TRANSITION;
export const clipChromaKey = (clip: TimelineClip): ClipChromaKey | null => isEffectOn(clip.chromaKey) ? clip.chromaKey : null;
diff --git a/src/lib/videoEffectsGpu.ts b/src/lib/videoEffectsGpu.ts
index 45386a7..51dfb4c 100644
--- a/src/lib/videoEffectsGpu.ts
+++ b/src/lib/videoEffectsGpu.ts
@@ -5,7 +5,7 @@ import { compileCurves, CURVE_SAMPLES } from "./colorCurves";
import { COLOR_GRADING_WGSL } from "./colorGradingShader";
import type { ClipChromaKey } from "./project";
-export type GpuEffects = VideoEffects & { chromaKey?: ClipChromaKey | null; look?: { temperature: number } | null };
+export type GpuEffects = VideoEffects & { chromaKey?: ClipChromaKey | null };
const VERTEX = /* wgsl */ `
struct VertexOut { @builtin(position) position: vec4f, @location(0) uv: vec2f };
@@ -126,7 +126,6 @@ fn straight(color: vec4f) -> vec3f { return color.rgb / max(color.a, .00001); }
let edge = smoothstep(start, start + max(params.vignette.z * .7, .001), distanceFromCenter);
if (params.grade.w >= 0.) { rgb *= 1. - params.grade.w * edge; }
else { rgb += (1. - rgb) * -params.grade.w * edge; }
- rgb += vec3f(params.domainMin.w * .1, 0., -params.domainMin.w * .1);
return vec4f(clamp(rgb, vec3f(0.), vec3f(1.)) * sampled.a, sampled.a);
}
`;
@@ -196,8 +195,8 @@ export function createVideoEffectsProcessor(device: GPUDevice) {
...(effects.chromaKey ? keyColor(effects.chromaKey.color) : [0, 0, 0]), (effects.chromaKey?.tolerance ?? 0) / 100,
grade?.exposure ?? 0, 1 + (grade?.contrast ?? 0) / 100, (grade?.saturation ?? 100) / 100, (effects.vignette?.amount ?? 0) / 100,
((effects.sharpen?.amount ?? 0) + (effects.creative?.sharpen ?? 0)) / 100, table?.size ?? 0, (effects.lut?.intensity ?? 0) / 100, effects.chromaKey ? 1 : 0,
- // Pack temperature and brightness into the unused domain vector lanes.
- ...(table?.domainMin ?? [0, 0, 0]), (effects.look?.temperature ?? 0) / 100, ...(table?.domainMax ?? [1, 1, 1]), (grade?.brightness ?? 0) / 100,
+ // Pack brightness into the unused domainMax vector lane.
+ ...(table?.domainMin ?? [0, 0, 0]), 0, ...(table?.domainMax ?? [1, 1, 1]), (grade?.brightness ?? 0) / 100,
effects.blur?.radius ?? 0, 0, 0, 0,
(grade?.temperature ?? 0) / 100, (grade?.tint ?? 0) / 100, (grade?.highlights ?? 0) / 100, (grade?.shadows ?? 0) / 100,
(grade?.whites ?? 0) / 100, (grade?.blacks ?? 0) / 100, (effects.creative?.vibrance ?? 0) / 100, curveMask,