feat(hdr): shader transitions between HDR scenes + SDR rendering fixes#268
Open
vanceingalls wants to merge 2 commits intographite-base/268from
Open
feat(hdr): shader transitions between HDR scenes + SDR rendering fixes#268vanceingalls wants to merge 2 commits intographite-base/268from
vanceingalls wants to merge 2 commits intographite-base/268from
Conversation
85de722 to
0b70603
Compare
eabca43 to
a7db7f6
Compare
Collaborator
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
32cf08c to
6976409
Compare
8b9096f to
3e571ca
Compare
6976409 to
c62a8f6
Compare
3e571ca to
c8cb0d0
Compare
…ering Port 15 GLSL shaders to TypeScript rgb48le pixel math for HDR-native scene transitions. Dual-scene compositing flattens each scene independently then blends with per-pixel shader. Scene detection via window.__hf.transitions protocol. Fix streaming encoder buffer race condition (Node streams hold reference, zero-fill overwrites before pipe drains). Fix SDR video rendering in HDR compositions (three stacked bugs). 211 engine tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
da57514 to
a593e3f
Compare
c8cb0d0 to
dc89f54
Compare
…ions When a composition mixes PQ and HLG HDR sources, the pipeline now converts each video's native transfer to match the output transfer function during blit. Uses a composite 65536-entry LUT (source EOTF → linear → target OETF) for O(1) per-sample conversion. Tracks each video's individual transfer via ffprobe at detection time. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
a0a2680 to
8830de9
Compare
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.

Summary
Adds 15 GPU-style shader transitions (crossfade, swirl-vortex, glitch, domain-warp, light-leak, etc.) that blend between HDR scenes at full 16-bit precision. Also fixes SDR video rendering in HDR compositions and a critical streaming encoder bug that caused frame-to-frame flickering.
What it does
Shader transitions (Phase 5)
15 GLSL shaders ported to TypeScript, operating directly on rgb48le pixel buffers:
Each shader is a function: `(fromBuf, toBuf, outBuf, width, height, progress) → void` that reads from two scene buffers and writes blended pixels to the output.
Dual-scene compositing: For each transition frame, both the outgoing and incoming scenes are independently flattened into rgb48le buffers (HDR video blit + DOM screenshot composite), then blended by the shader function.
Scene detection: Compositions declare transitions via `window.__hf.transitions` (an array of `{ time, duration, shader, fromScene, toScene }`). The orchestrator queries this at render start and pre-computes frame ranges for each transition.
Critical bug fix: streaming encoder buffer race
`writeFrame()` passed the caller's buffer directly to `ffmpeg.stdin.write()`. Node.js streams hold a reference to the buffer and drain asynchronously. The transition loop reuses pre-allocated buffers and zero-fills them per frame — if the pipe hadn't fully drained, ffmpeg read partially-overwritten data, causing a horizontal banding artifact that flickered frame-to-frame. Fix: `Buffer.from(buffer)` copies the data before writing to the pipe.
SDR rendering fixes
Three stacked bugs made SDR video invisible in HDR compositions:
Other fixes
Files changed
How to test
Stack position
6 of 6 — Top of the HDR stack. Stacked on #290 (GSAP transforms). This completes the HDR compositing pipeline.
Full stack: #258 → #265 → #288 → #289 → #290 → #268
🤖 Generated with Claude Code