Skip to content

Frame generation: rounding noise in a uniform row is not a list switching (#899) - #912

Merged
peiikai merged 1 commit into
release/0.6from
fix/899-fg-flicker
Nov 28, 2026
Merged

peiikai merged 1 commit into
release/0.6from
fix/899-fg-flicker

Conversation

@peiikai

@peiikai peiikai commented Nov 28, 2026

Copy link
Copy Markdown
Owner

Fixes #899: with Frame Generation on, the scenery flickered after talking to an NPC.

What was wrong

interp_prepare (runtime/nvn/interp.c) has a rule for fragment-stage buffers: when an element goes between exactly 0 and non-zero, the buffer is treated as a list whose slots switch (the game's light list), and the whole buffer shows this frame's values. The only filter on "non-zero" was an absolute 1e-6.

After an NPC talk, the camera block's fragment-stage copy (stage 1, slot 1, 1024 bytes) holds a row of 0.445, -1.9e-06, -254.3, 254.5. The -1.9e-06 is rounding noise, and during the camera zoom-out it went to 0 and back. The rule then gave those in-betweens this frame's camera in the fragment stage but the blended camera in the vertex stage. The tilt-shift blur and the near-camera dither fade came out wrong for single images, which showed as the flicker. The reporter's log shows it: lists switched is 0.3 per frame before the talk and 12-20 after it.

The fix

A value going to or from zero now also has to be larger than 1e-5 of the largest value in its row of four (in either frame). A real list slot switching on still counts: its row's largest element is the one that changes. Rounding noise next to values of about 250 no longer does.

Testing

Repro on both machines: scratch save, warp to Field_12B, talk to Grandma Yahoo, close the text, walk. Every image was saved with LARECOMP_INTERP_SEQ, and the sharpness of each in-between was compared with its game images.

  • macOS, Metal (Apple Silicon, 120 Hz): before, in-betweens during the zoom-out had screen-door dither on the grass and tree tops, and lists switched was 15-20. After: none, and lists switched is 0.0. Angler's Tunnel still shows real light-list switches (1-2.5 per frame), so the rule still does its original job.
  • Windows 11, Vulkan (RTX 3080 Ti, LARECOMP_INTERP_HZ=240, the reporter's settings: 2x, bilinear, shadows 4x, AO high): before, single in-betweens in the zoom-out were far sharper than both neighbours (+7.5 on the top band) with dither and facets. After: every in-between is within 0.12 of its game image, with no dither. Builds clean.

🤖 Generated with Claude Code

…hing (#899)

The rule that shows a fragment-stage buffer whole at this frame's values
when an element goes between zero and non-zero (the light list filling
its slots in another order) also caught the camera block's fragment-stage
copy after an NPC talk: one matrix element sat at -1.9e-06 next to
values of about 254 and went to 0 and back as the camera zoomed out. The
in-betweens then read this frame's camera in the fragment stage and the
blended one in the vertex stage, and the tilt-shift blur and the
near-camera dither fade went wrong for single images: the environment
flickered. Such a value is now measured against the largest value in
its row of four (either frame) as well as the old 1e-6.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@peiikai
peiikai merged commit f40e547 into release/0.6 Nov 28, 2026
8 checks passed
@peiikai
peiikai deleted the fix/899-fg-flicker branch November 28, 2026 09:03
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