fix(background): make pixel_grid's twinkle reach both ends of the range - #206
Merged
Conversation
The cell alpha oscillated over 0.10..1.00, so a cell never actually went out. A lattice whose cells only dip to a tenth still reads as a fixed field of permanent dots, just dimmer — which is not what an animated texture is for. 0.5 + 0.5 * sin gives the full 0 → 1 → 0. The phase still comes from each cell's own hash, or the whole field blinks in unison. The test pins the range rather than the fact that something moves: it samples 400 instants and asserts the floor goes under 0.01 and the ceiling over 0.99. "It animates" and "it reaches zero" are different claims.
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
pixel_grid'stwinkleoscillated the cell alpha over0.10..1.00, so a cell never went out. A lattice whose cells only dip to a tenth still reads as a fixed field of permanent dots — just dimmer — which is not what an animated texture is for.The phase still comes from each cell's own hash, or the whole field blinks in unison.
Test
It pins the range, not the fact that something moves: 400 sampled instants, floor under
0.01, ceiling over0.99. "It animates" and "it reaches zero" are different claims, and only the second one was asked for.Note
This should have shipped with #205 — I said it had, and it had not: the change was still uncommitted in my working tree when that branch was pushed. Caught by a
git diffwhen the branch refused to switch.cargo test --workspacegreen,cargo fmt --checkandcargo clippy --all-targets -- -D warningsclean.