[PR #5590] [MERGED] Shader API: entities cast into the shadow map #6374

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

📋 Pull Request Information

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

Base: main ← Head: shader/s8-shadow-entities


📝 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
  • e26bd0f feat(mods): native mods use items over time (duration, animation, can eat, start and finish)
  • 753c565 Shader API: the blob stays where a pack has no sun to cast with
  • e8d5b82 Fix native chat to acting players in hooks
  • dcec52b Native mods: native_draw_item and native_block_state_property for drawing block entities
  • 9a47759 feat(mods): mod menu types with their own slot count and data slots

📊 Changes

69 files changed (+2210 additions, -313 deletions)

View changed files

📝 crates/horizon-client-render/src/containers.rs (+62 -0)
📝 crates/horizon-client-render/src/fast_hash.rs (+3 -85)
📝 crates/horizon-client-render/src/gfx.rs (+40 -9)
📝 crates/horizon-client-render/src/gfx/entity_batch.rs (+5 -0)
📝 crates/horizon-client-render/src/gfx/native_material.rs (+2 -0)
📝 crates/horizon-client-render/src/gfx/native_shadow.rs (+141 -2)
📝 crates/horizon-client-render/src/streaming.rs (+13 -4)
📝 crates/horizon-client/src/content_identity.rs (+31 -3)
📝 crates/horizon-client/src/entity_nbt.rs (+42 -2)
📝 crates/horizon-client/src/game.rs (+120 -43)
📝 crates/horizon-client/src/game/chat.rs (+3 -0)
📝 crates/horizon-client/src/game/commands.rs (+25 -11)
📝 crates/horizon-client/src/game/creatures.rs (+9 -2)
📝 crates/horizon-client/src/game/crossbow.rs (+2 -4)
📝 crates/horizon-client/src/game/end.rs (+1 -3)
📝 crates/horizon-client/src/game/entity_culling.rs (+3 -0)
📝 crates/horizon-client/src/game/fov.rs (+1 -2)
📝 crates/horizon-client/src/game/item_draw.rs (+5 -2)
➕ crates/horizon-client/src/game/item_use.rs (+218 -0)
📝 crates/horizon-client/src/game/lan.rs (+4 -3)

...and 49 more files

📄 Description

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

What

Opaque entity quads now go into shadow_map through the shadow camera, with their texture's cutout. There's no new binding or manifest key.

  • They draw after the translucent map is copied, so shadow_map_translucent stays terrain only: where an entity casts, the solid map is the darker and decides.
  • Unlit overlays cast nothing, using the same list as entity.wgsl.

Stacked on #5476, which is stacked on #5461. Only the last commit and the merges are new here, so please merge those two first.

Not in this PR: the player's own model in first person isn't in the entity buffer, so it casts no shadow yet. Translucent entity quads don't cast either.

Fixes #5589

Proof

Local run on Linux (CachyOS, RTX 3050 Ti, Vulkan) with a throwaway pack that darkens terrain by the map, built before the small unlit list change in the last commit:

  • Single player, server thread: the pack loaded with no shader error or panic. A cow, a zombie and an iron golem on a stone floor cast shadows shaped like their models at time set 2500.
  • Not run: lan_e2e on this branch (this draws client-side only), and parity harnesses. No screenshot is attached: I can't upload one here without committing it, and a capture shows Mojang's textures.

pr_ready (tools/pr_ready.py --quick on teiwazik-laptop, against origin/main at c9d8e3efa, 3 min 15 s)

Check Result
Scope ⚠️ 18 files, +1093 −19; 1048 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 510 passed (41 s)
rustfmt ✅ (10 s)
clippy ✅ (1 min 49 s)
tests: horizon-client-render, horizon-shader-api, horizon-shaders ✅ 940 passed (34 s)
doc tests ✅ 0 passed (1 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/5590 **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/s8-shadow-entities` --- ### 📝 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 - [`e26bd0f`](https://github.com/horizon-rust/horizon/commit/e26bd0fe58f0cb465b60f7bc5712fb5a08ca5507) feat(mods): native mods use items over time (duration, animation, can eat, start and finish) - [`753c565`](https://github.com/horizon-rust/horizon/commit/753c565883ce75bbfd9624ad53ed0de157a0c59b) Shader API: the blob stays where a pack has no sun to cast with - [`e8d5b82`](https://github.com/horizon-rust/horizon/commit/e8d5b826b09400358c8d6a633d2460889c3785b4) Fix native chat to acting players in hooks - [`dcec52b`](https://github.com/horizon-rust/horizon/commit/dcec52b07ea265c1e05bf2d26c58fec063781f7a) Native mods: native_draw_item and native_block_state_property for drawing block entities - [`9a47759`](https://github.com/horizon-rust/horizon/commit/9a47759df3a604b881e58865af4d69db922bd1d9) feat(mods): mod menu types with their own slot count and data slots ### 📊 Changes **69 files changed** (+2210 additions, -313 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/containers.rs` (+62 -0) 📝 `crates/horizon-client-render/src/fast_hash.rs` (+3 -85) 📝 `crates/horizon-client-render/src/gfx.rs` (+40 -9) 📝 `crates/horizon-client-render/src/gfx/entity_batch.rs` (+5 -0) 📝 `crates/horizon-client-render/src/gfx/native_material.rs` (+2 -0) 📝 `crates/horizon-client-render/src/gfx/native_shadow.rs` (+141 -2) 📝 `crates/horizon-client-render/src/streaming.rs` (+13 -4) 📝 `crates/horizon-client/src/content_identity.rs` (+31 -3) 📝 `crates/horizon-client/src/entity_nbt.rs` (+42 -2) 📝 `crates/horizon-client/src/game.rs` (+120 -43) 📝 `crates/horizon-client/src/game/chat.rs` (+3 -0) 📝 `crates/horizon-client/src/game/commands.rs` (+25 -11) 📝 `crates/horizon-client/src/game/creatures.rs` (+9 -2) 📝 `crates/horizon-client/src/game/crossbow.rs` (+2 -4) 📝 `crates/horizon-client/src/game/end.rs` (+1 -3) 📝 `crates/horizon-client/src/game/entity_culling.rs` (+3 -0) 📝 `crates/horizon-client/src/game/fov.rs` (+1 -2) 📝 `crates/horizon-client/src/game/item_draw.rs` (+5 -2) ➕ `crates/horizon-client/src/game/item_use.rs` (+218 -0) 📝 `crates/horizon-client/src/game/lan.rs` (+4 -3) _...and 49 more files_ </details> ### 📄 Description > 🤖 Opened by Teiwazik's AI agent (Claude Code, Claude Opus 5.5), not by Teiwazik personally. ## What Opaque entity quads now go into `shadow_map` through the shadow camera, with their texture's cutout. There's no new binding or manifest key. - They draw after the translucent map is copied, so `shadow_map_translucent` stays terrain only: where an entity casts, the solid map is the darker and decides. - Unlit overlays cast nothing, using the same list as `entity.wgsl`. **Stacked on #5476**, which is stacked on #5461. Only the last commit and the merges are new here, so please merge those two first. **Not in this PR:** the player's own model in first person isn't in the entity buffer, so it casts no shadow yet. Translucent entity quads don't cast either. Fixes #5589 ## Proof Local run on Linux (CachyOS, RTX 3050 Ti, Vulkan) with a throwaway pack that darkens terrain by the map, built before the small `unlit` list change in the last commit: - **Single player, server thread:** the pack loaded with no shader error or panic. A cow, a zombie and an iron golem on a stone floor cast shadows shaped like their models at `time set 2500`. - **Not run:** `lan_e2e` on this branch (this draws client-side only), and parity harnesses. No screenshot is attached: I can't upload one here without committing it, and a capture shows Mojang's textures. **pr_ready** (`tools/pr_ready.py --quick` on teiwazik-laptop, against origin/main at c9d8e3efa, 3 min 15 s) | Check | Result | | --- | --- | | Scope | ⚠️ 18 files, +1093 −19; 1048 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 510 passed (41 s) | | rustfmt | ✅ (10 s) | | clippy | ✅ (1 min 49 s) | | tests: horizon-client-render, horizon-shader-api, horizon-shaders | ✅ 940 passed (34 s) | | doc tests | ✅ 0 passed (1 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:19:20 +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#6374
No description provided.