feat(registry): add the halftone-field texture block - #3112
Closed
miguel-heygen wants to merge 1 commit into
Closed
Conversation
A grid of dots whose size and colour track a flowing noise field, so broad diagonal ridges sweep across a mostly-black frame. The catalog has no texture register at all, and this is a background that runs under type without competing with it. Closed form by construction: the field is a pure function of position and time, so the whole port is uTime = frame / fps. No accumulator, no PRNG, no history. Direct seek, stepped playback and a repeat run all hash identically. One pass rather than the reference's two. Its first pass is analytic, so evaluating the noise at each cell centre returns exactly what a texture fetch would; the render target only earns its place if the field ever becomes something that cannot be evaluated closed form. Two defaults depart from the reference, and its own arithmetic is why. At paletteBias 10 the bias is 0.5, and since the gamma curve lands in [0, 0.70], the value driving both radius and colour is pinned to [0.5, 1]. That puts a hard floor under every dot so nothing can reach black, and narrows the palette window so the first colour stop is unreachable. It renders as a flat evenly-lit lattice. Every formula and mapping is kept verbatim; only paletteBias and frequency move, and both are one slider from the reference values.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
3 tasks
Collaborator
Author
|
Superseded by #3116, which carries all five video primitives in one PR as requested. Same commits, same verification; nothing dropped. |
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
halftone-field: a grid of dots whose size and colour track a flowing noise field, so broad diagonal ridges sweep across a mostly-black frame.Why
The catalog has no texture register at all. This is a background that runs under type without competing with it, and it gives us a general "scalar field to halftone" pass to point at other content later.
How
Closed form by construction. The field is a pure function of position and time, so the entire port is
uTime = frame / fps: no accumulator, no PRNG, no history anywhere.One pass rather than the reference's two. Its first pass is analytic, so evaluating the noise at each cell centre returns exactly what a texture fetch would. The render target only earns its place if the field ever becomes something that cannot be evaluated closed-form (a real texture, a feedback buffer).
Repaint is driven from a property setter on the tweened driver rather than a timeline
onUpdatecallback, because GSAP suppresses events on seek by default and a canvas driven that way freezes on frame 0.The two defaults that depart from the reference
Worth reading before assuming they are taste. The reference's own arithmetic contradicts its stated look.
At
paletteBias = 10the bias is0.5. Sincegray = luma^4.84lands in[0, 0.70], the value driving both dot radius and palette position is pinned to[0.5, 1.0]. Two consequences:#00AAFFarithmetically unreachableRendered, that is a flat evenly-lit purple-grey lattice: the same failure the gamma is supposed to prevent, arriving through bias instead.
Every formula and mapping is kept verbatim. Only two dial defaults move,
paletteBias 10 -> 2andfrequency 5 -> 2, and both are one slider from the reference values.Test plan
hyperframes checkpasses with 0 errors: layout 0 issues across 9 samples, motion 0, contrast 0. Registry item lint 0 errors.oxfmtclean. The runtime warnings are llvmpipeReadPixelsGPU-stall notices from software rendering.WebGL surviving seek-capture was the main risk, so it was tested rather than assumed:
Direct seek equals stepping 90 frames equals a fresh run. Two CLI
snapshot --at 4.2runs are byte-identical. Frames were rendered and looked at at 0/2/4/6/8/9.9s: the main ridge travels lower-left to centre to upper-right, movement is already visible at 0.25s, and the troughs stay near-black with real gaps between dots.The quantise toggle has its own check: stepped
t=3.000equalst=3.020(same 30fps bucket) and differs fromt=3.050, while smooth mode separates all three.Not covered
Frame 0 is already lit rather than black. "Near-black to a blaze in under a second" describes the band sweep, not an intro, and a scripted fade would contradict the closed-form contract. An actual entrance is a small addition if wanted.
No catalog preview PNG; the mdx points at a URL that 404s until
scripts/upload-docs-images.shruns with the publishing profile. Maintainer step.The file trips the 300-line advisory warning at 348 lines, about 90 of which are the simplex-noise function. Not splitting that.