[PR #54] [MERGED] Fix GUI item lighting, resolution-dependent preview seams and glyph bleeding #2303

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

📋 Pull Request Information

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

Base: main ← Head: fix/vanilla-gui-item-previews


📝 Commits (1)

  • 1499c2a Fix GUI item lighting, preview seams and glyph bleeding

📊 Changes

5 files changed (+114 additions, -30 deletions)

View changed files

📝 crates/horizon-client/src/font.rs (+25 -16)
📝 crates/horizon-client/src/game.rs (+3 -8)
📝 crates/horizon-client/src/hud.rs (+35 -0)
📝 crates/horizon-client/src/item_render/gui.rs (+0 -6)
📝 crates/horizon-client/src/item_render/special.rs (+51 -0)

📄 Description

Summary

Fix three reproducible GUI rendering defects without removing the intended vanilla item lighting:

  • Special-item lighting: the GUI pose has a reflected axis. Computing a face normal from transformed winding reverses it under that reflection, unlike the vanilla PoseStack normal matrix. Correct the winding-derived normal for the complete part transform, covering GUI and other mirrored special-item submissions. Remove the loom preview workaround so it does not apply the correction twice. No chest geometry changes.
  • Resolution-dependent item seams: center creative and inventory/container screens using Java-style integer division, matching AbstractContainerScreen.init. Fractional origins could place a shared face edge on a physical pixel center and expose neighboring transparent atlas texels. Drawing and hit testing continue to use the same origins; the recipe-book offset is preserved.
  • Stray line above lowercase o after resizing: bitmap and runtime unihex glyphs now use the 0.01-texel UV inset from FontTexture.add. This prevents neighboring glyph pixels from being sampled, without changing glyph dimensions or advances.

Regression tests

Three tests were added and observed failing before their fixes:

  • Special-model normals under rotated poses with one or two reflected axes and non-uniform scales.
  • Container centering at odd logical sizes and with panels larger than the GUI (including truncation toward zero).
  • Native glyph UV inset with unchanged dimensions, including narrow and runtime-sized cells.

Validation

  • Repository gate with vanilla harness runner disabled: public-tree check, rustfmt, warning-denied workspace/all-target clippy, Rust tests, doc tests and Python tests passed. Client library: 352 tests passed.
  • Native HUD differential: 2,200/2,200 states matched.
  • Headless comparison against actual pinned vanilla 26.3 ModelPart.render: 60 pose cases across 10 chest/conduit/shield/trident/skull layers; 756 nondegenerate face normals and positions matched (maximum normal-vector error about 3.27e-6).
  • Ordinary chest under GUI reflection: normal mismatches changed from 18/18 to 0/18. Twelve loom banner-preview normals also matched the expected reflected/animated pose.
  • Actual HUD pipeline GPU repro: the original oak-planks shared edge exposed 21 background pixels; integer centering removes the strip. Original fractional glyph rendering produced 15 stray pixels above o; native UV inset removes them.
  • Headless GPU resize/scale matrix: 70 cases spanning 854x480 through 3840x2160 and GUI Scale Auto/1..6; 2,040 checked face-edge pixels were filled and 1,632 above-glyph pixels stayed clear.
  • Isolated client build and resize smoke completed. Captured previously failing 1920x1080 and 1600x900 GUI Scale 3 previews no longer contain the sampled seam.

Scope / limits

This is a separate GUI PR; it does not include changes from the earlier camera/particles/cracks, outline or mob-lighting PRs. Minecraft resources, native probes and screenshots remain in ignored local research files.

These checks do not constitute full vanilla framebuffer parity for every item, custom resource pack, animation or font. Glyph GPU checks use the default bitmap font; unihex uses the same tested UV helper. Existing painter-style item depth handling, Horizon menu-theme density and forced-Unicode GUI-scale handling are unchanged.


🔄 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/54 **Author:** [@Online5277](https://github.com/Online5277) **Created:** 10/13/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/vanilla-gui-item-previews` --- ### 📝 Commits (1) - [`1499c2a`](https://github.com/horizon-rust/horizon/commit/1499c2a8889b7a1e212b54ef20aad8fd23719532) Fix GUI item lighting, preview seams and glyph bleeding ### 📊 Changes **5 files changed** (+114 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/font.rs` (+25 -16) 📝 `crates/horizon-client/src/game.rs` (+3 -8) 📝 `crates/horizon-client/src/hud.rs` (+35 -0) 📝 `crates/horizon-client/src/item_render/gui.rs` (+0 -6) 📝 `crates/horizon-client/src/item_render/special.rs` (+51 -0) </details> ### 📄 Description ## Summary Fix three reproducible GUI rendering defects without removing the intended vanilla item lighting: - **Special-item lighting:** the GUI pose has a reflected axis. Computing a face normal from transformed winding reverses it under that reflection, unlike the vanilla PoseStack normal matrix. Correct the winding-derived normal for the complete part transform, covering GUI and other mirrored special-item submissions. Remove the loom preview workaround so it does not apply the correction twice. No chest geometry changes. - **Resolution-dependent item seams:** center creative and inventory/container screens using Java-style integer division, matching AbstractContainerScreen.init. Fractional origins could place a shared face edge on a physical pixel center and expose neighboring transparent atlas texels. Drawing and hit testing continue to use the same origins; the recipe-book offset is preserved. - **Stray line above lowercase o after resizing:** bitmap and runtime unihex glyphs now use the 0.01-texel UV inset from FontTexture.add. This prevents neighboring glyph pixels from being sampled, without changing glyph dimensions or advances. ## Regression tests Three tests were added and observed failing before their fixes: - Special-model normals under rotated poses with one or two reflected axes and non-uniform scales. - Container centering at odd logical sizes and with panels larger than the GUI (including truncation toward zero). - Native glyph UV inset with unchanged dimensions, including narrow and runtime-sized cells. ## Validation - Repository gate with vanilla harness runner disabled: public-tree check, rustfmt, warning-denied workspace/all-target clippy, Rust tests, doc tests and Python tests passed. Client library: 352 tests passed. - Native HUD differential: 2,200/2,200 states matched. - Headless comparison against actual pinned vanilla 26.3 ModelPart.render: 60 pose cases across 10 chest/conduit/shield/trident/skull layers; 756 nondegenerate face normals and positions matched (maximum normal-vector error about 3.27e-6). - Ordinary chest under GUI reflection: normal mismatches changed from 18/18 to 0/18. Twelve loom banner-preview normals also matched the expected reflected/animated pose. - Actual HUD pipeline GPU repro: the original oak-planks shared edge exposed 21 background pixels; integer centering removes the strip. Original fractional glyph rendering produced 15 stray pixels above o; native UV inset removes them. - Headless GPU resize/scale matrix: 70 cases spanning 854x480 through 3840x2160 and GUI Scale Auto/1..6; 2,040 checked face-edge pixels were filled and 1,632 above-glyph pixels stayed clear. - Isolated client build and resize smoke completed. Captured previously failing 1920x1080 and 1600x900 GUI Scale 3 previews no longer contain the sampled seam. ## Scope / limits This is a separate GUI PR; it does not include changes from the earlier camera/particles/cracks, outline or mob-lighting PRs. Minecraft resources, native probes and screenshots remain in ignored local research files. These checks do not constitute full vanilla framebuffer parity for every item, custom resource pack, animation or font. Glyph GPU checks use the default bitmap font; unihex uses the same tested UV helper. Existing painter-style item depth handling, Horizon menu-theme density and forced-Unicode GUI-scale handling are unchanged. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 15:54:46 +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#2303
No description provided.