Skip to content

Video > Map zoom blur: an option for a sharp world map while zooming - #1143

Open
Zarigis wants to merge 3 commits into
Revivedx:testfrom
Zarigis:map-zoom-blur-off
Open

Zarigis wants to merge 3 commits into
Revivedx:testfrom
Zarigis:map-zoom-blur-off

Conversation

@Zarigis

@Zarigis Zarigis commented Nov 26, 2026 •

Copy link
Copy Markdown

What this changes

A new Video > Map zoom blur option, on by default (the game's look). Off, the world map is sharp the whole time: no blur when it opens or on any zoom step, and no blocky frame when the game swaps one zoom level's tiles for the next. With the option on, nothing changes.

With #1137 the map is drawn at the window's resolution, so the blur and the swap are easy to see above 1080p.

What the game does, and what Off skips
  • Opening the map and most zoom steps: the screen is blurred at 1280x720 and blended back over the map for about half a second through a mask (fs 6da1591e7d7e6726, dfddd20310007579). Skipped while the map is drawn.
  • Zooming in to the closest level: the screen is shrunk to 320x180, blurred, enlarged to 1280x720, and blended over the map through a 192x192 dot mask for about 100 frames. Several programs do that blend (c94630386244616e, d1d87dfe0c81ad63, more), so any draw that reads the blurred 1280x720 image with a small square mask on a frame where the map's picture was drawn is skipped. The map's picture (2250x1080) being drawn that frame also covers ways into the map the screen state misses.
  • Level cross-fade: the old level's tiles fade out and the new level's fade in (fs 10e88719ecc264ca) over the coarsest level enlarged many times. Those tiles are drawn opaque instead, so a zoom is a cut.
  • The gap between levels: zooming in, the game stops drawing the old level a few frames before the new one is in. Zooming out, the new level's tiles come in a few at a time. In those frames parts of the map are the coarsest level alone (135x135 tiles enlarged): a blocky flash that the blur hid. The game draws a coarsest-level tile under every place in view and a finer one over each place that's in (a closest-level tile covers up to four). A picture counts as whole when the finer tiles cover as many places as the coarsest ones, or when the counts haven't changed for three frames (at the widest levels the finer ones never cover the whole view). When the finer cover falls to under half of the last whole picture's, that picture is copied back over the map's picture before it's put on screen, for at most 8 frames in a row. So only the gap itself is held. Tiles coming in at the edges afterwards show as the game draws them.
The change
  • Settings, control_settings.c, Video options (game_options.mm) and translations: the map_zoom_blur setting (default 1).
  • exec.c:
    • the skips above;
    • the cross-fade tiles drawn opaque (colour only, the picture's alpha left as it is);
    • the held picture: one image the size of the map's picture, made on the first map frame, copied with the same end-pass and full-barrier pattern copy_texture uses, dropped through vk_defer_image when the picture's image changes, and dropped when the map reopens or the game resets (RT_ON_RESET).
  • Cost while the map is open with the option off: one copy of the map's picture per frame.

How it was tested

Windows 11, RTX 4080 SUPER, game 1.9.0, 3840x2160, 240 fps, with the 2x MapHD tiles. Checked in the game by hand, and with scripted runs from a scratch save: Map button, one zoom step, zoom to the closest level and back out, a screenshot every frame.

  • Before: the dot-mask blur for about 100 frames after zooming to the closest level, and 2 blocky frames on the way in and on the way out.
  • After: sharp throughout. Each gap shows the last complete picture for a frame or two, then the new level.
  • On a save with much more of the map uncovered (90 fps, frame generation on), zooming out three steps to the widest level and back in four: the picture is held only at the four level changes, 2 to 4 frames each. An earlier version of this PR waited for every finer tile and could hold for 60 frames at the wider levels.
  • With the option on, the game's blur and fade are unchanged.
Measurements

Sharpness of the map area (mean absolute Laplacian of a 480x270 reduction) per frame:

Frames Before After
Zoom in, the two gap frames 5.9, 5.8 (blocky) 13.6, 13.5 (held)
Zoom out, the gap frames 11.7, 12.2 (blocky) 12.5 to 13.8 (held)

Between runs the settled views differ slightly in framing, so the numbers compare frames within a run, not across.

Checklist

  • Based on the latest test and opened against test
  • Built and run locally, and checked in the game
  • No game files, keys, firmware, generated game code or save files in the changes

As it opens and after each zoom, the world map blurs the screen (1280x720,
four passes each way) and blends that back over the map for about half a
second. With the option off, the two blend draws are skipped while the map
is open; the blur passes themselves are shared with other effects and stay.

On by default (the game's own look).
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