Skip to content

Crop the top and blur by distance as the lid closes - #24

Merged
pulkitxm merged 1 commit into
Noveum:mainfrom
ReffWu:crop-and-distance-blur
Sep 15, 2026
Merged

pulkitxm merged 1 commit into
Noveum:mainfrom
ReffWu:crop-and-distance-blur

Conversation

@ReffWu

@ReffWu ReffWu commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Two new Look settings, both on by default, bring the fold closer to what a real lid does when you watch it close from your seat.

Crop from the top. A closing lid seen from the front gets shorter, so less of the desktop should fit. The bottom row stays at the hinge and the shader samples only the lower cos(0.65 x 90 degrees x progress) of the desktop, so the top slides out of view. The full cosine (the bottom 71 percent at half closure) matches a viewer looking straight at the lid, but from a normal seat above the screen it read as too much stretch. With 0.65 it keeps about 87 percent at half closure and 52 percent when shut.

Blur by distance. Blur follows each point's distance from where the open screen stood: its height above the hinge times sin(90 degrees x progress). The hinge edge stays sharp at every angle and the blur keeps growing toward the top until the lid is shut. Turning it off keeps the current falloff.

Both are one extra term each in Fold.metal, driven by two new FoldParameters fields, with no new passes or textures, and each toggle applies on the next frame without restarting capture. MOTION.md describes both.

Current main and this branch at 30, 55, 80 and 95 percent closure

Happy to flip either default to off if you would rather keep today's look as the default.

Validated with swift-format lint --strict Sources/*.swift, python3 scripts/check.py policy, and make build. The comparison above was rendered offscreen through DesktopRenderer, which compiles Fold.metal at runtime.

Two new Look settings, both on by default, make the fold behave more like
a real lid seen from a normal seat.

Crop from the top keeps the bottom row at the hinge and samples only the
lower cos(0.65 x 90 degrees x progress) of the desktop, so the top slides
out of view as the lid closes. The full cosine matches a viewer looking
straight at the lid but read as too much stretch from above the screen.

Blur by distance sets the blur from each point's distance to where the
open screen stood, its height above the hinge times sin(90 degrees x
progress), so the hinge stays sharp and the blur keeps growing toward the
top until the lid is shut. With it off, the current falloff is kept.
@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 58 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: f3e61fa8-5260-4e0e-8cc9-f963d4bdb871

📥 Commits

Reviewing files that changed from the base of the PR and between a1ccaf6 and 7ee0ec7.

📒 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.

@pulkitxm
pulkitxm merged commit 43b03d0 into Noveum:main Sep 15, 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