[PR #3446] [MERGED] Shields: an enchanted banner shield keeps its patterns under the glint #4987

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3446
Author: @d3grando
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @ludovic111

Base: main ← Head: fix-3407


📝 Commits (1)

  • 1d2d495 Shields: an enchanted banner shield keeps its patterns under the glint

📊 Changes

1 file changed (+109 additions, -11 deletions)

View changed files

📝 crates/horizon-client/src/item_render/special.rs (+109 -11)

📄 Description

🤖 Opened by d3grando's AI agent (Claude Code, Claude Opus 5.5), not by d3grando themselves.

What and why

Fixes #3407

An enchanted shield with a banner on it showed a plain white plate, in the hotbar, in the inventory and in the world: the base colour and the patterns were gone.

item_render/special.rs drew the patterned shield in vanilla's order (the base, the base colour layer, the patterns), then drew entity/shield/shield_base once more with the foil, standing in for vanilla's patternedShieldGlint pass. Vanilla's pass draws only the glint. In Horizon a foil quad is its texture with the glint over it: the GUI emits the textured quad and then the glint, and WorldSink gives it overlay 7. So the extra pass drew the plain base over the base colour and every pattern.

The extra pass is gone. Every layer of a patterned shield now carries the foil. The GUI adds each layer's glint masked by that layer's alpha, and the world shader composites it into each layer, so each pixel ends with the glint once, over the layers below it. That matches vanilla's single glint pass over the finished plate. Shields without patterns and unenchanted shields draw as before.

One difference remains in the world: glint_over in entity.wgsl raises a glinted texel's alpha to at least the glint strength. So a pattern texel with partial alpha (the gradient patterns) draws a bit more opaque on an enchanted shield held or worn in the world. The GUI has no such difference. Matching it exactly in the world would need a glint-only quad drawn with vanilla's additive GLINT blend, which is a separate change to the renderer.

Vanilla reference

  • ShieldSpecialRenderer.submit: without patterns, one submitModel with RenderTypes.entitySolidGlint when it has foil. With patterns: BannerRenderer.submitPatterns, then, when it has foil, order(layers + 2).submitModel(..., RenderTypes.patternedShieldGlint(), ...).
  • RenderTypes.patternedShieldGlint: RenderPipelines.GLINT with only ItemFeatureRenderer.ENCHANTED_GLINT_ITEM as Sampler0 and ENTITY_GLINT_TEXTURING. It draws the glint alone, not the shield sprite.

Read with javap -c on the 26.3 client jar. No harness renders items; the new unit test item_render::special::tests::an_enchanted_banner_shield_keeps_its_patterns_under_the_glint checks which layers are submitted and their foil. It fails on main (the base is submitted again after the patterns) and passes here.

Self-check

Run on Windows 11 (tools/pr_ready.py and tools/parity.py stop on Windows at signal.SIGHUP, so the steps were run by hand):

cargo fmt --all -- --check                                                      ok
cargo clippy -p horizon-client --features mods --all-targets -- -D warnings     ok
cargo test -p horizon-client --lib item_render::special                          5 passed
cargo test -p horizon-client --lib -- --skip gfx::                              1016 passed, 1 failed, 26 ignored
python tools/check_public_tree.py                                               passed

The one failure is save::tests::session_lock_is_exclusive, which also fails on main on Windows. gfx:: was skipped: its GPU tests hang in parallel and crash in gfx::arena when run one at a time on this machine (an RTX 5080), and this change doesn't touch gfx.

Screenshots

Enchanted shield with a red base, a blue bottom stripe and a black creeper (Unbreaking I). In the hotbar it is slot 1; slot 2 is the same shield without the enchantment and slot 3 is a plain enchanted shield. In the world it is the armor stand's main hand.

Before (main, 142388e1c): white plate in the hotbar and in the world.

shield 3407 before hand
shield 3407 before stand

After: the base colour and patterns under the glint.

shield 3407 after hand
shield 3407 after stand

🤖 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/3446 **Author:** [@d3grando](https://github.com/d3grando) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix-3407` --- ### 📝 Commits (1) - [`1d2d495`](https://github.com/horizon-rust/horizon/commit/1d2d495686b85bc04326cf60260b76d2a2fb0fdb) Shields: an enchanted banner shield keeps its patterns under the glint ### 📊 Changes **1 file changed** (+109 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/item_render/special.rs` (+109 -11) </details> ### 📄 Description > 🤖 Opened by d3grando's AI agent (Claude Code, Claude Opus 5.5), not by d3grando themselves. ## What and why Fixes #3407 An enchanted shield with a banner on it showed a plain white plate, in the hotbar, in the inventory and in the world: the base colour and the patterns were gone. `item_render/special.rs` drew the patterned shield in vanilla's order (the base, the base colour layer, the patterns), then drew `entity/shield/shield_base` once more with the foil, standing in for vanilla's `patternedShieldGlint` pass. Vanilla's pass draws only the glint. In Horizon a foil quad is its texture with the glint over it: the GUI emits the textured quad and then the glint, and `WorldSink` gives it overlay 7. So the extra pass drew the plain base over the base colour and every pattern. The extra pass is gone. Every layer of a patterned shield now carries the foil. The GUI adds each layer's glint masked by that layer's alpha, and the world shader composites it into each layer, so each pixel ends with the glint once, over the layers below it. That matches vanilla's single glint pass over the finished plate. Shields without patterns and unenchanted shields draw as before. One difference remains in the world: `glint_over` in `entity.wgsl` raises a glinted texel's alpha to at least the glint strength. So a pattern texel with partial alpha (the gradient patterns) draws a bit more opaque on an enchanted shield held or worn in the world. The GUI has no such difference. Matching it exactly in the world would need a glint-only quad drawn with vanilla's additive `GLINT` blend, which is a separate change to the renderer. ## Vanilla reference - `ShieldSpecialRenderer.submit`: without patterns, one `submitModel` with `RenderTypes.entitySolidGlint` when it has foil. With patterns: `BannerRenderer.submitPatterns`, then, when it has foil, `order(layers + 2).submitModel(..., RenderTypes.patternedShieldGlint(), ...)`. - `RenderTypes.patternedShieldGlint`: `RenderPipelines.GLINT` with only `ItemFeatureRenderer.ENCHANTED_GLINT_ITEM` as `Sampler0` and `ENTITY_GLINT_TEXTURING`. It draws the glint alone, not the shield sprite. Read with `javap -c` on the 26.3 client jar. No harness renders items; the new unit test `item_render::special::tests::an_enchanted_banner_shield_keeps_its_patterns_under_the_glint` checks which layers are submitted and their foil. It fails on main (the base is submitted again after the patterns) and passes here. ## Self-check Run on Windows 11 (`tools/pr_ready.py` and `tools/parity.py` stop on Windows at `signal.SIGHUP`, so the steps were run by hand): ``` cargo fmt --all -- --check ok cargo clippy -p horizon-client --features mods --all-targets -- -D warnings ok cargo test -p horizon-client --lib item_render::special 5 passed cargo test -p horizon-client --lib -- --skip gfx:: 1016 passed, 1 failed, 26 ignored python tools/check_public_tree.py passed ``` The one failure is `save::tests::session_lock_is_exclusive`, which also fails on main on Windows. `gfx::` was skipped: its GPU tests hang in parallel and crash in `gfx::arena` when run one at a time on this machine (an RTX 5080), and this change doesn't touch `gfx`. ## Screenshots Enchanted shield with a red base, a blue bottom stripe and a black creeper (Unbreaking I). In the hotbar it is slot 1; slot 2 is the same shield without the enchantment and slot 3 is a plain enchanted shield. In the world it is the armor stand's main hand. Before (main, 142388e1c): white plate in the hotbar and in the world. ![shield 3407 before hand](https://raw.githubusercontent.com/d3grando/horizon/pr-assets/shield-3407-before-hand.png) ![shield 3407 before stand](https://raw.githubusercontent.com/d3grando/horizon/pr-assets/shield-3407-before-stand.png) After: the base colour and patterns under the glint. ![shield 3407 after hand](https://raw.githubusercontent.com/d3grando/horizon/pr-assets/shield-3407-after-hand.png) ![shield 3407 after stand](https://raw.githubusercontent.com/d3grando/horizon/pr-assets/shield-3407-after-stand.png) 🤖 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 05:09:24 +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#4987
No description provided.