[PR #1886] [MERGED] Shader packs, clean room 38: load the shadow programs #3842

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1886
Author: @ludovic111
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @ludovic111

Base: main ← Head: feat/shader-packs-shadow-programs


📝 Commits (4)

  • 5dcbe22 Shader packs, clean room 37: shadow settings and the shadow camera
  • 86d8d9e Shader packs, clean room 38: load the shadow programs
  • 86a2f8e Merge feat/shader-packs-hand into feat/shader-packs-shadow-camera
  • b2a7e77 Merge feat/shader-packs-shadow-camera into feat/shader-packs-shadow-programs

📊 Changes

8 files changed (+475 additions, -35 deletions)

View changed files

📝 crates/horizon-client/src/gfx/pack_post.rs (+5 -1)
📝 crates/horizon-client/src/gfx/pack_sky.rs (+6 -4)
📝 crates/horizon-client/src/gfx/pack_uniforms.rs (+104 -17)
📝 crates/horizon-shaders/src/config.rs (+136 -0)
📝 crates/horizon-shaders/src/lib.rs (+3 -3)
📝 crates/horizon-shaders/src/post.rs (+177 -3)
📝 crates/horizon-shaders/src/translate/mod.rs (+39 -6)
📝 crates/horizon-shaders/tests/real_packs.rs (+5 -1)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Shader packs, clean room 38: load the shadow programs. Stacked on #1885.

What

  • Shadow pass detection (spec 2.5): the shadow pass runs when:

    • some program reads a shadow buffer (shadow, watershadow, shadowtex0/1, their HW forms, shadowcolor, shadowcolor0/1);
    • or shadow.enabled=true.

    shadow.enabled=false keeps it off.

  • Programs (2.1, 2.4), in the new Shadow and ShadowComp groups:

    • shadow draws solid and cutout terrain;
    • shadow_water draws translucent terrain, falling back to shadow;
    • shadowcomp…shadowcomp99 load as well.
  • shadow_solid and shadow_cutout are not used: the game draws solid and cutout terrain in one draw.

  • Buffers (6.3): output n writes shadowcolor n, so draw buffer lists stop at the first index past 1.

  • Translation: translate_shadow gives a shadow program the shadow camera's matrices as its model-view and projection (5.2).

  • Nothing draws yet: the game uses these programs from #1887 on.

Clean room

Clean-room: implemented from cleanroom/shader-packs-spec.md revision 1, §2.1, §2.4, §2.5, §5.2, §6.3; no other loader's code read.

How tested

  • Unit tests:
    • shadow_programs_load_when_a_shadow_buffer_is_read: detection, shadow.enabled, the fallback, shadowcomp;
    • the shadow case in gbuffers_programs_read_the_games_vertices.
  • real_packs prints the shadow programs of the local test packs: BSL, Complementary and Sildurs translate.

🤖 Generated with Claude Code


🔄 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/1886 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/shader-packs-shadow-programs` --- ### 📝 Commits (4) - [`5dcbe22`](https://github.com/horizon-rust/horizon/commit/5dcbe222c94261c7291659a15a06549f46134014) Shader packs, clean room 37: shadow settings and the shadow camera - [`86d8d9e`](https://github.com/horizon-rust/horizon/commit/86d8d9e3a19a0c6614b6b4fec537007d33759254) Shader packs, clean room 38: load the shadow programs - [`86a2f8e`](https://github.com/horizon-rust/horizon/commit/86a2f8e470868e862d3290efe71ba25f8dd880ba) Merge feat/shader-packs-hand into feat/shader-packs-shadow-camera - [`b2a7e77`](https://github.com/horizon-rust/horizon/commit/b2a7e77036c445340f06f55f3f34952e673dba3e) Merge feat/shader-packs-shadow-camera into feat/shader-packs-shadow-programs ### 📊 Changes **8 files changed** (+475 additions, -35 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/gfx/pack_post.rs` (+5 -1) 📝 `crates/horizon-client/src/gfx/pack_sky.rs` (+6 -4) 📝 `crates/horizon-client/src/gfx/pack_uniforms.rs` (+104 -17) 📝 `crates/horizon-shaders/src/config.rs` (+136 -0) 📝 `crates/horizon-shaders/src/lib.rs` (+3 -3) 📝 `crates/horizon-shaders/src/post.rs` (+177 -3) 📝 `crates/horizon-shaders/src/translate/mod.rs` (+39 -6) 📝 `crates/horizon-shaders/tests/real_packs.rs` (+5 -1) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. **Shader packs, clean room 38:** load the shadow programs. Stacked on #1885. ## What - **Shadow pass detection** (spec 2.5): the shadow pass runs when: - some program reads a shadow buffer (`shadow`, `watershadow`, `shadowtex0/1`, their HW forms, `shadowcolor`, `shadowcolor0/1`); - or `shadow.enabled=true`. `shadow.enabled=false` keeps it off. - **Programs** (2.1, 2.4), in the new `Shadow` and `ShadowComp` groups: - `shadow` draws solid and cutout terrain; - `shadow_water` draws translucent terrain, falling back to `shadow`; - `shadowcomp`…`shadowcomp99` load as well. - `shadow_solid` and `shadow_cutout` are not used: the game draws solid and cutout terrain in one draw. - **Buffers** (6.3): output n writes shadowcolor n, so draw buffer lists stop at the first index past 1. - **Translation:** `translate_shadow` gives a shadow program the shadow camera's matrices as its model-view and projection (5.2). - **Nothing draws yet:** the game uses these programs from #1887 on. ## Clean room Clean-room: implemented from `cleanroom/shader-packs-spec.md` revision 1, §2.1, §2.4, §2.5, §5.2, §6.3; no other loader's code read. ## How tested - **Unit tests:** - `shadow_programs_load_when_a_shadow_buffer_is_read`: detection, `shadow.enabled`, the fallback, shadowcomp; - the shadow case in `gbuffers_programs_read_the_games_vertices`. - `real_packs` prints the shadow programs of the local test packs: BSL, Complementary and Sildurs translate. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:12:42 +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#3842
No description provided.