fix(transition): crossfade backgrounds in float and complete the pan - #131
Merged
Conversation
Three defects in the camera pan, all measured. The background stepped by a full level across the whole frame at every junction. `set_alpha_f` quantises to an 8-bit alpha; while that byte is below 255 the premultiplied blend truncates ~1 LSB per channel everywhere, and the instant it reaches 255 Skia takes the exact opaque path and every pixel gains the level back in a single frame. The step measured exactly 1.0 in all six transitions of the dark-premium template, and a prediction that it moves to wherever the alpha byte first saturates held on four different easings. Crossfading in f32 removes it: 1.01 to 0.01 at the same frame, now matching the surrounding curve. `background: static` held the outgoing scene's background for the entire pan and then cut to the incoming one — 37.9 luminance units in a single frame on a synthetic pair. It now crossfades, which is a no-op when the two backgrounds match and softens the cut when they do not, rather than erroring on a case authors can legitimately write. Transitions never rendered their completed state: frames ran 0..N-1 against a divisor of duration*fps, so progress peaked at 0.978 and the residual was discharged in the first normal frame. Measured as a 22px foreground snap with linear easing; now 0px. Pixel baselines shift for every camera_pan, and slightly for other transitions near their last frame — both intended. Closes #124
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.
Closes #124. Part of the chantier #123.
Independent of the other six workstreams: disjoint file set, compiles and tests green on its own against
main. Mergeable in any order.Full rationale, measurements and evidence are in the commit message and in #124.