Skip to content

feat(render): opt-in --supersample (SSAA) for crisp moving text#94

Merged
kiyeonjeon21 merged 1 commit into
mainfrom
feat/supersample
Jun 22, 2026
Merged

feat(render): opt-in --supersample (SSAA) for crisp moving text#94
kiyeonjeon21 merged 1 commit into
mainfrom
feat/supersample

Conversation

@kiyeonjeon21

Copy link
Copy Markdown
Owner

Adds an opt-in --supersample N (alias --ss) to render/frame: render at N× and Lanczos-downscale to the scene size, the standard fix for anti-alias shimmer on moving text. reframe's 2.5D perspective is an affine approximation that re-skews glyph edges every frame, so text under a card flip/tilt flickers subtly at 1×; supersampling gives the AA headroom to smooth it.

How

  • frameLoop.tswithPage takes a deviceScaleFactor (default 1); threaded into captureIr/renderFrameAt/captureHtml. At N× the captured PNG is N×-sized. New downscalePng(buf,w,h) (ffmpeg Lanczos) for the single-frame path.
  • encode.tsencodeMp4 gains a downscale?: {width,height} → inserts -vf scale=W:H:flags=lanczos. Frames render N×, mp4 comes out at scene size.
  • cli.ts / frame.ts / composition.ts — parse --supersample/--ss (clamp 1–4), thread through the IR/HTML/composition render paths + the single-frame downscale.
  • Docs: README CLI table, AGENTS.md, eDSL guide.

Golden-safe / determinism

Default (no flag) = deviceScaleFactor:1, no scale filter → byte-identical to today. determinism.test.ts unchanged and green. No IR/DisplayList change. N× is itself deterministic (fixed chromium flags + Lanczos + fixed encode).

Verification

  • pnpm test446 pass incl. byte-identical determinism; pnpm typecheck + pnpm lint clean.
  • reframe frame scene.ts --t 5.5 --ss 1 vs --ss 2 → both output 1920×1080 (downscaled from 2×); the --ss 2 frame has smoother text edges (and compresses smaller — less AA noise).

Out of scope

batch --supersample (batch has its own render loop; a follow). player (live browser, N/A).

🤖 Generated with Claude Code

Render N× via Chromium deviceScaleFactor and Lanczos-downscale to the scene
size at encode — the standard cure for anti-alias shimmer on moving text (the
2.5D affine perspective re-skews glyph edges every frame). On render/frame and
the composition path; alias --ss, clamped 1-4, default 1 = off → byte-identical
to today (determinism goldens unchanged). frameLoop threads deviceScaleFactor
through withPage + adds downscalePng; encode.ts gains a downscale -vf scale.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@kiyeonjeon21 kiyeonjeon21 merged commit 4a5cbb9 into main Jun 22, 2026
1 check passed
@kiyeonjeon21 kiyeonjeon21 deleted the feat/supersample branch June 22, 2026 15:32
@mintlify

mintlify Bot commented Jun 22, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
reframe 🔴 Failed Jun 22, 2026, 3:49 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

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.

1 participant