[PR #1885] [MERGED] Shader packs, clean room 37: shadow settings and the shadow camera #3839

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

📋 Pull Request Information

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

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


📝 Commits (2)

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

📊 Changes

5 files changed (+252 additions, -23 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 (+1 -1)

📄 Description

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

Shader packs, clean room 37: the shadow settings and a real shadow camera. Stacked on #1801. This opens slice 8 (shadows): #1885–#1888, stacked in that order. The slice's checks are in #1888.

What

  • Shadow settings (spec 6.3, 7.1): the stage files' shadowMapResolution, shadowDistance, shadowDistanceRenderMul, shadowIntervalSize, sunPathRotation, shadowMapFov, shadowNearPlane, shadowFarPlane, shadowHardwareFiltering[0|1] and the shadowcolor0/1 Format, Clear and ClearColor are read into Config::shadow.
  • Shadow matrices (OQ-6 is open in the spec; this is the decision recorded in the implementation plan):
    • the camera looks from the shadow light (up is +Z, or +Y when the light is within 0.99 of Z);
    • it sits 128 blocks toward the light from a point that moves in steps of shadowIntervalSize along the shadow view's own axes;
    • the projection is orthographic over shadowDistance on each side (perspective with shadowMapFov), between shadowNearPlane and shadowFarPlane.
  • sunPathRotation turns the sun and moon's path about the world's X axis. sunPosition, moonPosition, shadowLightPosition, the shadow camera, and the sun, moon and stars that gbuffers_skytextured and gbuffers_skybasic draw all follow it.
  • Without a shader pack nothing changes: all of this is in the pack's uniforms.

Clean room

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

How tested

  • Unit tests:
    • shadow_settings: every constant, the shadowcolor formats and clears;
    • noon_is_straight_up_and_the_sun_sets_in_the_west (with a tilt);
    • the_shadow_camera_looks_down_from_the_light_in_steps.
  • The A/B, screenshots, harnesses and timing are in #1888, the top of the group.

🤖 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/1885 **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-camera` --- ### 📝 Commits (2) - [`5dcbe22`](https://github.com/horizon-rust/horizon/commit/5dcbe222c94261c7291659a15a06549f46134014) Shader packs, clean room 37: shadow settings and the shadow camera - [`86a2f8e`](https://github.com/horizon-rust/horizon/commit/86a2f8e470868e862d3290efe71ba25f8dd880ba) Merge feat/shader-packs-hand into feat/shader-packs-shadow-camera ### 📊 Changes **5 files changed** (+252 additions, -23 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` (+1 -1) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. **Shader packs, clean room 37:** the shadow settings and a real shadow camera. Stacked on #1801. This opens slice 8 (shadows): #1885–#1888, stacked in that order. The slice's checks are in #1888. ## What - **Shadow settings** (spec 6.3, 7.1): the stage files' `shadowMapResolution`, `shadowDistance`, `shadowDistanceRenderMul`, `shadowIntervalSize`, `sunPathRotation`, `shadowMapFov`, `shadowNearPlane`, `shadowFarPlane`, `shadowHardwareFiltering[0|1]` and the `shadowcolor0/1` Format, Clear and ClearColor are read into `Config::shadow`. - **Shadow matrices** (OQ-6 is open in the spec; this is the decision recorded in the implementation plan): - the camera looks from the shadow light (up is +Z, or +Y when the light is within 0.99 of Z); - it sits 128 blocks toward the light from a point that moves in steps of `shadowIntervalSize` along the shadow view's own axes; - the projection is orthographic over `shadowDistance` on each side (perspective with `shadowMapFov`), between `shadowNearPlane` and `shadowFarPlane`. - **`sunPathRotation`** turns the sun and moon's path about the world's X axis. `sunPosition`, `moonPosition`, `shadowLightPosition`, the shadow camera, and the sun, moon and stars that `gbuffers_skytextured` and `gbuffers_skybasic` draw all follow it. - **Without a shader pack** nothing changes: all of this is in the pack's uniforms. ## Clean room Clean-room: implemented from `cleanroom/shader-packs-spec.md` revision 1, §5.2, §6.3, §7.1, OQ-6; no other loader's code read. ## How tested - **Unit tests:** - `shadow_settings`: every constant, the shadowcolor formats and clears; - `noon_is_straight_up_and_the_sun_sets_in_the_west` (with a tilt); - `the_shadow_camera_looks_down_from_the_light_in_steps`. - The A/B, screenshots, harnesses and timing are in #1888, the top of the group. 🤖 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:41 +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#3839
No description provided.