Repository navigation
feat: global color grade + opinionated filters (VHS · Super-8 · Decay · Noir · Sepia · Instant) - #60
Merged
Merged
Conversation
…gine/shaders/descriptor) Adds a global "film stock" color-grade layer that sits UNDER the punch-in accents. This is the engine half — UI lands next. - fx/looks.ts: GradeParams vector (16 params), 10 TE-named looks (CLEAR, FROST, EMBER, HAZE, BLUSH, DUSK, VOLT, MONO, GOLD, SUPER-8) + RAW, a GradeSlot (look + strength BLEND + 4 macros), mergeGradeParams, and the canonical CPU reference gradeColor() mirroring the shaders. - fx/webgl2/grade.frag.ts + fx/webgpu/grade.wgsl.ts: one shared grade pipeline, byte-aligned for GPU parity; mix(source, graded, strength) so strength=0 is a literal identity pass. Registered in program-cache + webgpu registry. - catalog.ts: GRADE FxDefinition (replace-blend source sampler; reduced Canvas2D fallback). No 2-knob tuple — its surface is the Overlays panel. - build-descriptor.ts: prepend one grade FrameFx per active slot AHEAD of the punch-ins, so the frame is graded first and accents composite on top; slots stack serially A->B->C. - types.ts / jobs-db.ts: mirror the new `grade` FxKind. Tests: looks (engine + catalog + gradeColor), grade (registration + backend param-parity + strength-0 skip), build-descriptor (prepend / skip raw+zero / stacking order / global-at-any-t). 81 unit tests green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- store.ts: gradeSlots[] state + addGradeSlot / updateGradeSlot / removeGradeSlot / moveGradeSlot actions; init in default/reset/loadJob. - preview-runtime: feed gradeSlots into the descriptor snapshot. - useAutoPersist + jobs-db (GradeSlotRecord) + Editor.tsx loadJob: persist the grade stack per job, hydrate on load, clean default-[] migration for pre-feature jobs. - export: thread grades through jobs.ts -> edit.worker -> edit -> compositor and prepend via the shared gradeFrameFxFor() helper, so the exported file is graded identically to the live preview (preview == render). Tests: grade-actions (add/update/remove/move/load/reset), persist round-trip. 131 unit tests green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds the global-filter UI as a stacked card list in the OVERLAYS tab, matching the panel's existing conventions (no new visual paradigm): - FilterStack.tsx: ADD appends a filter card; each card = a look <select> (RAW/CLEAR/FROST/EMBER/HAZE/BLUSH/DUSK/VOLT/MONO/GOLD/SUPER-8), an Amount slider, and four macro sliders (Warmth/Fade/Punch/Grain), plus a swatch chip, REMOVE, and up/down reorder nudges. Card order = serial compose order. Reuses ChunkyButton, the panel <select> idiom, and the QualitySlider-style range markup. - OverlaysPanel: render <FilterStack/> between the visualizer and text overlays; subtitle now reads "Filters · text overlays · audio visualizer". Tests: FilterStack render + ADD/REMOVE/reorder + look/Amount/macro -> store mapping. Full unit suite green (1137 tests). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Browser test that compiles the real grade.frag/grade.wgsl on a live GPU and checks the graded pixels: strength-0 identity, warm-temp red lift, sat-0 greyscale, and WebGL2 vs WebGPU agree on an EMBER grade to within ±6 LSB. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replaces the "every look is a preset of one engine with the same 4 macros" approach with genuinely distinct effects, each its own shader + own controls: - VHS (rolling tracking band, chroma bleed, scanlines, snow — temporal) - Super-8 (organic grain, gate weave, exposure flicker, halation — temporal) - Decay (dancing dust/hair, flickering scratches, gate-judder, light-leaks — temporal) - Noir (B&W with a coloured-filter response, contrast curve, grain, vignette) - Sepia (real luma->duotone remap, paper fade, grain, oval vignette) - Instant/Polaroid (warm-cool split, center bloom, vignette, paper border) Each is a source-sampling REPLACE FX with a variable-length `filterParams` schema (its OWN controls) on FxDefinition, built via one shared makeFilterDef factory; tasteful non-zero defaults so a fresh filter immediately looks like the thing; amount = master dry/wet (folds ADSR wetness). Registered across catalog + program-cache (WebGL2) + webgpu registry; jobs-db kind mirror. Color-grade engine extended with shadowsLift + highlightsGain (the Shadows / Highlights wheels of a lift/gamma/gain grade; gamma already = midtones), mirrored across gradeColor + grade.frag + grade.wgsl, no-op at 0. Verified on real GPU: a browser test compiles every filter's frag AND wgsl on WebGL2 + WebGPU, asserts the default look changes the image and amount=0 is identity (caught + fixed two reserved-word ship-blockers: GLSL `cast`, `dot`). 1147 unit + 18 GPU filter tests green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…filter stack Replaces the "look-preset slot" model (every look = a preset of one engine with the same 4 macros — the user's complaint) with two distinct surfaces: - COLOR GRADE: a single persistent `colorGrade: GradeParams` on the store, edited via a dedicated ColorGradePanel (Tone: Exposure/Contrast/Black/Fade · Color: Saturation/Temp/Tint · Wheels: Shadows/Midtones/Highlights). Emits one grade FrameFx, skipped when identity. - FILTERS: `filterSlots: FilterSlot[]` — each slot picks a filter KIND and carries that kind's OWN params (FxDefinition.filterParams). FilterStack renders the selected kind's controls per card (VHS → TRACK/BLEED/SNOW, Sepia → TONE/CONTRAST/FADE) — no shared macro block. Deletes GradeSlot / GRADE_LOOKS / GradeLookId / mergeGradeParams / defaultGradeSlot machinery from looks.ts (now engine-only). build-descriptor emits grade → filters → punch-ins via colorGradeFrameFx + filterFrameFx, shared by preview AND export (compositor/edit/worker/jobs threaded with colorGrade + filterSlots). Persistence: ColorGradeRecord + FilterSlotRecord in jobs-db; useAutoPersist + Editor.tsx loadJob updated; partial grades fill defaults on load. Shared ParamSlider extracted. Tests rewritten for the new model (looks / grade / grade-actions / build-descriptor / FilterStack / useAutoPersist / grade-backend). 1141 unit + 23 GPU tests green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Lets an isolated dev instance (e.g. a worktree under review) use its own IndexedDB instead of sharing — and clashing on schema version with — the real 'videoaudiosync' DB. Production sets nothing → canonical name. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Resolves the jobs-db.ts conflict: keeps the new ColorGradeRecord / FilterSlotRecord + VITE_DB_NAME override AND adopts main's DB_VERSION 11 (waveform-pyramid store from #59). Other files auto-merged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds two new, distinct surfaces to the Overlays tab for shaping the whole video's look — separate from the momentary punch-in accents:
1. Color grade (a real grading surface)
One persistent grade per project (
colorGrade), edited via grouped controls in pipeline order:Backed by a shared grade engine (WebGL2 / WebGPU / Canvas2D) with byte-aligned GPU parity. Emits one
gradeFrameFx, skipped entirely when it's the identity.2. Filters (opinionated, recognizable looks)
A stack of distinct effects — each its own shader with its own controls (no shared macro block):
Filters stack (order = serial compose order, reorder changes the result), each seeded with a tasteful non-zero default so a fresh filter is immediately visible.
Architecture
FilterSlot { id, kind, params }+colorGrade: GradeParamson the store; descriptor emits grade → filters → punch-ins (all replace-blend, re-snapshotted per FX, so they compose serially). SharedcolorGradeFrameFx+filterFrameFxused by both the live preview AND the export compositor → preview == render.FxDefinitionbuilt from onemakeFilterDeffactory; the per-card UI is driven by a newfilterParams?: FxParamDef[]schema (variable length, distinct from the 2-knob hardware-encoderparams), so each card renders its kind's own controls.ColorGradeRecord+FilterSlotRecordin jobs-db); partial grades fill defaults on load.Verification
fragandwgslon a live WebGL2 + WebGPU, asserts the default look changes the image andamount=0is a clean identity pass (caught + fixed two reserved-word ship-blockers in the generated shaders:cast,dot). The grade engine has a WebGL2 ≡ WebGPU ±6 LSB pixel-parity test.tscclean.Notes
VITE_DB_NAMEenv override added so an isolated dev instance can avoid clashing with the real IndexedDB (prod unchanged).🤖 Generated with Claude Code