Skip to content

Blur the fold's side gaps together with the desktop and offer a black fill - #18

Merged
pulkitxm merged 6 commits into
Noveum:mainfrom
ReffWu:black-side-fill
Sep 11, 2026
Merged

pulkitxm merged 6 commits into
Noveum:mainfrom
ReffWu:black-side-fill

Conversation

@ReffWu

@ReffWu ReffWu commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

The tapered fold leaves gaps at the upper sides of the display. They were filled with the stretched broad blur of the desktop edge and drawn beside a separately blurred desktop, so a visible seam ran along the fold's edge.

The fill and the desktop are now blurred as one surface. Each blur level is computed from a composite that places the fill in a side margin around the reduced frame, so blurred content spreads across the edge toward the top while the lower edge stays sharp. A new Sides setting chooses the fill: the stretched blur, as before, or black.

Previous blur fill, new blur fill, and new black fill

Left to right, fully closed: the previous blur fill, the new blur fill, and the new black fill. The bottom row zooms into the top-left gap, where the old seam shows. The renders use web/assets/demo-poster.jpg as a stand-in desktop.

  • This changes the default look slightly: the seam at the fold's edge is gone and the top-corner shading now continues into the gaps.
  • Per captured frame this adds one scale into the composite, plus a quarter-size broad blur and a copy for the stretched fill. On an M1 Max the blur chain measured about 0.2 ms per captured frame, up from 0.11 ms; the fold pass is unchanged at about 0.15 ms.

Validated with swift-format lint --strict Sources/*.swift, python3 scripts/check.py policy, make build, and xcrun -sdk macosx metal -c Resources/Fold.metal.

… fill

The tapered fold leaves gaps at the upper sides of the display. They were filled with the stretched broad blur of the desktop edge and drawn beside a separately blurred desktop, so a visible seam ran along the fold's edge.

The fill and the desktop are now blurred as one surface. Each blur level is computed from a composite that places the fill in a side margin around the reduced frame, so blurred content spreads across the edge toward the top while the lower edge stays sharp. A new Sides setting chooses the fill: the stretched blur, as before, or black. The choice is saved and applies on the next frame.

Per captured frame this adds one scale into the composite, plus a quarter-size broad blur and a copy for the stretched fill. On an M1 Max the blur chain measured about 0.2 ms per captured frame, up from 0.11 ms, and the fold pass is unchanged at about 0.15 ms.
@vercel

vercel Bot commented Sep 11, 2026

Copy link
Copy Markdown

@ReffWu is attempting to deploy a commit to the MagicAPI Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 44 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

This review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: bc974d15-0a19-456d-92c0-72912eeed6e4

📥 Commits

Reviewing files that changed from the base of the PR and between 238dc67 and e8b538e.

📒 Files selected for processing (5)
  • MOTION.md
  • Resources/Fold.metal
  • Sources/DesktopRenderer.swift
  • Sources/LiveDesktop.swift
  • Sources/SettingsView.swift

Comment @coderabbitai help to get the list of available commands.

# Conflicts:
#	Sources/SettingsView.swift
The padding around the blur composite has to cover the widest point of
the projection. That width comes from the taper constant in Fold.metal,
but the padding was an independent 0.16 in the renderer, so changing the
taper would have clamped the fill at the top corners with nothing to
catch it. Pass the taper through FoldParameters and size the padding
from the same value.
The black fill went through the same bilinear stretch as the blurred
one, relying on an identity scale to land the reduced frame on exact
texel centres, and it held on to the quarter-size textures it never
read. Clear the composite instead and let the existing blit place the
frame, so both fills share one exact copy and black needs neither the
scratch textures nor the stretch.

encodeBlur now reports whether it encoded anything. Warm-up raises the
preparation error it used to raise before the blur moved into its own
method, and a failed frame leaves blurredGeneration alone so the next
frame retries.
# Conflicts:
#	Sources/LiveDesktop.swift
@pulkitxm
pulkitxm merged commit e2ab731 into Noveum:main Sep 11, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants