[PR #3607] [MERGED] Armour: worn pieces and the elytra show the enchantment glint (#3024) #5090

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3607
Author: @degepie
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @levzzz5154

Base: main ← Head: fix/issue-3024-worn-armor-glint


📝 Commits (4)

  • 861be0b Armour: worn pieces and the elytra show the enchantment glint
  • d4f4666 Merge main into fix/issue-3024-worn-armor-glint: the armour glint moves to overlay 36
  • bcfeeee Merge main into fix/issue-3024-worn-armor-glint
  • cc683c7 Merge main into fix/issue-3024-worn-armor-glint (resolve crates/horizon-client/src/game/perspective.rs)

📊 Changes

6 files changed (+146 additions, -27 deletions)

View changed files

📝 crates/horizon-client-render/src/entity.wgsl (+3 -3)
📝 crates/horizon-client/src/game/armor_stands.rs (+23 -8)
📝 crates/horizon-client/src/game/lan.rs (+1 -0)
📝 crates/horizon-client/src/game/perspective.rs (+23 -3)
📝 crates/horizon-client/src/mobs.rs (+6 -1)
📝 crates/horizon-client/src/mobs/render.rs (+90 -12)

📄 Description

🤖 Opened by degepie's AI agent (Claude Code), not by degepie personally.

Fixes #3024.

What

Armour a player wears never showed the enchantment glint, though the same piece glints in the hand. Two things caused it:

  1. The player's armour layers had no glint. The local player in third person, other players on a server, and LAN guests all draw their armour through armor_layers and render_with's extra layers. That path only carried (model, texture, colour), and the overlay it drew with was the body's hurt tint. The elytra (player_elytra_geometry) always drew with overlay 0.
  2. The armour glint's overlay code was taken. mobs::render::ARMOR_GLINT was 13, but gfx/entity_batch.rs maps 13 to WATER_MASK_OVERLAY: the boat water patch, drawn depth-only. So any layer marked with the glint was drawn invisibly. You can see this on main today: an armour stand wearing an enchanted chestplate shows only its sticks. Once (1) was fixed, the player's enchanted armour disappeared the same way.

Now worn armour, its trim and the elytra glint with the scrolling enchanted_glint_armor texture. This holds for the player, other players and armour stands.

Vanilla

  • HumanoidArmorLayer.renderArmorPiece and WingsLayer.submit both draw through EquipmentLayerRenderer.renderLayers. When ItemStack.hasFoil() is true (the stack has enchantments or enchantment_glint_override), each layer is drawn with RenderTypes.armorCutoutNoCullGlint and the trim is followed by RenderTypes.trimmedArmorGlint. Otherwise the layer is drawn with armorCutoutNoCull. Every pass is submitted with OverlayTexture.NO_OVERLAY, so armour never takes the hurt tint.
  • For other players, no protocol change is needed. ClientboundSetEquipmentPacket carries the stack components, and remote.rs already stores the full stacks in extra.armor.

How

  • mobs/render.rs: ARMOR_GLINT moves from 13 to 36, past every overlay code (35 is the text offset) that entity_batch.rs gives a material. entity.wgsl checks 36u to match.
  • game/armor_stands.rs armor_layers: each layer now also returns its overlay. It is ARMOR_GLINT when stack.has_foil(item_glint), using the same test the armour stand already uses, and 0 otherwise. The trim layer takes the same overlay as its piece.
  • mobs/render.rs render_with: the extra layers are drawn with their own overlay instead of the body's.
  • mobs.rs render_model: with ARMOR_GLINT, it passes the model UV as glint_uv, as render::draw does.
  • game/perspective.rs player_elytra_geometry: draws with ARMOR_GLINT when the worn chest stack has foil. The signature and call sites are unchanged. To support this, the local player model keeps the worn stacks in extra.armor (in tick_player_model), and so do the LAN host's guest models (game/lan.rs, one line). Remote players already had them.

Verified

  • Unit test mobs::render::tests::extra_armour_layers_carry_their_glint_not_the_hurt_tint checks three things:
    • ARMOR_GLINT is none of the batch's material overlays.
    • A hurt mob keeps its red overlay on the body.
    • Its extra layer gets ARMOR_GLINT with the model UV as glint_uv, or overlay 0 without the glint.
  • In game, I used a creative world in a scratch home, standing on a glass platform at y=151:
    • Setup: protection-enchanted diamond helmet and chestplate, iron leggings and golden boots; an enchanted sword in hand; third-person front view.
    • Elytra: an elytra with enchantment_glint_override=true, and one with Unbreaking, in the back view.
    • Armour stand: an armour stand and a zombie, each with an enchanted iron chestplate.
  • Before (v0.2.91): the sword glints in the hand, but the worn armour and the elytra don't. The armour stand's enchanted chestplate is invisible.
  • After:
    • The helmet, chestplate, leggings and boots glint; the leggings and boots show the purple clearly.
    • The elytra glints. Over five frames its colour shifts by the scrolling purple, where before it stays the same.
    • The armour stand's chestplate is drawn, with the glint.
    • The hand glint is unchanged.
  • Screenshots: (attach before-armor.png / after-armor.png, cmp-elytra.png, diag-before-fp.png / diag-after-fp.png)

Known differences

  • Server-sent mobs. On a server's client, which is the default single player with a server thread, a mob's armour glint still depends on gear::enchanted, and equipment packets never fill it. A zombie in enchanted armour is drawn without the glint, as before. The armour itself does render.
  • Inventory preview. The player preview in the inventory screen goes through the HUD batch, which has no armour glint, so its armour still shows none.
  • Horse and wolf body armour. These have their own path and are unchanged here.
  • Hurt tint. A hurt player's armour no longer flashes red, matching vanilla's NO_OVERLAY.

pr_ready

pr_ready (tools/pr_ready.py --quick on horizon-build, against origin/main at 8f0c17895, 3 min 8 s)

Check Result
Scope ✅ 6 files, +135 −24
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 408 passed (29 s)
rustfmt ✅ (7 s)
clippy ✅ (22 s)
tests: horizon-client, horizon-client-render ✅ 1298 passed (2 min 2 s)
doc tests ✅ 0 passed (7 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 347 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 335 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 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/3607 **Author:** [@degepie](https://github.com/degepie) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/issue-3024-worn-armor-glint` --- ### 📝 Commits (4) - [`861be0b`](https://github.com/horizon-rust/horizon/commit/861be0b07508b1fb2e7ac1db21d2cc2a76e217d6) Armour: worn pieces and the elytra show the enchantment glint - [`d4f4666`](https://github.com/horizon-rust/horizon/commit/d4f466623da48e006141cfe73f1331873282097b) Merge main into fix/issue-3024-worn-armor-glint: the armour glint moves to overlay 36 - [`bcfeeee`](https://github.com/horizon-rust/horizon/commit/bcfeeeeb2aea585e68b283743c505c82f55bd4ee) Merge main into fix/issue-3024-worn-armor-glint - [`cc683c7`](https://github.com/horizon-rust/horizon/commit/cc683c75f04f535e4c7955560147fd6550ef03b7) Merge main into fix/issue-3024-worn-armor-glint (resolve crates/horizon-client/src/game/perspective.rs) ### 📊 Changes **6 files changed** (+146 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/entity.wgsl` (+3 -3) 📝 `crates/horizon-client/src/game/armor_stands.rs` (+23 -8) 📝 `crates/horizon-client/src/game/lan.rs` (+1 -0) 📝 `crates/horizon-client/src/game/perspective.rs` (+23 -3) 📝 `crates/horizon-client/src/mobs.rs` (+6 -1) 📝 `crates/horizon-client/src/mobs/render.rs` (+90 -12) </details> ### 📄 Description > 🤖 Opened by degepie's AI agent (Claude Code), not by degepie personally. Fixes #3024. ## What Armour a player wears never showed the enchantment glint, though the same piece glints in the hand. Two things caused it: 1. **The player's armour layers had no glint.** The local player in third person, other players on a server, and LAN guests all draw their armour through `armor_layers` and `render_with`'s extra layers. That path only carried (model, texture, colour), and the overlay it drew with was the body's hurt tint. The elytra (`player_elytra_geometry`) always drew with overlay 0. 2. **The armour glint's overlay code was taken.** `mobs::render::ARMOR_GLINT` was 13, but `gfx/entity_batch.rs` maps 13 to `WATER_MASK_OVERLAY`: the boat water patch, drawn depth-only. So any layer marked with the glint was drawn invisibly. You can see this on main today: an armour stand wearing an enchanted chestplate shows only its sticks. Once (1) was fixed, the player's enchanted armour disappeared the same way. Now worn armour, its trim and the elytra glint with the scrolling `enchanted_glint_armor` texture. This holds for the player, other players and armour stands. ## Vanilla - `HumanoidArmorLayer.renderArmorPiece` and `WingsLayer.submit` both draw through `EquipmentLayerRenderer.renderLayers`. When `ItemStack.hasFoil()` is true (the stack has enchantments or `enchantment_glint_override`), each layer is drawn with `RenderTypes.armorCutoutNoCullGlint` and the trim is followed by `RenderTypes.trimmedArmorGlint`. Otherwise the layer is drawn with `armorCutoutNoCull`. Every pass is submitted with `OverlayTexture.NO_OVERLAY`, so armour never takes the hurt tint. - For other players, no protocol change is needed. `ClientboundSetEquipmentPacket` carries the stack components, and `remote.rs` already stores the full stacks in `extra.armor`. ## How - `mobs/render.rs`: `ARMOR_GLINT` moves from 13 to 36, past every overlay code (35 is the text offset) that `entity_batch.rs` gives a material. `entity.wgsl` checks `36u` to match. - `game/armor_stands.rs` `armor_layers`: each layer now also returns its overlay. It is `ARMOR_GLINT` when `stack.has_foil(item_glint)`, using the same test the armour stand already uses, and 0 otherwise. The trim layer takes the same overlay as its piece. - `mobs/render.rs` `render_with`: the extra layers are drawn with their own overlay instead of the body's. - `mobs.rs` `render_model`: with `ARMOR_GLINT`, it passes the model UV as `glint_uv`, as `render::draw` does. - `game/perspective.rs` `player_elytra_geometry`: draws with `ARMOR_GLINT` when the worn chest stack has foil. The signature and call sites are unchanged. To support this, the local player model keeps the worn stacks in `extra.armor` (in `tick_player_model`), and so do the LAN host's guest models (`game/lan.rs`, one line). Remote players already had them. ## Verified - Unit test `mobs::render::tests::extra_armour_layers_carry_their_glint_not_the_hurt_tint` checks three things: - `ARMOR_GLINT` is none of the batch's material overlays. - A hurt mob keeps its red overlay on the body. - Its extra layer gets `ARMOR_GLINT` with the model UV as `glint_uv`, or overlay 0 without the glint. - In game, I used a creative world in a scratch home, standing on a glass platform at y=151: - **Setup:** protection-enchanted diamond helmet and chestplate, iron leggings and golden boots; an enchanted sword in hand; third-person front view. - **Elytra:** an elytra with `enchantment_glint_override=true`, and one with Unbreaking, in the back view. - **Armour stand:** an armour stand and a zombie, each with an enchanted iron chestplate. - Before (v0.2.91): the sword glints in the hand, but the worn armour and the elytra don't. The armour stand's enchanted chestplate is invisible. - After: - The helmet, chestplate, leggings and boots glint; the leggings and boots show the purple clearly. - The elytra glints. Over five frames its colour shifts by the scrolling purple, where before it stays the same. - The armour stand's chestplate is drawn, with the glint. - The hand glint is unchanged. - Screenshots: (attach `before-armor.png` / `after-armor.png`, `cmp-elytra.png`, `diag-before-fp.png` / `diag-after-fp.png`) ## Known differences - **Server-sent mobs.** On a server's client, which is the default single player with a server thread, a mob's armour glint still depends on `gear::enchanted`, and equipment packets never fill it. A zombie in enchanted armour is drawn without the glint, as before. The armour itself does render. - **Inventory preview.** The player preview in the inventory screen goes through the HUD batch, which has no armour glint, so its armour still shows none. - **Horse and wolf body armour.** These have their own path and are unchanged here. - **Hurt tint.** A hurt player's armour no longer flashes red, matching vanilla's `NO_OVERLAY`. ## pr_ready **pr_ready** (`tools/pr_ready.py --quick` on horizon-build, against origin/main at 8f0c17895, 3 min 8 s) | Check | Result | | --- | --- | | Scope | ✅ 6 files, +135 −24 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 408 passed (29 s) | | rustfmt | ✅ (7 s) | | clippy | ✅ (22 s) | | tests: horizon-client, horizon-client-render | ✅ 1298 passed (2 min 2 s) | | doc tests | ✅ 0 passed (7 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 347 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 335 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 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:10:10 +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#5090
No description provided.