[PR #6411] [MERGED] Title panorama: read the faces through the resource layers #6855

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

📋 Pull Request Information

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

Base: main ← Head: fix/ui-panorama


📝 Commits (1)

  • bbec3f1 Read the title panorama through the resource layers

📊 Changes

3 files changed (+97 additions, -19 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx/panorama.rs (+95 -17)
📝 crates/horizon-client/src/game.rs (+1 -1)
📝 crates/horizon-client/src/game/packs.rs (+1 -1)

📄 Description

Fixes #6357.

Vanilla. CubeMapTexture registers the six assets/minecraft/textures/gui/title/background/panorama_N.png faces with the texture manager like any other texture, so they resolve through the resource manager's pack stack: the topmost pack that has a face supplies it, and the vanilla pack is the bottom layer. A pack that replaces only panorama_overlay.png, or one face, keeps the rest from the layers under it.

Horizon. The resource load flattens the pack stack into one overlay root (packs::resource_root/startup_root), and the panorama read that root alone (Faces::load(root)) — without the game's own resources that the GUI atlas build is given as its defaults (HudAtlas::build_over(root, defaults)). A face missing from the overlay therefore cost the whole cube, even though the game's resources had all six: a pack that filters or replaces title/background, an overlay the Windows mirror skipped (crates/horizon-client-render/src/packs.rs already records that happening to the title panorama), or a prepared tree that never imported the panorama. The warning also dropped the path it looked at — try_load returned the bare io::Error, so a report of "title panorama unavailable (os error 3)" said neither where the game looked nor that horizon-prepare panorama is how the faces arrive.

Faces::load(root, defaults) now takes each face from the first layer that has it, topmost first, exactly as the pack stack does, and validates the six as one cube. Only a cube no layer completes falls back to the 1x1 grey placeholder, and its warning names every path tried and the prepare command, as the missing-sounds warning already does.

Proven:

  • cargo test -q -p horizon-client-render --lib panorama (build box): 7 passed; 0 failed; 954 filtered out. Two new tests: a_pack_without_a_face_keeps_vanillas_and_its_own_face_wins (an overlay root holding one face gets the game's other five, and its own face is the one used) and a_missing_cube_names_every_path_it_tried (with no layer holding the faces, the error names both roots' panorama_1.png and Faces::load yields the 24-byte placeholder).
  • cargo test -q -p horizon-client --lib screen_ids (build box): 1 passed; 585 filtered out, so UiResources::load and the pack reload compile with the extra layer.
  • A client run on the build box (llvmpipe, --offscreen, this branch's own build) against a copy of the prepared resources with assets/minecraft/textures/gui/title/background removed logs Horizon: no title panorama (/data/home/horizon/tmp/nopan/assets/minecraft/textures/gui/title/background/panorama_1.png: No such file or directory (os error 2)); prepare the game again in the launcher (or run horizon-prepare panorama) and reaches the first frame, so a missing panorama now names the path it looked in and leaves a usable title screen.

Not proven:

  • That the missing panorama was the cause of the crash in the report. The report is from v0.2.97, whose loader error had no reason attached (resource loader stopped before finishing) — current main logs the panic — so the loader's panic cannot be identified from it, and v0.2.97's Faces::load already warned and substituted the placeholder rather than panicking. What is proven is the layer gap and the undiagnosable warning above.
  • A Windows run: the reported os error 3 is Windows' path-not-found for that folder (Linux reports os error 2 for the same missing directory), and the fix was exercised on Linux only.
  • The layer resolution in a real client: the offscreen run above has a single resource root (no pack selected), so the second layer is exercised by the unit tests only.

Known limits:

  • A pack that removes a face gets vanilla's face rather than a hole; vanilla's pack stack does the same for a face no pack provides, but it also cannot express "delete this texture" for a cube map, so a pack that removes faces on purpose is unaffected by this either way.
  • Faces of different sizes across layers still fail as one cube ("panorama faces must be equally sized squares") and fall back to the placeholder.

🔄 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/6411 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/ui-panorama` --- ### 📝 Commits (1) - [`bbec3f1`](https://github.com/horizon-rust/horizon/commit/bbec3f1a4a1e4bf9a35d8bf25a71fb58e36fc839) Read the title panorama through the resource layers ### 📊 Changes **3 files changed** (+97 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx/panorama.rs` (+95 -17) 📝 `crates/horizon-client/src/game.rs` (+1 -1) 📝 `crates/horizon-client/src/game/packs.rs` (+1 -1) </details> ### 📄 Description Fixes #6357. **Vanilla.** `CubeMapTexture` registers the six `assets/minecraft/textures/gui/title/background/panorama_N.png` faces with the texture manager like any other texture, so they resolve through the resource manager's pack stack: the topmost pack that has a face supplies it, and the vanilla pack is the bottom layer. A pack that replaces only `panorama_overlay.png`, or one face, keeps the rest from the layers under it. **Horizon.** The resource load flattens the pack stack into one overlay root (`packs::resource_root`/`startup_root`), and the panorama read that root alone (`Faces::load(root)`) — without the game's own resources that the GUI atlas build is given as its `defaults` (`HudAtlas::build_over(root, defaults)`). A face missing from the overlay therefore cost the whole cube, even though the game's resources had all six: a pack that filters or replaces `title/background`, an overlay the Windows mirror skipped (`crates/horizon-client-render/src/packs.rs` already records that happening to the title panorama), or a prepared tree that never imported the panorama. The warning also dropped the path it looked at — `try_load` returned the bare `io::Error`, so a report of "title panorama unavailable (os error 3)" said neither where the game looked nor that `horizon-prepare panorama` is how the faces arrive. `Faces::load(root, defaults)` now takes each face from the first layer that has it, topmost first, exactly as the pack stack does, and validates the six as one cube. Only a cube no layer completes falls back to the 1x1 grey placeholder, and its warning names every path tried and the prepare command, as the missing-sounds warning already does. **Proven:** - `cargo test -q -p horizon-client-render --lib panorama` (build box): `7 passed; 0 failed; 954 filtered out`. Two new tests: `a_pack_without_a_face_keeps_vanillas_and_its_own_face_wins` (an overlay root holding one face gets the game's other five, and its own face is the one used) and `a_missing_cube_names_every_path_it_tried` (with no layer holding the faces, the error names both roots' `panorama_1.png` and `Faces::load` yields the 24-byte placeholder). - `cargo test -q -p horizon-client --lib screen_ids` (build box): `1 passed; 585 filtered out`, so `UiResources::load` and the pack reload compile with the extra layer. - A client run on the build box (llvmpipe, `--offscreen`, this branch's own build) against a copy of the prepared resources with `assets/minecraft/textures/gui/title/background` removed logs `Horizon: no title panorama (/data/home/horizon/tmp/nopan/assets/minecraft/textures/gui/title/background/panorama_1.png: No such file or directory (os error 2)); prepare the game again in the launcher (or run horizon-prepare panorama)` and reaches the first frame, so a missing panorama now names the path it looked in and leaves a usable title screen. **Not proven:** - That the missing panorama was the cause of the crash in the report. The report is from v0.2.97, whose loader error had no reason attached (`resource loader stopped before finishing`) — current main logs the panic — so the loader's panic cannot be identified from it, and v0.2.97's `Faces::load` already warned and substituted the placeholder rather than panicking. What is proven is the layer gap and the undiagnosable warning above. - A Windows run: the reported `os error 3` is Windows' path-not-found for that folder (Linux reports `os error 2` for the same missing directory), and the fix was exercised on Linux only. - The layer resolution in a real client: the offscreen run above has a single resource root (no pack selected), so the second layer is exercised by the unit tests only. **Known limits:** - A pack that removes a face gets vanilla's face rather than a hole; vanilla's pack stack does the same for a face no pack provides, but it also cannot express "delete this texture" for a cube map, so a pack that removes faces on purpose is unaffected by this either way. - Faces of different sizes across layers still fail as one cube ("panorama faces must be equally sized squares") and fall back to the placeholder. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:28:09 +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#6855
No description provided.