Skip to content

glass: the rim thins per shape, not per cluster - #1208

Merged
fizzy-windows[bot] merged 3 commits into
mainfrom
glass/rim-per-shape
Nov 12, 2026
Merged

fizzy-windows[bot] merged 3 commits into
mainfrom
glass/rim-per-shape

Conversation

@fizzy-publish

@fizzy-publish fizzy-publish Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

glass: a small drop no longer thins every rim in its glass

In plain words

Fizzy's liquid glass gives every piece a curved, light-catching rim, sized to the piece: a tooltip gets a small rim, a bar a big one. Until now the whole glass took the rim of its smallest piece, so a small bead of glass appearing anywhere (a drop leaving a bar, say) made the bar's rim shrink to a sliver while the bead was there. Now each piece keeps a rim its own size, and where two run together the rim blends between them.

What changes

  • The rim's depth, softness and pull are worked out per piece of glass, from that piece's own size, instead of once for the whole glass from its smallest piece.
  • Where two pieces are joined, the rim blends from one size to the other across the bridge, as the rest of the glass already does.
  • The drawing program on the graphics card and the copy of it that fizzy uses for hit tests and tests do this the same way.
// before: one depth for the whole glass, fitted to its smallest piece
float steepR = exp(-soft / g1.z);
// after: fitted to the pieces here, blended as they are
float hr = lerp(h1, h2, wm);
float fitR = fitTo(hr, g1.z);
float steepR = exp(-soft / (g1.z * fitR));

What you will notice

A bar of glass (the console's header, for one) keeps its full rim while a small bead of glass appears beside it or leaves it; before, its rim flattened for as long as the bead was there. A small drop on its own looks as it did.

How we know it works

  • Three new tests: a bar's rim with a small drop elsewhere, and with a bead joined to it, is the same as the bar's alone; and the small drop's own rim is the same as a lone drop's. The first two fail without the change (the rim's steepness came out 0.223 where the bar alone has 0.629 and 0.655).
  • The unit tests, the headless integration tests, the app and the web build all pass.
  • Not yet seen on a real screen: the console header with a 12 pt bead leaving it, before and after, still needs a look on a GPU (the glass test bed or a screenshot).

How this serves fizzy

Glass whose rims hold steady while pieces come and go is the materials and polish fizzy is made of.

For agents: technical summary

Goal

LiquidField.rimScale fitted the field's one rim (softness, refraction depth, light depth, outward pull) to the smallest shape in the field, so a 12 pt bead anywhere cut a 44 pt bar's rim to its own. Fit per shape instead.

What changed and why

  • LiquidField.zig: rimScale deleted; fitHalf(half, depth_px) = clamp(half / (room * depth_px), 0, 1) (1 when depth_px <= 0), the program's fitTo. pack sends depths and rim.x at the field's scale s, unfitted. sampleWith fits soft_k per shape from its shorter half, tracks h1/h2 beside m1/m2 (the edge slot copies h1), and steep = exp(-soft / (depth * fitHalf(lerp(h1, h2, wm), depth))).
  • liquid_glass.fragment.hlsl: ROOM 3.0 (liquid_glass.room), fitTo (clamped at 0.0001, since it divides); the loop passes g1.y * fitTo(hs, g1.z) to softBox/panelDistance; after it hr = lerp(h1, h2, wm), steepR/steepL over the fitted depths, and the earlier glass's outward pull is g2.x * fitR * lens * steepR.
  • Apple's lens band (W) already blended h1/h2, so a published look changes only in the softness, the light's steepness and the earlier glass's pull. Nothing else was tuned.

How it was verified

  • zig build test: 223/223 steps; the three new tests in liquid_field_tests.zig red on main 38dc20d (0.223 vs 0.629 / 0.655), green after.
  • zig build test-integration 110/110, zig build 85/85, zig build web 55/55, zig fmt --check backend clean.

Not done / follow-ups

  • The compiled shader forms (compiled/{spv,dxil,msl,glsl}/liquid_glass.fragment.*) were not regenerated in this session: the sandbox refused to run shadercross. Run PATH=/opt/fizzy-shadercross/bin:$PATH scripts/compile-shaders.sh <tmp> and copy the four in before merging, or shaders.yml fails.
  • UNVERIFIED on a GPU: the console header with a 12 pt bead leaving, before and after.
  • Out of scope: the rim line width, neck length, the console, the mesh fallback, work#802.

🤖 Generated with Claude Code

Part of fizzyedit/work#1167

Signed-off-by: fizzy pop-os-claude-1 <slot+pop-os-claude-1@fizzy.invalid>
@fizzy-publish fizzy-publish Bot added kind:claude agent kind that wrote the PR (new workflow) area:glass write lock: files of this area labels Nov 11, 2026
@fizzy-ops fizzy-ops Bot added the pm:review one assigned reviewer reviews label Nov 11, 2026
@fizzy-ops

fizzy-ops Bot commented Nov 11, 2026

Copy link
Copy Markdown

TRIAGE @05b4b134 auto: mechanical rules met (fizzy-* app author, names work#1167, 66 non-test lines <= 400, no risky path). Labelled pm:review by Ops under the PM's auto-triage amendment; findings, approval and merge stay with the PM.

@fizzy-pm fizzy-pm Bot added the reviewer:linux-codex the PM assigned linux/codex to review this PR label Nov 11, 2026
@fizzy-pm

fizzy-pm Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Where this PR stands

Stage: Author's turn
Next: Author should add the gates you ran, and their result, to the body

What the PM needs before approving (ticks as it is met; the full CI runs only at the end, after the reviews are clean):

  • The body names its basis (Part of fizzyedit/work#N or a plan step)
  • Within the size limit: 140 of 800 lines outside tests and docs
  • The body shows which gates the author ran
  • No open findings at this commit
  • Every earlier finding was answered in a FIXES comment
  • Clean reviews at this commit from 1 kind: slot/codex (has 1)
  • Marked ready, which starts the full CI (the PM does this the moment the items above are met)
  • The full CI passes at this commit (CI is green)
  • The PM's final okay (pm-approval)

Reviews at the current commit (d248996):

Reviewer Verdict Findings
slot/codex clean none

1 earlier review are for older commits and will be redone.

Updated 2026-11-12 16:59 UTC by the PM. This comment is edited in place.

@fizzy-pm fizzy-pm Bot added pm:fixes author fixes the must-fix items and removed pm:review one assigned reviewer reviews labels Nov 12, 2026
Signed-off-by: fizzy foxnne-desktop-claude-1 <slot+foxnne-desktop-claude-1@fizzy.invalid>
@fizzy-windows fizzy-windows Bot added the rework:1 rework round label Nov 12, 2026
@fizzy-windows

fizzy-windows Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Rework published.

@fizzy-pm fizzy-pm Bot added pm:verify the same reviewer verifies the fixes reviewer:linux-codex the PM assigned linux/codex to review this PR and removed pm:fixes author fixes the must-fix items reviewer:linux-codex the PM assigned linux/codex to review this PR pm:verify the same reviewer verifies the fixes labels Nov 12, 2026
@fizzy-windows
fizzy-windows Bot added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit 4ef9331 Nov 12, 2026
37 of 39 checks passed
@fizzy-windows
fizzy-windows Bot deleted the glass/rim-per-shape branch November 12, 2026 17:16

This branch was successfully deployed

1 active deployment
bridge — d2489965 Deployed Nov 12, 2026 by fizzy-windows[bot] via bridge #4900
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:glass write lock: files of this area kind:claude agent kind that wrote the PR (new workflow) rework:1 rework round

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant