[PR #6605] [MERGED] Shader API: particles as coloured lights #6977

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

📋 Pull Request Information

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

Base: main ← Head: shader/particle-lights


📝 Commits (1)

  • ffba053 Shader API: particles as coloured lights

📊 Changes

11 files changed (+132 additions, -4 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+4 -0)
📝 crates/horizon-client-render/src/gfx/native_material.rs (+2 -1)
📝 crates/horizon-client-render/src/gfx/native_pack.rs (+3 -0)
📝 crates/horizon-client-render/src/particles.rs (+41 -0)
📝 crates/horizon-client/src/game/native_visuals.rs (+12 -2)
📝 crates/horizon-shader-api/src/inputs.rs (+1 -0)
📝 crates/horizon-shader-api/src/manifest.rs (+46 -0)
📝 crates/horizon-shader-api/src/stages.rs (+1 -1)
📝 crates/horizon-shader-api/tests/schema.rs (+15 -0)
📝 docs/api/shaders-reference.md (+1 -0)
📝 docs/api/shaders.md (+6 -0)

📄 Description

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

Fixes #6584

A native pack can now make particles shine, and read the result:

  • [[particle_lights]] in horizon-shaders.toml: particles, color, reach. Those particles join the frame's coloured lights (select_colored, the 16 nearest), where they are, with their alpha as intensity, so a firefly's light fades as it does.
  • MaterialInput.colored_light: those lights at a point. The material stage had no way to read them, though the classic terrain path does.

Additive: a pack that doesn't declare the section or read the field draws as before. Reference and changelog updated.

Proof

Run locally on this branch with a small pack whose material adds albedo * tint * input.colored_light, on a night scene of firefly bushes: with [[particle_lights]] the ground and the hand around the fireflies light up in the entry's colour, and without the section the scene stays dark. The pack compiled and was accepted (no refusal in the log). No screenshots attached.

Not covered: there is no automated test of the light on screen; tests/schema.rs covers the manifest's parsing and refusals. tools/parity.py was not run (--quick), so CI's parity job decides the affected harnesses.

pr_ready (tools/pr_ready.py --quick on teiwazik-laptop, against origin/main at 3310fcafb, 6 min 33 s)

Check Result
Scope ✅ 11 files, +132 −4
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 595 passed (46 s)
rustfmt ✅ (9 s)
clippy ✅ (2 min 37 s)
tests: horizon-client, horizon-client-render, horizon-shader-api ✅ 1615 passed (2 min 58 s)
doc tests ✅ 0 passed (3 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 ➖ 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/6605 **Author:** [@Teiwazik](https://github.com/Teiwazik) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `shader/particle-lights` --- ### 📝 Commits (1) - [`ffba053`](https://github.com/horizon-rust/horizon/commit/ffba053a6a13fba7abb4d0c5f826b8fbc4050f9b) Shader API: particles as coloured lights ### 📊 Changes **11 files changed** (+132 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+4 -0) 📝 `crates/horizon-client-render/src/gfx/native_material.rs` (+2 -1) 📝 `crates/horizon-client-render/src/gfx/native_pack.rs` (+3 -0) 📝 `crates/horizon-client-render/src/particles.rs` (+41 -0) 📝 `crates/horizon-client/src/game/native_visuals.rs` (+12 -2) 📝 `crates/horizon-shader-api/src/inputs.rs` (+1 -0) 📝 `crates/horizon-shader-api/src/manifest.rs` (+46 -0) 📝 `crates/horizon-shader-api/src/stages.rs` (+1 -1) 📝 `crates/horizon-shader-api/tests/schema.rs` (+15 -0) 📝 `docs/api/shaders-reference.md` (+1 -0) 📝 `docs/api/shaders.md` (+6 -0) </details> ### 📄 Description > 🤖 Opened by Teiwazik's AI agent (Claude Code, Claude Opus 5.5), not by Teiwazik personally. Fixes #6584 A native pack can now make particles shine, and read the result: - `[[particle_lights]]` in `horizon-shaders.toml`: `particles`, `color`, `reach`. Those particles join the frame's coloured lights (`select_colored`, the 16 nearest), where they are, with their alpha as intensity, so a firefly's light fades as it does. - `MaterialInput.colored_light`: those lights at a point. The material stage had no way to read them, though the classic terrain path does. Additive: a pack that doesn't declare the section or read the field draws as before. Reference and changelog updated. ## Proof Run locally on this branch with a small pack whose material adds `albedo * tint * input.colored_light`, on a night scene of firefly bushes: with `[[particle_lights]]` the ground and the hand around the fireflies light up in the entry's colour, and without the section the scene stays dark. The pack compiled and was accepted (no refusal in the log). No screenshots attached. Not covered: there is no automated test of the light on screen; `tests/schema.rs` covers the manifest's parsing and refusals. `tools/parity.py` was not run (`--quick`), so CI's parity job decides the affected harnesses. **pr_ready** (`tools/pr_ready.py --quick` on teiwazik-laptop, against origin/main at 3310fcafb, 6 min 33 s) | Check | Result | | --- | --- | | Scope | ✅ 11 files, +132 −4 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 595 passed (46 s) | | rustfmt | ✅ (9 s) | | clippy | ✅ (2 min 37 s) | | tests: horizon-client, horizon-client-render, horizon-shader-api | ✅ 1615 passed (2 min 58 s) | | doc tests | ✅ 0 passed (3 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 | ➖ 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:30:35 +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#6977
No description provided.