Repository navigation
ambient: the page wash dithers on every frame, at ~60 fps - #142
Merged
Merged
Conversation
The owner reported banding on the ambient background during animations. `gfx::page_wash_dither` read the frame's global motion verdict, and every spring reports to it, including `AmbientWash::step`'s own twelve corner springs. As a result the wash drew undithered for its whole colour dissolve and for every focus pop, shelf scroll and press dip on the page. The gate is gone. The wash dithers on every frame, and the cost that originally justified the gate was removed at its sources: - dither.glsl: the noise tile coordinate is a varying from the paired vertex shader (`glsl_vs_dithered!`, `PLX_DITHER_NC`). It is no longer a highp multiply of `gl_FragCoord` per fragment. - dither.glsl: the prelude is straight-line code. The uniform branch cost +5.8M arithmetic words a frame on a scrolling Library. The "dither off" case uses a plain twin program. - fs_img: card interiors beyond the rim's reach return the texel before the rounded-rect SDF runs (`u_inner`, `gfx::card_inner`). - fs_ambient: the bilinear field is evaluated per vertex of a 16x16-cell mesh (`gfx::field_mesh`, error under half a code). Per fragment, the wash is now one varying plus the dither. Deleted: `gfx::page_wash_dither`, `idle::underlay_moving` and `note_underlay_motion`. `draw_ambient`, `Painter::ambient` and `AmbientWash` no longer take a dither flag. Detail's TextView wrap goes through the global `wrap_memo` when the measurer's font is live. Measured on the TV, two runs each: hero 60, fold 57 (robust min 55), grid 58/57, detail 59/58, settings 60, library 60, account glass 58. Capture taken mid-dive: the band under Home's hero has an adjacent-pixel change of ~0.70 with dither, against 0.023 with the old gate (flat plateaus). The census is in docs/backdrop-blur-profiling.md. Co-Authored-By: Claude Opus 5 <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Correct physical-coordinate handling for supersampled rendering and the live-font wrap documentation still need updates.
Review effort: Lite
Findings: None
What changed in this PR
This PR removes motion-based dithering gates for ambient washes, reduces rendering cost, and memoizes live-font text wrapping.
Changes:
- Always dither ambient washes.
- Move dithering and ambient-field work to vertex/mesh paths.
- Optimize card interiors and update live-font wrapping.
| File | Summary |
|---|---|
rust-modules/src/ui/widgets.rs |
Simplifies ambient wash drawing and capability handling. |
rust-modules/src/ui/text_view.rs |
Adds live-font wrap memoization; documentation needs the live-font exception. |
rust-modules/src/ui/rec.rs |
Propagates measurement capabilities. |
rust-modules/src/ui/popover.rs |
Removes underlay-motion publication. |
rust-modules/src/ui/mod.rs |
Simplifies the ambient painter API. |
rust-modules/src/ui/machine.rs |
Adds Measure::live_font. |
rust-modules/src/ui/idle.rs |
Removes obsolete underlay-motion state. |
rust-modules/src/ui/CLAUDE.md |
Updates dithering guidance. |
rust-modules/src/text.rs |
Marks TTF measurement as live. |
rust-modules/src/shaders/vs_img.vert |
Adds dither coordinates; physical render-scale handling needs correction. |
rust-modules/src/shaders/vs_ambient.vert |
Adds mesh-field and dither varyings; physical viewport handling needs correction. |
rust-modules/src/shaders/fs_img.frag |
Adds the card-interior fast path. |
rust-modules/src/shaders/fs_glass.frag |
Updates dither documentation. |
rust-modules/src/shaders/fs_ambient.frag |
Uses interpolated field colors. |
rust-modules/src/shaders/dither.glsl |
Removes branching and fragment-coordinate arithmetic; coordinate scaling needs correction. |
rust-modules/src/shaders/dither_stub.glsl |
Updates plain-program behavior. |
rust-modules/src/screens/home/mod.rs |
Removes the wash gate and related plumbing. |
rust-modules/src/screens/detail/mod.rs |
Removes detail wash gating. |
rust-modules/src/gfx.rs |
Adds field meshes, shader variants, and card optimization. |
rust-modules/src/app/run.rs |
Removes obsolete motion-gate documentation. |
docs/backdrop-blur-profiling.md |
Records performance measurements and rationale. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Sep 19, 2026
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.
ambient: the page wash dithers on every frame, at ~60 fps
The owner reported banding on the ambient background during animations.
gfx::page_wash_ditherread the frame's global motion verdict, and everyspring reports to it, including
AmbientWash::step's own twelve cornersprings. As a result the wash drew undithered for its whole colour dissolve
and for every focus pop, shelf scroll and press dip on the page.
The gate is gone. The wash dithers on every frame, and the cost that
originally justified the gate was removed at its sources:
vertex shader (
glsl_vs_dithered!,PLX_DITHER_NC). It is no longer ahighp multiply of
gl_FragCoordper fragment.+5.8M arithmetic words a frame on a scrolling Library. The "dither off"
case uses a plain twin program.
the rounded-rect SDF runs (
u_inner,gfx::card_inner).mesh (
gfx::field_mesh, error under half a code). Per fragment, thewash is now one varying plus the dither.
Deleted:
gfx::page_wash_dither,idle::underlay_movingandnote_underlay_motion.draw_ambient,Painter::ambientandAmbientWashno longer take a dither flag. Detail's TextView wrap goesthrough the global
wrap_memowhen the measurer's font is live.Measured on the TV, two runs each: hero 60, fold 57 (robust min 55),
grid 58/57, detail 59/58, settings 60, library 60, account glass 58.
Capture taken mid-dive: the band under Home's hero has an adjacent-pixel
change of ~0.70 with dither, against 0.023 with the old gate (flat
plateaus). The census is in docs/backdrop-blur-profiling.md.
First of the ambient layers: dither fix, then the underlay field, modal dims, the stress bench, panel material, and transition hitches.
🤖 Generated with Claude Code