[PR #638] [MERGED] Correct inventory player scale, labels and equipment overlap #2687

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/638
Author: @Online5277
Created: 10/17/2026
Status: ✅ Merged
Merged: 10/17/2026
Merged by: @ludovic111

Base: main ← Head: fix/inventory-preview-layout


📝 Commits (2)

  • b174299 Match vanilla player render scale and inventory title height
  • 6d8b174 Depth-test inventory preview equipment and clip it with a scissor

📊 Changes

7 files changed (+216 additions, -37 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+1 -8)
📝 crates/horizon-client/src/game/perspective.rs (+61 -7)
📝 crates/horizon-client/src/gfx.rs (+1 -0)
📝 crates/horizon-client/src/hud.rs (+146 -20)
📝 crates/horizon-client/src/hud.wgsl (+2 -2)
📝 crates/horizon-client/src/mobs/render.rs (+4 -0)
📝 crates/horizon-client/src/ui_theme.rs (+1 -0)

📄 Description

Correct the survival inventory's player scale, Crafting label position and equipment overlap. The preview uses vanilla's 0.9375 avatar scale, its Crafting label sits at the native y=6 position, and intersecting shield/arm faces retain their depth when drawn.

Apply the scale in the shared player render transform, so the body, equipment and held items use the same transform in inventory and world rendering. The scale and label coordinates were checked against the pinned 26.3 InventoryScreen, AbstractContainerScreen and AvatarRenderer methods.

Previously the preview discarded per-vertex depth, sorted whole faces by average depth, and clipped angled faces by their centre. Overlapping equipment could therefore paint over the arm in the wrong order, or lose a partially visible face. Preserve depth through the HUD vertex/shader path and render each preview with depth testing and a scissor. Reuse the frame's depth attachment after world/post rendering, clearing it independently for each preview; ordinary HUD draws retain their existing blend behavior. Translucent faces keep their far-to-near submission order.

Fixes #583.

Validation: seven HUD-related tests and three preview tests passed, including crossing faces retaining opposite depth order at their ends, retaining geometry whose centre is outside the scissor, independent preview depth ranges, scaled clipping, shader validation, the prepared-model avatar scale check and the existing flame regression. Client all-target Clippy with warnings denied, formatting and diff checks passed.

Draft for visual testing: equip a shield, move the cursor around the inventory preview to rotate it, and inspect the shield/arm overlap, including near the preview's edges. Check both hands, armour and held items, then the Crafting label and third-person player size. No client or headless visual probe was launched; GPU output and pixel-level parity remain unchecked.


🔄 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/638 **Author:** [@Online5277](https://github.com/Online5277) **Created:** 10/17/2026 **Status:** ✅ Merged **Merged:** 10/17/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/inventory-preview-layout` --- ### 📝 Commits (2) - [`b174299`](https://github.com/horizon-rust/horizon/commit/b174299f2527fd55cd5d988c2a16ad9040131c8d) Match vanilla player render scale and inventory title height - [`6d8b174`](https://github.com/horizon-rust/horizon/commit/6d8b1742167d79e619aa3abe34367c377072f4e6) Depth-test inventory preview equipment and clip it with a scissor ### 📊 Changes **7 files changed** (+216 additions, -37 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+1 -8) 📝 `crates/horizon-client/src/game/perspective.rs` (+61 -7) 📝 `crates/horizon-client/src/gfx.rs` (+1 -0) 📝 `crates/horizon-client/src/hud.rs` (+146 -20) 📝 `crates/horizon-client/src/hud.wgsl` (+2 -2) 📝 `crates/horizon-client/src/mobs/render.rs` (+4 -0) 📝 `crates/horizon-client/src/ui_theme.rs` (+1 -0) </details> ### 📄 Description Correct the survival inventory's player scale, Crafting label position and equipment overlap. The preview uses vanilla's 0.9375 avatar scale, its Crafting label sits at the native y=6 position, and intersecting shield/arm faces retain their depth when drawn. Apply the scale in the shared player render transform, so the body, equipment and held items use the same transform in inventory and world rendering. The scale and label coordinates were checked against the pinned 26.3 InventoryScreen, AbstractContainerScreen and AvatarRenderer methods. Previously the preview discarded per-vertex depth, sorted whole faces by average depth, and clipped angled faces by their centre. Overlapping equipment could therefore paint over the arm in the wrong order, or lose a partially visible face. Preserve depth through the HUD vertex/shader path and render each preview with depth testing and a scissor. Reuse the frame's depth attachment after world/post rendering, clearing it independently for each preview; ordinary HUD draws retain their existing blend behavior. Translucent faces keep their far-to-near submission order. Fixes #583. Validation: seven HUD-related tests and three preview tests passed, including crossing faces retaining opposite depth order at their ends, retaining geometry whose centre is outside the scissor, independent preview depth ranges, scaled clipping, shader validation, the prepared-model avatar scale check and the existing flame regression. Client all-target Clippy with warnings denied, formatting and diff checks passed. Draft for visual testing: equip a shield, move the cursor around the inventory preview to rotate it, and inspect the shield/arm overlap, including near the preview's edges. Check both hands, armour and held items, then the Crafting label and third-person player size. No client or headless visual probe was launched; GPU output and pixel-level parity remain unchecked. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 15:58:15 +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#2687
No description provided.