Skip to content

Draw the world map's terrain at the window's resolution - #1137

Closed
Zarigis wants to merge 1 commit into
Revivedx:testfrom
Zarigis:map-capture-scale
Closed

Zarigis wants to merge 1 commit into
Revivedx:testfrom
Zarigis:map-capture-scale

Conversation

@Zarigis

@Zarigis Zarigis commented Nov 26, 2026

Copy link
Copy Markdown

The world map now draws its terrain at the window's resolution. Before, it was always drawn at 1080 lines and then stretched, so at 4K the map was a 1080p picture enlarged 2×.

What this changes

AppMap draws the map tiles into a fixed 2250×1080 capture: its 1500×720 layout at 1.5×. Render targets are scaled to the window only when they're 16:9, and this one isn't, so it stayed at its guest size whatever the window.

The capture now gets its own scale group, RS_MAP. That's RS_OUT's vertical scale on both axes, without the HUD handling that RS_OUT passes get. At 3840×2160 the capture is 4500×2160. Nothing else changes size.

Details
  • runtime/nvn/vulkan/textures.c: tex_scale_group recognises the 2250×1080 2D render target (and a depth target of that size, if any) before the 16:9 test. rs_want gives RS_MAP the value g_rs[RS_OUT][1] on both axes.
  • runtime/nvn/vulkan/vk.h: RS_MAP = 4. g_rs isn't indexed with it, and every other check on rs_group compares against a specific group, so a new value doesn't change them.
  • It isn't put in RS_OUT itself, because that would switch on the pause-menu and HUD adjustments that RS_OUT passes get on windows that aren't 16:9 (hud_patch, the scissor cuts). The capture's own fix for wider and taller windows (map_capture_patch) keys on the guest size, so it's unaffected.

How it was tested

Windows 11, RTX 4080 SUPER, NVIDIA 617.42, 3840×2160, game 1.9.0, on test at 2a51d02.

  • Before: matching 4K screenshots against the map tiles gave exactly 2.0 screen pixels per tile texel, at both the closest and the medium zoom. The capture was 2250×1080.
  • After: the frame dump shows the tile draws going into a 4500×2160 target. The map looked right in game, with nothing misplaced, cropped or stretched. With tiles stored at 2× their size, the extra detail now shows; before, it was shrunk back into the 1080-line capture.
Not tested
  • Windows that aren't 16:9 (ultrawide, or the taller layouts map_capture_patch handles), and window sizes other than 3840×2160.
  • Frame time before and after. The capture holds 4× the pixels at 4K, but it's drawn from a few dozen tile quads; the map ran at 200–240 fps.
  • The build tested also had two other commits: Add game_memory_mb: more game memory for HD texture packs #1135, and a Map zoom blur option that isn't in a PR. Neither touches render-target scaling.

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

AppMap draws the map tiles into a fixed 2250x1080 capture (its 1500x720
layout at 1.5x). Its shape is not 16:9, so it was never scaled: at 4K the
map was the 1080-line picture stretched 2x, whatever the window size.

The capture now has its own scale group (RS_MAP): RS_OUT's vertical scale
on both axes, without the HUD handling RS_OUT passes get. At 3840x2160 it
is 4500x2160.
@Zarigis
Zarigis marked this pull request as ready for review November 26, 2026 01:57
Revivedx added a commit that referenced this pull request Nov 26, 2026
… on light ground, texture filtering

- Mods > HD texture packs > More memory for HD textures (#1135, Zarigis): game_memory_mb gives the
  game 6144 MB instead of its own 3120, and grows its resource heaps and texture pool, so big HD
  texture packs load. Off by default (checked: the 3120 MB heap and the same RAM as before); on, about
  3 GB more RAM, and the shaders read a heap past 4 GB by address. The switch is locked off under
  12 GB of RAM. SAVAGEWIND_GAME_MEMORY_MB sets it for one run.
- The world map's terrain capture follows the window's height (#1137, Zarigis): at 4K it was the
  1080p picture stretched 2x.
- Collectible hints stand out on light ground (#1131, Quorthon13): a small copy of the game image,
  read back a few times a second while the hints show, tells each circle how light the ground is.
- The texture memo follows sampler registration (#1118, Dathinel): a filter the game replaced within
  a frame could stay on a later draw.
- Tegra copies take full 64-byte GOB rows as four fixed sector copies (#1129, Dathinel).
- Render context 1/7: the pass in progress is one struct, ExecPass ps (#1139, Dathinel).
- A keyboard regression test for #1103 (#1119, Dathinel).
- The cascade-cut launch flag described on the start screen, and a CI job that keeps the launch flag
  table in sync (#1128, FictionHub).

Measured on a Ryzen 5 5600X + RTX 3060 at 1080p, Original preset (busy PC, 4 runs each): the runtime
changes move fps by -3 to +5 % per route, within the noise.

Co-authored-by: Dathinel <221246794+Dathinel@users.noreply.github.com>
Co-authored-by: Zarigis <2862464+Zarigis@users.noreply.github.com>
Co-authored-by: Quorthon13 <44161862+Quorthon13@users.noreply.github.com>
Co-authored-by: FictionHub <294548785+FictionHub@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Revivedx

Copy link
Copy Markdown
Owner

Integrated in test as 63b7255d, one clean commit with you as co-author. Thanks! Not checked here yet: windows that aren't 16:9.

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