[PR #1800] [MERGED] Shader packs, clean room 35: held item ids and light #3771

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1800
Author: @ludovic111
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @ludovic111

Base: main ← Head: feat/shader-packs-held-items


📝 Commits (10+)

  • b5a7911 Shader packs, clean room 30: the loader's alpha test
  • ab289a2 Shader packs, clean room 31: entities and block entities
  • 3a7d00a Shader packs, clean room 32: translucent entity parts and particles
  • abe7047 Shader packs, clean room 33: clouds
  • 173463a Shader packs, clean room 34: rain and snow
  • 18cac82 Shader packs, clean room 35: held item ids and light
  • 90fe138 Merge branch 'feat/shader-packs-entity-spans' into feat/shader-packs-alpha-test
  • c4856e6 Merge branch 'feat/shader-packs-alpha-test' into feat/shader-packs-entities
  • 257654e Merge branch 'feat/shader-packs-entities' into feat/shader-packs-translucent-entities
  • c395797 Merge branch 'feat/shader-packs-translucent-entities' into feat/shader-packs-clouds

📊 Changes

17 files changed (+1563 additions, -28 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+3 -3)
📝 crates/horizon-client/src/game/names.rs (+4 -0)
📝 crates/horizon-client/src/game/shader_packs.rs (+63 -0)
📝 crates/horizon-client/src/gfx.rs (+77 -9)
📝 crates/horizon-client/src/gfx/pack_atlas.rs (+1 -0)
📝 crates/horizon-client/src/gfx/pack_draw.rs (+2 -0)
➕ crates/horizon-client/src/gfx/pack_entities.rs (+462 -0)
📝 crates/horizon-client/src/gfx/pack_post.rs (+337 -5)
📝 crates/horizon-client/src/gfx/pack_sky.rs (+2 -0)
📝 crates/horizon-client/src/gfx/pack_timing.rs (+2 -1)
📝 crates/horizon-client/src/gfx/pack_uniforms.rs (+8 -2)
➕ crates/horizon-client/src/gfx/pack_weather.rs (+264 -0)
📝 crates/horizon-shaders/src/lib.rs (+1 -1)
📝 crates/horizon-shaders/src/post.rs (+198 -4)
📝 crates/horizon-shaders/src/translate/mod.rs (+125 -1)
📝 crates/horizon-shaders/src/translate/rewrite.rs (+7 -0)
📝 crates/horizon-shaders/tests/real_packs.rs (+7 -2)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Shader packs, clean room 35: held item ids and light (item.properties). Stacked on #1786.

What

  • item.properties (spec 4.1) gives heldItemId and heldItemId2 the ids of the main and off hand's items.
    • An item the file lacks, or an empty hand, reads −1; without the file, 0 (5.3).
  • heldBlockLightValue(2): the light level of each held item's block. It comes from the table Horizon's dynamic lights already use: torches 14, glowstone 15, the lava bucket 15.
  • oldHandLight (3.2) is on unless shaders.properties turns it off (OQ-21, [IR]'s default). While it is on, heldItemId and heldBlockLightValue are those of the brighter hand. The second values stay the off hand's.
  • Without a shader pack nothing runs: the values are only computed while a pack is loaded.

Clean room

Clean-room: implemented from cleanroom/shader-packs-spec.md revision 1, §3.2, §4.1, §5.2, §5.3, OQ-21; no other loader's code read.

How tested

  • A local test pack (never committed) whose final shows the four values as colours. With a diamond sword in the main hand and a torch in the off hand:
    • oldHandLight=true: heldItemId is the torch's (1), heldItemId2 the torch's, both lights 14.
    • oldHandLight=false: heldItemId is the sword's (2), its light 0; the torch is the second id, light 14.
    • Empty hands read −1 with the file.
  • Group checks: see #1801.

Needs Ludovic

Nothing. Label skip-release: players see no change.

🤖 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/1800 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/shader-packs-held-items` --- ### 📝 Commits (10+) - [`b5a7911`](https://github.com/horizon-rust/horizon/commit/b5a791170d1e1bec47f2508419d2918c72f891f1) Shader packs, clean room 30: the loader's alpha test - [`ab289a2`](https://github.com/horizon-rust/horizon/commit/ab289a2cf3f84fac470eb146e140c2fa7dc55f67) Shader packs, clean room 31: entities and block entities - [`3a7d00a`](https://github.com/horizon-rust/horizon/commit/3a7d00a74c3202242356b31ef94a53e8b4478fba) Shader packs, clean room 32: translucent entity parts and particles - [`abe7047`](https://github.com/horizon-rust/horizon/commit/abe7047d1947e12225a8baa120b8f4b86ace0a70) Shader packs, clean room 33: clouds - [`173463a`](https://github.com/horizon-rust/horizon/commit/173463acdf4fa73f15089567bf2152a235ed328e) Shader packs, clean room 34: rain and snow - [`18cac82`](https://github.com/horizon-rust/horizon/commit/18cac82d448888c5901b9b29679fd3a5dfae6230) Shader packs, clean room 35: held item ids and light - [`90fe138`](https://github.com/horizon-rust/horizon/commit/90fe138e836881088c771c8d8106e090b836c1ba) Merge branch 'feat/shader-packs-entity-spans' into feat/shader-packs-alpha-test - [`c4856e6`](https://github.com/horizon-rust/horizon/commit/c4856e6febb28aeb6faa06c4c2ea6e5cf8c73c8a) Merge branch 'feat/shader-packs-alpha-test' into feat/shader-packs-entities - [`257654e`](https://github.com/horizon-rust/horizon/commit/257654ef30b6ead67be08b5128428ff057a54229) Merge branch 'feat/shader-packs-entities' into feat/shader-packs-translucent-entities - [`c395797`](https://github.com/horizon-rust/horizon/commit/c39579772c2c89ce3fa01ba181ca521731393220) Merge branch 'feat/shader-packs-translucent-entities' into feat/shader-packs-clouds ### 📊 Changes **17 files changed** (+1563 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+3 -3) 📝 `crates/horizon-client/src/game/names.rs` (+4 -0) 📝 `crates/horizon-client/src/game/shader_packs.rs` (+63 -0) 📝 `crates/horizon-client/src/gfx.rs` (+77 -9) 📝 `crates/horizon-client/src/gfx/pack_atlas.rs` (+1 -0) 📝 `crates/horizon-client/src/gfx/pack_draw.rs` (+2 -0) ➕ `crates/horizon-client/src/gfx/pack_entities.rs` (+462 -0) 📝 `crates/horizon-client/src/gfx/pack_post.rs` (+337 -5) 📝 `crates/horizon-client/src/gfx/pack_sky.rs` (+2 -0) 📝 `crates/horizon-client/src/gfx/pack_timing.rs` (+2 -1) 📝 `crates/horizon-client/src/gfx/pack_uniforms.rs` (+8 -2) ➕ `crates/horizon-client/src/gfx/pack_weather.rs` (+264 -0) 📝 `crates/horizon-shaders/src/lib.rs` (+1 -1) 📝 `crates/horizon-shaders/src/post.rs` (+198 -4) 📝 `crates/horizon-shaders/src/translate/mod.rs` (+125 -1) 📝 `crates/horizon-shaders/src/translate/rewrite.rs` (+7 -0) 📝 `crates/horizon-shaders/tests/real_packs.rs` (+7 -2) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. **Shader packs, clean room 35:** held item ids and light (`item.properties`). Stacked on #1786. ## What - **`item.properties`** (spec 4.1) gives `heldItemId` and `heldItemId2` the ids of the main and off hand's items. - An item the file lacks, or an empty hand, reads −1; without the file, 0 (5.3). - **`heldBlockLightValue(2)`:** the light level of each held item's block. It comes from the table Horizon's dynamic lights already use: torches 14, glowstone 15, the lava bucket 15. - **`oldHandLight`** (3.2) is on unless `shaders.properties` turns it off (OQ-21, `[IR]`'s default). While it is on, `heldItemId` and `heldBlockLightValue` are those of the brighter hand. The second values stay the off hand's. - **Without a shader pack** nothing runs: the values are only computed while a pack is loaded. ## Clean room Clean-room: implemented from `cleanroom/shader-packs-spec.md` revision 1, §3.2, §4.1, §5.2, §5.3, OQ-21; no other loader's code read. ## How tested - **A local test pack** (never committed) whose `final` shows the four values as colours. With a diamond sword in the main hand and a torch in the off hand: - `oldHandLight=true`: `heldItemId` is the torch's (1), `heldItemId2` the torch's, both lights 14. - `oldHandLight=false`: `heldItemId` is the sword's (2), its light 0; the torch is the second id, light 14. - Empty hands read −1 with the file. - **Group checks:** see #1801. ## Needs Ludovic Nothing. Label `skip-release`: players see no change. 🤖 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 04:12:12 +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#3771
No description provided.