[PR #6880] [MERGED] Shader API: held and dropped items light in their [[lights]] colour #7169

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

📋 Pull Request Information

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

Base: main ← Head: shader/item-light-colors


📝 Commits (2)

  • f266bfd Shader API: held and dropped items light in their lights colour
  • 1c223ab Coloured item lights cost nothing without a pack that colours lights

📊 Changes

9 files changed (+119 additions, -38 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+11 -0)
📝 crates/horizon-client-render/src/gfx/native_pack.rs (+3 -0)
📝 crates/horizon-client/src/game.rs (+1 -1)
📝 crates/horizon-client/src/game/dynamic_lights.rs (+68 -30)
📝 crates/horizon-client/src/game/native_visuals.rs (+22 -1)
📝 crates/horizon-shader-api/src/inputs.rs (+1 -1)
📝 crates/horizon-shader-api/src/manifest.rs (+10 -4)
📝 docs/api/shaders-reference.md (+1 -1)
📝 docs/api/shaders.md (+2 -0)

📄 Description

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

Fixes #6858

With dynamic lights on, a held or dropped item whose block the pack colours by [[lights]] now also joins the frame's coloured lights, the ones MaterialInput.colored_light reads (#6605), at the same place and reach as its dynamic light. A soul torch in a hand or on the ground lights blue in a pack that colours soul_* blue.

  • dynamic_lights.rs: the sources (player, mobs, dropped items) are gathered once, each with the item that gives the light; the plain dynamic lights and the coloured ones both use them.
  • manifest::light_color is Manifest::light_of for a copy of the entries, kept by the running native pack.

A pack without [[lights]], or with dynamic lights off, sees no change. The colour is looked up by the item's name, which for torches, lanterns and the like is the block's.

Proof

Run locally on this branch, night, a soul torch held and one dropped, with a small pack whose material adds albedo * tint * input.colored_light and declares [[lights]] blocks = ["soul_*"] in blue: the ground around both lights blue. Without the [[lights]] entry the same scene has only the plain dynamic light. The pack was accepted (no refusal in the log). No screenshots attached.

The failed test

One test failed in the run below, gfx::entity_skin::tests::the_shader_writes_what_the_cpu_reference_computes: the GPU's and the CPU's skinned vertex differ in one byte (167 against 168, the last bit of one float). This branch doesn't touch entity_skin.rs or what it calls; I take it for a precision difference of this GPU (RTX 3050 Ti, NVIDIA 615), not checked on main here. CI will tell.

pr_ready (tools/pr_ready.py --quick on teiwazik-laptop, against origin/main at 7e6cbea1a, 7 min 19 s)

Check Result
Scope ✅ 9 files, +112 −38
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 609 passed (44 s)
rustfmt ✅ (9 s)
clippy ✅ (2 min 53 s)
tests: horizon-client, horizon-client-render, horizon-shader-api ❌ 1668 passed, 1 failed (3 min 9 s)
doc tests ✅ 0 passed (3 s)
content root tests ➖ content root untouched
mod API up to date ✅ (21 s)
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/6880 **Author:** [@Teiwazik](https://github.com/Teiwazik) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `shader/item-light-colors` --- ### 📝 Commits (2) - [`f266bfd`](https://github.com/horizon-rust/horizon/commit/f266bfd43455c7e69211a8a0e554a5b0f63ff0b2) Shader API: held and dropped items light in their [[lights]] colour - [`1c223ab`](https://github.com/horizon-rust/horizon/commit/1c223ab04901f4d838323017c124e000a9826c39) Coloured item lights cost nothing without a pack that colours lights ### 📊 Changes **9 files changed** (+119 additions, -38 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+11 -0) 📝 `crates/horizon-client-render/src/gfx/native_pack.rs` (+3 -0) 📝 `crates/horizon-client/src/game.rs` (+1 -1) 📝 `crates/horizon-client/src/game/dynamic_lights.rs` (+68 -30) 📝 `crates/horizon-client/src/game/native_visuals.rs` (+22 -1) 📝 `crates/horizon-shader-api/src/inputs.rs` (+1 -1) 📝 `crates/horizon-shader-api/src/manifest.rs` (+10 -4) 📝 `docs/api/shaders-reference.md` (+1 -1) 📝 `docs/api/shaders.md` (+2 -0) </details> ### 📄 Description > 🤖 Opened by Teiwazik's AI agent (Claude Code, Claude Opus 5.5), not by Teiwazik personally. Fixes #6858 With dynamic lights on, a held or dropped item whose block the pack colours by `[[lights]]` now also joins the frame's coloured lights, the ones `MaterialInput.colored_light` reads (#6605), at the same place and reach as its dynamic light. A soul torch in a hand or on the ground lights blue in a pack that colours `soul_*` blue. - `dynamic_lights.rs`: the sources (player, mobs, dropped items) are gathered once, each with the item that gives the light; the plain dynamic lights and the coloured ones both use them. - `manifest::light_color` is `Manifest::light_of` for a copy of the entries, kept by the running native pack. A pack without `[[lights]]`, or with dynamic lights off, sees no change. The colour is looked up by the item's name, which for torches, lanterns and the like is the block's. ## Proof Run locally on this branch, night, a soul torch held and one dropped, with a small pack whose material adds `albedo * tint * input.colored_light` and declares `[[lights]] blocks = ["soul_*"]` in blue: the ground around both lights blue. Without the `[[lights]]` entry the same scene has only the plain dynamic light. The pack was accepted (no refusal in the log). No screenshots attached. ## The failed test One test failed in the run below, `gfx::entity_skin::tests::the_shader_writes_what_the_cpu_reference_computes`: the GPU's and the CPU's skinned vertex differ in one byte (`167` against `168`, the last bit of one float). This branch doesn't touch `entity_skin.rs` or what it calls; I take it for a precision difference of this GPU (RTX 3050 Ti, NVIDIA 615), not checked on `main` here. CI will tell. **pr_ready** (`tools/pr_ready.py --quick` on teiwazik-laptop, against origin/main at 7e6cbea1a, 7 min 19 s) | Check | Result | | --- | --- | | Scope | ✅ 9 files, +112 −38 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 609 passed (44 s) | | rustfmt | ✅ (9 s) | | clippy | ✅ (2 min 53 s) | | tests: horizon-client, horizon-client-render, horizon-shader-api | ❌ 1668 passed, 1 failed (3 min 9 s) | | doc tests | ✅ 0 passed (3 s) | | content root tests | ➖ content root untouched | | mod API up to date | ✅ (21 s) | | 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:35:11 +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#7169
No description provided.