refactor(shader-transitions): extract DEFAULT_DURATION and DEFAULT_EASE constants#367
refactor(shader-transitions): extract DEFAULT_DURATION and DEFAULT_EASE constants#367vanceingalls merged 2 commits intomainfrom
Conversation
9cc8938 to
c4de50b
Compare
jrusso1020
left a comment
There was a problem hiding this comment.
Nice cleanup that surfaces a real bug. Before this PR the meta-write path used duration ?? 1 + ease ?? "none" while the render-mode and engine-mode paths used duration ?? 0.7 + ease ?? "power2.inOut". Concretely: a transition declared without explicit duration would play for 0.7s with power2.inOut but be reported in the __hf.transitions metadata as 1s with "none" — so the producer's HDR compositor would plan a 1.0s compositing window while the actual shader animation only ran 0.7s. The difference gets papered over in most compositions (transitions usually declare both fields) but any default-relying transition would have misaligned encoder buffers against the visual output.
Extracting DEFAULT_DURATION / DEFAULT_EASE to module-scope constants and using them at all three sites both fixes the inconsistency and prevents it from drifting back. Approved.
— Rames Jusso
4cfb72e to
640cc95
Compare
c4de50b to
0eed2ab
Compare
640cc95 to
57d7248
Compare
0eed2ab to
d0aa979
Compare
|
Confirmed — the analysis is right. The pre-PR mismatch ( |
bb9f830 to
c1d6281
Compare
e039969 to
acc87c8
Compare
edea17b to
fb5966b
Compare
8f5f477 to
e56820c
Compare
903dea1 to
949e87b
Compare
e56820c to
35d6cb8
Compare
949e87b to
5a76392
Compare
35d6cb8 to
03227b5
Compare
5a76392 to
d315596
Compare
24ba6ee to
7ccb234
Compare
390db46 to
49c7c80
Compare
7ccb234 to
0a77088
Compare
49c7c80 to
a9f4fad
Compare
f25df83 to
680c322
Compare
…SE constants
The three fallback sites in hyper-shader.ts (metadata write, browser/render
mode, and engine mode) had drifted apart: the metadata path used 1s/'none'
while the actual rendering used 0.7s/'power2.inOut'. This meant a transition
without an explicit duration/ease would render at 0.7s but tell the engine
it was 1s, throwing off the producer's compositing window planning.
Extract DEFAULT_DURATION (0.7) and DEFAULT_EASE ('power2.inOut') as
module-level constants and use them at all three sites so a missing
duration/ease produces identical behavior in preview, the engine's
deterministic seek path, and the metadata the producer reads.
The explicit `ease: 'none'` on the timeline-length anchor tweens elsewhere
in the file is intentional (those are linear interpolators driving the
shader's progress uniform) and is left unchanged.
478d5cf to
5de5df7
Compare
d095760 to
95303f3
Compare
95303f3 to
d095760
Compare
Merge activity
|

Summary
Extract
DEFAULT_DURATION = 0.7andDEFAULT_EASE = "power2.inOut"as shared constants inhyper-shader.tsand apply them at all three fallback sites (metadata write, browser/render mode, engine mode).Why
Chunk 2ofplans/hdr-followups.md. The three fallback sites had drifted apart: the metadata path used1s/"none"while the actual rendering used0.7s/"power2.inOut". A transition that omittedduration/easewould render at 0.7 s but tell the producer it was 1 s, throwing off the producer's compositing window planning and producing a visible ~0.3 s brightness dropout.This is a small, high-value correctness fix that runs before the larger Chunk 1 / Chunk 4 work.
What changed
DEFAULT_DURATIONandDEFAULT_EASEconstants inpackages/shader-transitions/src/hyper-shader.ts.ease: "none"on the timeline-length anchor tweens elsewhere in the file is intentional (those are linear interpolators driving the shader's progress uniform) and is left unchanged.Test plan
durationandease— no brightness dip in the last ~0.3 s of the transition.duration: 1.5still works (constants are fallbacks only).Stack
Chunk 2 of
plans/hdr-followups.md. Lands ahead of Chunk 1 (opacity) per the suggested merge order.