[PR #4186] [MERGED] Shader API: sprite tags and the weather at the camera for the materia… #5468

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4186
Author: @Vaspyyy
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @rdbtCVS

Base: main ← Head: weather-glass-shader-inputs


📝 Commits (3)

  • df86a8d Shader API: sprite tags and the weather at the camera for the material stage
  • 713c613 Shader API: one switch case per sprite layer when names share it
  • 9194f37 Shader API: rebuild Horizon's own pack after a resource reload

📊 Changes

14 files changed (+246 additions, -18 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+7 -2)
📝 crates/horizon-client-render/src/gfx/native_material.rs (+32 -10)
📝 crates/horizon-client-render/src/gfx/native_post.rs (+26 -1)
📝 crates/horizon-client/src/game/native_shaders.rs (+5 -1)
📝 crates/horizon-client/src/game/packs.rs (+5 -0)
📝 crates/horizon-shader-api/src/inputs.rs (+11 -2)
📝 crates/horizon-shader-api/src/lib.rs (+1 -1)
📝 crates/horizon-shader-api/src/manifest.rs (+88 -0)
📝 crates/horizon-shader-api/src/stages.rs (+2 -1)
📝 crates/horizon-shader-api/tests/samples/schema-1/horizon-shaders.toml (+4 -0)
📝 crates/horizon-shader-api/tests/schema.rs (+40 -0)
📝 docs/api/shaders-reference.md (+5 -0)
📝 docs/api/shaders.md (+6 -0)
📝 docs/shaders.md (+14 -0)

📄 Description

🤖 Opened by Vaspyyy's AI agent (Claude Code)

Shader API: sprite tags and the weather at the camera for the material stage

The material stage could not tell glass from stone, or rain from snow, so weather-on-glass packs (drops, streaks, frost) were impossible. This adds both, additively within API 0.1:

  • Sprite tags. A manifest declares [[tags]] (id, sprites, at most one * per name, namespace minecraft by default, 32 at most). MaterialInput.tags has bit i set for the i-th tag. Terrain vertices carry their sprite layer, so the renderer turns the tags into a generated horizon_sprite_tags(layer) switch in the material shader: no new bindings, no vertex format change.
  • Frame: precipitation (0 none, 1 rain, 2 snow, the biome at the camera), temperature, downfall, and wetness (rain smoothed, 30 s half-life rising and 10 s drying, as the shaders/ format's).

The docs (shaders.md, api/shaders.md and the generated reference) and the schema-1 sample are updated, and there are tests for tag matching, the generated switch and wetness.

Example pack using it: Weather Glass (rain drops, running streaks, and frost from the edges on glass under open sky, 64 px per block), which passes horizon-shader check.

pr_ready

tools/pr_ready.py --quick: 13 files, +234 −18. Cargo.lock unchanged, public tree, Python tests (480), rustfmt, and tests for horizon-client, horizon-client-render and horizon-shader-api (1548 passed). Clippy failed only on crates/horizon-world/src/worldgen/aquifer/noise_based.rs:466 (manual_range_contains). This PR doesn't touch that file; the local clippy is 1.97, newer than CI's.

Not tried in the game: the environment had no Minecraft assets.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XnU6QS9x9HatX1QRXMqxeb

Kind

  • feature: something new for players (listed under New in the release notes)

Fixes #4493


🔄 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/4186 **Author:** [@Vaspyyy](https://github.com/Vaspyyy) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `weather-glass-shader-inputs` --- ### 📝 Commits (3) - [`df86a8d`](https://github.com/horizon-rust/horizon/commit/df86a8dd4f5f924ea74a5e23aec44a4fe7ac22f9) Shader API: sprite tags and the weather at the camera for the material stage - [`713c613`](https://github.com/horizon-rust/horizon/commit/713c613140378a26e15b73094c89b033fae16fb6) Shader API: one switch case per sprite layer when names share it - [`9194f37`](https://github.com/horizon-rust/horizon/commit/9194f3738648e3be7c0f43609b2b1cf0d3c34f3b) Shader API: rebuild Horizon's own pack after a resource reload ### 📊 Changes **14 files changed** (+246 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+7 -2) 📝 `crates/horizon-client-render/src/gfx/native_material.rs` (+32 -10) 📝 `crates/horizon-client-render/src/gfx/native_post.rs` (+26 -1) 📝 `crates/horizon-client/src/game/native_shaders.rs` (+5 -1) 📝 `crates/horizon-client/src/game/packs.rs` (+5 -0) 📝 `crates/horizon-shader-api/src/inputs.rs` (+11 -2) 📝 `crates/horizon-shader-api/src/lib.rs` (+1 -1) 📝 `crates/horizon-shader-api/src/manifest.rs` (+88 -0) 📝 `crates/horizon-shader-api/src/stages.rs` (+2 -1) 📝 `crates/horizon-shader-api/tests/samples/schema-1/horizon-shaders.toml` (+4 -0) 📝 `crates/horizon-shader-api/tests/schema.rs` (+40 -0) 📝 `docs/api/shaders-reference.md` (+5 -0) 📝 `docs/api/shaders.md` (+6 -0) 📝 `docs/shaders.md` (+14 -0) </details> ### 📄 Description > 🤖 Opened by Vaspyyy's AI agent (Claude Code) ## Shader API: sprite tags and the weather at the camera for the material stage The material stage could not tell glass from stone, or rain from snow, so weather-on-glass packs (drops, streaks, frost) were impossible. This adds both, additively within API 0.1: - **Sprite tags.** A manifest declares `[[tags]]` (`id`, `sprites`, at most one `*` per name, namespace `minecraft` by default, 32 at most). `MaterialInput.tags` has bit i set for the i-th tag. Terrain vertices carry their sprite layer, so the renderer turns the tags into a generated `horizon_sprite_tags(layer)` switch in the material shader: no new bindings, no vertex format change. - **Frame:** `precipitation` (0 none, 1 rain, 2 snow, the biome at the camera), `temperature`, `downfall`, and `wetness` (rain smoothed, 30 s half-life rising and 10 s drying, as the `shaders/` format's). The docs (shaders.md, api/shaders.md and the generated reference) and the schema-1 sample are updated, and there are tests for tag matching, the generated switch and wetness. Example pack using it: Weather Glass (rain drops, running streaks, and frost from the edges on glass under open sky, 64 px per block), which passes `horizon-shader check`. ## pr_ready `tools/pr_ready.py --quick`: 13 files, +234 −18. Cargo.lock unchanged, public tree, Python tests (480), rustfmt, and tests for horizon-client, horizon-client-render and horizon-shader-api (1548 passed). Clippy failed only on `crates/horizon-world/src/worldgen/aquifer/noise_based.rs:466` (`manual_range_contains`). This PR doesn't touch that file; the local clippy is 1.97, newer than CI's. Not tried in the game: the environment had no Minecraft assets. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01XnU6QS9x9HatX1QRXMqxeb ## Kind - [x] feature: something new for players (listed under New in the release notes) Fixes #4493 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:12:48 +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#5468
No description provided.