[PR #165] [MERGED] Fix inventory banner face depth ordering #2367

Closed
opened 2026-11-02 15:55:22 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/165
Author: @rdbtCVS
Created: 10/14/2026
Status: ✅ Merged
Merged: 10/14/2026
Merged by: @ludovic111

Base: main ← Head: t3code/fix-inventory-banner-rendering


📝 Commits (2)

  • 8987369 Fix inventory banner face depth ordering
  • 79ab688 Fix banner rendering test lint on Rust 1.99

📊 Changes

2 files changed (+235 additions, -28 deletions)

View changed files

📝 crates/horizon-client/src/item_render/gui.rs (+116 -28)
➕ crates/horizon-client/src/item_render/gui/depth.rs (+119 -0)

📄 Description

Inventory banners show a jagged wooden strip across the top of the cloth because GUI item faces were sorted by average depth. The long, tilted cloth face was drawn before the shorter support face even where the cloth is nearer.

Order visible GUI item faces by their planes, splitting intersecting faces and interpolating their UVs. Preserve submission order for coplanar banner and shield pattern layers. This fixes the shared inventory/hotbar rendering path without changing banner geometry or poses.

Before and after

The enlarged white-banner crops come from the inventory screenshots below (8× nearest-neighbor zoom). Before the fix, the wooden support shows through the top of the cloth as a jagged strip; afterward, the cloth correctly covers it.

Before fix After fix
Horizon before: jagged wooden strip across the banner cloth Horizon after: cloth correctly covers the wooden support

Horizon before fix — all 16 banner colors

Horizon inventory before the banner depth-ordering fix

Horizon after fix — all 16 banner colors

Horizon inventory after the banner depth-ordering fix

Minecraft 26.3 reference — supplied screenshot

Minecraft 26.3 Colored Blocks inventory showing the expected banner appearance

Validation:

  • Confirmed the cloth/support regression fails before the fix and passes afterward; added coverage for crossing faces, interpolated UVs, and coplanar pattern order.
  • cargo test --workspace --lib: 672 passed.
  • cargo fmt --all -- --check and python tools/check_public_tree.py: passed.
  • Compared live offscreen inventory screenshots before and after with all 16 banner colors; the exposed support strip is corrected.
  • Rust 1.99.0: cargo clippy --locked --workspace --all-targets -- -D warnings passed without lint exceptions.
  • All five GUI rendering tests passed with the triangle helper updated to use fixed-size array chunks.

🔄 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/165 **Author:** [@rdbtCVS](https://github.com/rdbtCVS) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/14/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `t3code/fix-inventory-banner-rendering` --- ### 📝 Commits (2) - [`8987369`](https://github.com/horizon-rust/horizon/commit/8987369b07db03fd98e825b40071c3aed663775c) Fix inventory banner face depth ordering - [`79ab688`](https://github.com/horizon-rust/horizon/commit/79ab688bda0059173b43b00dffb51d9727be365e) Fix banner rendering test lint on Rust 1.99 ### 📊 Changes **2 files changed** (+235 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/item_render/gui.rs` (+116 -28) ➕ `crates/horizon-client/src/item_render/gui/depth.rs` (+119 -0) </details> ### 📄 Description Inventory banners show a jagged wooden strip across the top of the cloth because GUI item faces were sorted by average depth. The long, tilted cloth face was drawn before the shorter support face even where the cloth is nearer. Order visible GUI item faces by their planes, splitting intersecting faces and interpolating their UVs. Preserve submission order for coplanar banner and shield pattern layers. This fixes the shared inventory/hotbar rendering path without changing banner geometry or poses. ### Before and after The enlarged white-banner crops come from the inventory screenshots below (8× nearest-neighbor zoom). Before the fix, the wooden support shows through the top of the cloth as a jagged strip; afterward, the cloth correctly covers it. | Before fix | After fix | | --- | --- | | ![Horizon before: jagged wooden strip across the banner cloth](https://raw.githubusercontent.com/rdbtCVS/horizon/8405fbc53603d8aa313c61ab69593a58085fa937/banner-before-detail.png) | ![Horizon after: cloth correctly covers the wooden support](https://raw.githubusercontent.com/rdbtCVS/horizon/8405fbc53603d8aa313c61ab69593a58085fa937/banner-after-detail.png) | **Horizon before fix — all 16 banner colors** ![Horizon inventory before the banner depth-ordering fix](https://raw.githubusercontent.com/rdbtCVS/horizon/8405fbc53603d8aa313c61ab69593a58085fa937/horizon-before.png) **Horizon after fix — all 16 banner colors** ![Horizon inventory after the banner depth-ordering fix](https://raw.githubusercontent.com/rdbtCVS/horizon/8405fbc53603d8aa313c61ab69593a58085fa937/horizon-after.png) **Minecraft 26.3 reference — supplied screenshot** ![Minecraft 26.3 Colored Blocks inventory showing the expected banner appearance](https://raw.githubusercontent.com/rdbtCVS/horizon/8405fbc53603d8aa313c61ab69593a58085fa937/minecraft-reference.png) Validation: - Confirmed the cloth/support regression fails before the fix and passes afterward; added coverage for crossing faces, interpolated UVs, and coplanar pattern order. - `cargo test --workspace --lib`: 672 passed. - `cargo fmt --all -- --check` and `python tools/check_public_tree.py`: passed. - Compared live offscreen inventory screenshots before and after with all 16 banner colors; the exposed support strip is corrected. - Rust 1.99.0: `cargo clippy --locked --workspace --all-targets -- -D warnings` passed without lint exceptions. - All five GUI rendering tests passed with the triangle helper updated to use fixed-size array chunks. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 15:55:22 +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#2367
No description provided.