[PR #5827] [MERGED] Shader API: a stage's files, WGSL only that stage reads #6516

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5827
Author: @Teiwazik
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: shader/stage-files


📝 Commits (10+)

  • 3ab39ea Merge remote-tracking branch 'origin/main' into shader/s8-shadow-entities
  • b1d6819 Native mods: the screen hears of the wheel before it scrolls
  • 43207a5 Shader API: entities cast into the shadow map
  • c901615 Merge branch 'screen-mouse-button' into screen-mouse-scrolled
  • 11cd3f2 Shader API: the first-person player casts into the shadow map
  • bbbb185 Shader API: materials, an id by sprite, and shadows cut whole
  • 753c565 Shader API: the blob stays where a pack has no sun to cast with
  • ddadcb2 Merge branch 'shader/s8b-player-shadow' into shader/s9-materials
  • f11233f Shader API: solid_materials work without a material stage
  • dcec52b Native mods: native_draw_item and native_block_state_property for drawing block entities

📊 Changes

22 files changed (+712 additions, -75 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+43 -10)
📝 crates/horizon-client-render/src/gfx/entity_batch.rs (+5 -0)
📝 crates/horizon-client-render/src/gfx/native_material.rs (+37 -17)
📝 crates/horizon-client-render/src/gfx/native_pack.rs (+1 -1)
📝 crates/horizon-client-render/src/gfx/native_shadow.rs (+180 -8)
📝 crates/horizon-client/src/game.rs (+42 -3)
📝 crates/horizon-client/src/game/entity_culling.rs (+3 -0)
📝 crates/horizon-client/src/game/native_block_entity_draw.rs (+58 -0)
📝 crates/horizon-client/src/game/native_hooks.rs (+62 -8)
📝 crates/horizon-client/src/game/native_shaders.rs (+7 -5)
📝 crates/horizon-shader-api/src/inputs.rs (+1 -0)
📝 crates/horizon-shader-api/src/lib.rs (+3 -1)
📝 crates/horizon-shader-api/src/manifest.rs (+118 -18)
📝 crates/horizon-shader-api/src/stages.rs (+15 -2)
📝 crates/horizon-shader-api/tests/check.rs (+25 -0)
📝 crates/horizon-shader-api/tests/schema.rs (+60 -0)
📝 docs/api/shaders-reference.md (+3 -2)
📝 docs/api/shaders.md (+13 -0)
📝 docs/shaders.md (+15 -0)
➕ tools/native-hook-fragments/block_entity_draw_item.json (+8 -0)

...and 2 more files

📄 Description

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

Fixes #5826.

What

An optional files list on [sky], [material] and each [[post]]: WGSL put after shared and before the stage's own file, for that stage only. Each must be a plain path to a .wgsl file, like any other the manifest names, and it counts as used by the pack. A file already in shared, or the stage's own, isn't added twice. Packs without the key compose as before.

Proof

Test: a_stages_files_are_its_own: the file comes before the post stage's own, the material stage doesn't get it, and the pack still passes check.

This changes how a pack is composed and nothing a player sees, so I relied on that test and didn't load a pack using files in game on this branch. lan_e2e wasn't run (client-only).

pr_ready (tools/pr_ready.py --quick on teiwazik-laptop, against origin/main at 3477f0d8c, 1 min 25 s)

Check Result
Scope ✅ 4 files, +52 −2
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 515 passed (34 s)
rustfmt ✅ (7 s)
clippy ✅ (43 s)
tests: horizon-shader-api ✅ 24 passed (1 s)
doc tests ✅ 0 passed
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 ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code

https://claude.ai/code/session_01EBqm1v5zTsDGwuZF6XKFjL


🔄 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/5827 **Author:** [@Teiwazik](https://github.com/Teiwazik) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `shader/stage-files` --- ### 📝 Commits (10+) - [`3ab39ea`](https://github.com/horizon-rust/horizon/commit/3ab39ea98415cf91cbf58af324e3afcc87f8260c) Merge remote-tracking branch 'origin/main' into shader/s8-shadow-entities - [`b1d6819`](https://github.com/horizon-rust/horizon/commit/b1d6819737cabae0cda4c11268d1dfc9954cb652) Native mods: the screen hears of the wheel before it scrolls - [`43207a5`](https://github.com/horizon-rust/horizon/commit/43207a5a3d6afeee0061ed6aef9c68dcd0ce8d24) Shader API: entities cast into the shadow map - [`c901615`](https://github.com/horizon-rust/horizon/commit/c90161511b9404e22911a177208490b058d15e0f) Merge branch 'screen-mouse-button' into screen-mouse-scrolled - [`11cd3f2`](https://github.com/horizon-rust/horizon/commit/11cd3f220d91b1b99febea60ce035150bd8996b8) Shader API: the first-person player casts into the shadow map - [`bbbb185`](https://github.com/horizon-rust/horizon/commit/bbbb18595fdb024b76a7dda8e78a2ce92c7ad0dc) Shader API: [[materials]], an id by sprite, and shadows cut whole - [`753c565`](https://github.com/horizon-rust/horizon/commit/753c565883ce75bbfd9624ad53ed0de157a0c59b) Shader API: the blob stays where a pack has no sun to cast with - [`ddadcb2`](https://github.com/horizon-rust/horizon/commit/ddadcb2203db1760074dd9be0abac4ac1ce80a69) Merge branch 'shader/s8b-player-shadow' into shader/s9-materials - [`f11233f`](https://github.com/horizon-rust/horizon/commit/f11233f125b8904fbcc79358137ecc0a7d3e58c3) Shader API: solid_materials work without a material stage - [`dcec52b`](https://github.com/horizon-rust/horizon/commit/dcec52b07ea265c1e05bf2d26c58fec063781f7a) Native mods: native_draw_item and native_block_state_property for drawing block entities ### 📊 Changes **22 files changed** (+712 additions, -75 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+43 -10) 📝 `crates/horizon-client-render/src/gfx/entity_batch.rs` (+5 -0) 📝 `crates/horizon-client-render/src/gfx/native_material.rs` (+37 -17) 📝 `crates/horizon-client-render/src/gfx/native_pack.rs` (+1 -1) 📝 `crates/horizon-client-render/src/gfx/native_shadow.rs` (+180 -8) 📝 `crates/horizon-client/src/game.rs` (+42 -3) 📝 `crates/horizon-client/src/game/entity_culling.rs` (+3 -0) 📝 `crates/horizon-client/src/game/native_block_entity_draw.rs` (+58 -0) 📝 `crates/horizon-client/src/game/native_hooks.rs` (+62 -8) 📝 `crates/horizon-client/src/game/native_shaders.rs` (+7 -5) 📝 `crates/horizon-shader-api/src/inputs.rs` (+1 -0) 📝 `crates/horizon-shader-api/src/lib.rs` (+3 -1) 📝 `crates/horizon-shader-api/src/manifest.rs` (+118 -18) 📝 `crates/horizon-shader-api/src/stages.rs` (+15 -2) 📝 `crates/horizon-shader-api/tests/check.rs` (+25 -0) 📝 `crates/horizon-shader-api/tests/schema.rs` (+60 -0) 📝 `docs/api/shaders-reference.md` (+3 -2) 📝 `docs/api/shaders.md` (+13 -0) 📝 `docs/shaders.md` (+15 -0) ➕ `tools/native-hook-fragments/block_entity_draw_item.json` (+8 -0) _...and 2 more files_ </details> ### 📄 Description > 🤖 Opened by Teiwazik's AI agent (Claude Code, Claude Opus 5.5), not by Teiwazik personally. Fixes #5826. ## What An optional `files` list on `[sky]`, `[material]` and each `[[post]]`: WGSL put after `shared` and before the stage's own file, for that stage only. Each must be a plain path to a `.wgsl` file, like any other the manifest names, and it counts as used by the pack. A file already in `shared`, or the stage's own, isn't added twice. Packs without the key compose as before. ## Proof Test: `a_stages_files_are_its_own`: the file comes before the post stage's own, the material stage doesn't get it, and the pack still passes `check`. This changes how a pack is composed and nothing a player sees, so I relied on that test and didn't load a pack using `files` in game on this branch. `lan_e2e` wasn't run (client-only). **pr_ready** (`tools/pr_ready.py --quick` on teiwazik-laptop, against origin/main at 3477f0d8c, 1 min 25 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +52 −2 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 515 passed (34 s) | | rustfmt | ✅ (7 s) | | clippy | ✅ (43 s) | | tests: horizon-shader-api | ✅ 24 passed (1 s) | | doc tests | ✅ 0 passed | | 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 | ➖ not run (--quick): CI's parity job picks the affected harnesses | | 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) https://claude.ai/code/session_01EBqm1v5zTsDGwuZF6XKFjL --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:22:03 +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#6516
No description provided.