[PR #5654] [MERGED] Scaled F2 screenshots: game resolution × Screenshot Quality (1x–8x) (finished from #5521) #6420

Closed
opened 2026-11-03 06:20:16 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5654
Author: @ludovic111
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: sweepF/5521


📝 Commits (3)

  • 02caa53 Scaled F2 screenshots: game resolution times a Screenshot Quality option
  • de0c665 Scaled screenshots: halve the size when video memory runs out, not crash
  • df8aa42 Merge main into #5521 (serialize: screenshotQuality and main's shadowCache)

📊 Changes

9 files changed (+244 additions, -23 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+167 -15)
📝 crates/horizon-client-render/src/graphics.rs (+26 -1)
📝 crates/horizon-client-render/src/graphics_ui.rs (+32 -0)
📝 crates/horizon-client-render/src/hud.rs (+8 -3)
📝 crates/horizon-client-render/src/hud/pack_text.rs (+7 -4)
📝 crates/horizon-client/src/game.rs (+1 -0)
📝 crates/horizon-client/src/game/chat.rs (+1 -0)
📝 crates/horizon-client/src/game/control.rs (+1 -0)
📝 crates/horizon-client/src/game/options.rs (+1 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Finishes #5521 by @rdbtCVS: their commits as they are, plus a merge of main (the fork doesn't allow maintainer edits). The only conflict was Graphics::serialize, where main's shadowCache (#3702) and this PR's screenshotQuality both joined the format string; both are kept, in field order.


Fixes #3030

F2 screenshots now save at the game's resolution instead of the window's. They also get a new Screenshot Quality option in Video Settings → Display (1x / 2x / 4x / 8x, default 1x).

  • Saved size = window × max(Resolution Scale, 100%) × Screenshot Quality. For example, a 1280×720 window at 200% scale and 2x quality gives 5120×2880.
  • The scaled frame is drawn once into its own offscreen target and depth buffer, and the window's surface is not touched. The world is drawn at the full size, not upscaled. The HUD is zoomed (HudRenderer::zoom, which scales the projection and scissor rects) so its layout matches what's on screen.
  • The size is capped by the GPU's max_texture_dimension_2d and the readback buffer's max_buffer_size. The scaled frame's allocations and draw run inside out-of-memory and validation error scopes. If video memory runs out, no PNG is written and the screenshot is retried on the next frame at half the size, down to the window's. Tested with VRAM full (128 render distance on an 8 GB card) at 8x × 200%: 20480×11520 and 10240×5760 ran out of memory, then 5120×2880 saved, with no crash.
  • The control-socket screenshots and the world icon still use the window size. At 1x and 100% scale nothing changes.
  • Saved in options.txt as screenshotQuality. Any value other than 1, 2, 4 or 8 reads as 1.

Checked in the real game (offscreen, scratch home): at 200% scale and 2x quality, F2 gave a 5120×2880 PNG with the HUD in the right place, and the next frame on the window was still 1280×720. At 8x quality with TAA on it gave the full 10240×5760 (within this GPU's limits), with no errors.

Screenshots

The new setting, in Graphics: Advanced → Display:

Screenshot Quality: 8x in Graphics: Advanced

An F2 screenshot at Resolution Scale 100% and Screenshot Quality 8x (TAA on) from a 1280×720 window. It's saved at 10240×5760: full-size PNG (10 MB). Below is a copy scaled down to 1280 wide, then a 1600×900 crop at full size around the crosshair:

8x screenshot, scaled down

8x screenshot, 1:1 crop

pr_ready (tools/pr_ready.py --quick on archlinux, against origin/main at a4873dec4, 3 min 26 s)

Check Result
Scope ✅ 9 files, +244 −23
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 510 passed (41 s)
rustfmt ✅ (7 s)
clippy ✅ (1 min 18 s)
tests: horizon-client, horizon-client-render ✅ 2396 passed (1 min 13 s)
doc tests ✅ 0 passed (6 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/5654 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `sweepF/5521` --- ### 📝 Commits (3) - [`02caa53`](https://github.com/horizon-rust/horizon/commit/02caa53a27f4e6d27799708d7f20b9726eadd233) Scaled F2 screenshots: game resolution times a Screenshot Quality option - [`de0c665`](https://github.com/horizon-rust/horizon/commit/de0c66569214ec1f740435e0f57a446a10d8ed5a) Scaled screenshots: halve the size when video memory runs out, not crash - [`df8aa42`](https://github.com/horizon-rust/horizon/commit/df8aa42d9be0ce754a3e6e3df9bff125e221dffe) Merge main into #5521 (serialize: screenshotQuality and main's shadowCache) ### 📊 Changes **9 files changed** (+244 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+167 -15) 📝 `crates/horizon-client-render/src/graphics.rs` (+26 -1) 📝 `crates/horizon-client-render/src/graphics_ui.rs` (+32 -0) 📝 `crates/horizon-client-render/src/hud.rs` (+8 -3) 📝 `crates/horizon-client-render/src/hud/pack_text.rs` (+7 -4) 📝 `crates/horizon-client/src/game.rs` (+1 -0) 📝 `crates/horizon-client/src/game/chat.rs` (+1 -0) 📝 `crates/horizon-client/src/game/control.rs` (+1 -0) 📝 `crates/horizon-client/src/game/options.rs` (+1 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Finishes #5521 by @rdbtCVS: their commits as they are, plus a merge of main (the fork doesn't allow maintainer edits). The only conflict was `Graphics::serialize`, where main's `shadowCache` (#3702) and this PR's `screenshotQuality` both joined the format string; both are kept, in field order. --- Fixes #3030 F2 screenshots now save at the game's resolution instead of the window's. They also get a new **Screenshot Quality** option in Video Settings → Display (1x / 2x / 4x / 8x, default 1x). - Saved size = window × max(Resolution Scale, 100%) × Screenshot Quality. For example, a 1280×720 window at 200% scale and 2x quality gives 5120×2880. - The scaled frame is drawn once into its own offscreen target and depth buffer, and the window's surface is not touched. The world is drawn at the full size, not upscaled. The HUD is zoomed (`HudRenderer::zoom`, which scales the projection and scissor rects) so its layout matches what's on screen. - The size is capped by the GPU's `max_texture_dimension_2d` and the readback buffer's `max_buffer_size`. The scaled frame's allocations and draw run inside out-of-memory and validation error scopes. If video memory runs out, no PNG is written and the screenshot is retried on the next frame at half the size, down to the window's. Tested with VRAM full (128 render distance on an 8 GB card) at 8x × 200%: 20480×11520 and 10240×5760 ran out of memory, then 5120×2880 saved, with no crash. - The control-socket screenshots and the world icon still use the window size. At 1x and 100% scale nothing changes. - Saved in `options.txt` as `screenshotQuality`. Any value other than 1, 2, 4 or 8 reads as 1. Checked in the real game (offscreen, scratch home): at 200% scale and 2x quality, F2 gave a 5120×2880 PNG with the HUD in the right place, and the next frame on the window was still 1280×720. At 8x quality with TAA on it gave the full 10240×5760 (within this GPU's limits), with no errors. ### Screenshots The new setting, in Graphics: Advanced → Display: ![Screenshot Quality: 8x in Graphics: Advanced](https://raw.githubusercontent.com/rdbtCVS/horizon/pr-screenshots/5521/screenshot-quality-setting.png) An F2 screenshot at Resolution Scale 100% and Screenshot Quality 8x (TAA on) from a 1280×720 window. It's saved at 10240×5760: [full-size PNG (10 MB)](https://raw.githubusercontent.com/rdbtCVS/horizon/pr-screenshots/5521/f2-8x-100pct-10240x5760.png). Below is a copy scaled down to 1280 wide, then a 1600×900 crop at full size around the crosshair: ![8x screenshot, scaled down](https://raw.githubusercontent.com/rdbtCVS/horizon/pr-screenshots/5521/f2-8x-preview.png) ![8x screenshot, 1:1 crop](https://raw.githubusercontent.com/rdbtCVS/horizon/pr-screenshots/5521/f2-8x-crop.png) **pr_ready** (`tools/pr_ready.py --quick` on archlinux, against origin/main at a4873dec4, 3 min 26 s) | Check | Result | | --- | --- | | Scope | ✅ 9 files, +244 −23 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 510 passed (41 s) | | rustfmt | ✅ (7 s) | | clippy | ✅ (1 min 18 s) | | tests: horizon-client, horizon-client-render | ✅ 2396 passed (1 min 13 s) | | doc tests | ✅ 0 passed (6 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:20:16 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#6420
No description provided.