[PR #4345] [MERGED] Shader API: the frame's motion since the last one, and the eye's light eased #5574

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4345
Author: @Teiwazik
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111

Base: main ← Head: shader/s2-frame-motion


📝 Commits (10+)

  • fa845cd Shader API: the material stage sees what lies behind translucent terrain
  • 951c7d5 Shader API: the frame's motion since the last one, and the eye's light eased
  • 3dbcf3c Merge remote-tracking branch 'origin/main' into pr4335
  • 252ac76 Merge branch 'pr4335' into pr4345
  • 07cd25f Shader API: a gap between frames forgets the frame before
  • 3f0b8f2 Merge remote-tracking branch 'origin/main' into shader/s1-material-behind
  • 9452f0a Merge branch 'shader/s1-material-behind' into shader/s2-frame-motion
  • 59f37f9 Merge origin/main into shader/s1-material-behind
  • a8763ea Merge remote-tracking branch 'origin/main' into a3-pr-4335
  • 7264523 Merge #4335's updated branch (main with #4186) into shader/s2-frame-motion

📊 Changes

8 files changed (+297 additions, -22 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+41 -1)
📝 crates/horizon-client-render/src/gfx/native_material.rs (+5 -2)
📝 crates/horizon-client-render/src/gfx/native_post.rs (+189 -13)
📝 crates/horizon-client-render/src/gfx/world_post.rs (+5 -2)
📝 crates/horizon-shader-api/src/inputs.rs (+20 -2)
📝 crates/horizon-shader-api/src/stages.rs (+22 -2)
📝 docs/api/shaders-reference.md (+9 -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 #4344

Builds on #4335 (this branch contains its commit); this PR's own change is the last commit.

What and why

Within API 0.1, additively, Frame gains:

  • previous_view_projection: last frame's projection * view (camera-relative), so a point at p now was at p + camera_motion for last frame's camera; this frame's on the first.
  • camera_motion (blocks) and delta_time (seconds) since last frame.
  • eye_light_smooth: eye_light eased with a 2 s half-life; in_water and in_lava: eye_in 1 and 2 eased with a quarter second, so exposure and underwater fog fade instead of stepping.

frame_inputs still builds a frame on its own (zero motion, unsmoothed values); NativeFrame::write keeps the last view-projection, camera and time, and the eased values, starting from the first frame's own. The fields are ordered so the struct stays a multiple of 16 bytes and the Rust and WGSL offsets agree (tests/reference.rs checks them against naga); frame_fields_carry_their_docs counts 34 fields and 496 bytes.

pr_ready

pr_ready (tools/pr_ready.py --quick on Teiwazik, against origin/main at 68f036059, 4 min 34 s)

Check Result
Scope ✅ 8 files, +277 −22
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 480 passed (1 min 16 s)
rustfmt ✅ (14 s)
clippy ✅ (1 min 27 s)
tests: horizon-client-render, horizon-shader-api ✅ 588 passed (1 min 7 s)
doc tests ✅ 0 passed (26 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


🔄 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/4345 **Author:** [@Teiwazik](https://github.com/Teiwazik) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `shader/s2-frame-motion` --- ### 📝 Commits (10+) - [`fa845cd`](https://github.com/horizon-rust/horizon/commit/fa845cd5802713d4824f42f296eaf99b52792dd8) Shader API: the material stage sees what lies behind translucent terrain - [`951c7d5`](https://github.com/horizon-rust/horizon/commit/951c7d5165d02d68f47d89fb1f2033efd5b9b6c0) Shader API: the frame's motion since the last one, and the eye's light eased - [`3dbcf3c`](https://github.com/horizon-rust/horizon/commit/3dbcf3c6c66104f76353df7352d14d12889409ec) Merge remote-tracking branch 'origin/main' into pr4335 - [`252ac76`](https://github.com/horizon-rust/horizon/commit/252ac76369990b6ef98615f6a125d769ec407707) Merge branch 'pr4335' into pr4345 - [`07cd25f`](https://github.com/horizon-rust/horizon/commit/07cd25f8192cba96c10092165f1db1943d7580a6) Shader API: a gap between frames forgets the frame before - [`3f0b8f2`](https://github.com/horizon-rust/horizon/commit/3f0b8f293a23a926c17f1f87c2948182e4b32889) Merge remote-tracking branch 'origin/main' into shader/s1-material-behind - [`9452f0a`](https://github.com/horizon-rust/horizon/commit/9452f0ac11e98e7ac8ee741072312ea251ed3bf8) Merge branch 'shader/s1-material-behind' into shader/s2-frame-motion - [`59f37f9`](https://github.com/horizon-rust/horizon/commit/59f37f92fb9b5f2392967f06c14f90727de84d02) Merge origin/main into shader/s1-material-behind - [`a8763ea`](https://github.com/horizon-rust/horizon/commit/a8763ea259a1347850afacca53e4ba330abfbbe1) Merge remote-tracking branch 'origin/main' into a3-pr-4335 - [`7264523`](https://github.com/horizon-rust/horizon/commit/72645234c5b2b75840c7d7f281200473c7774e9a) Merge #4335's updated branch (main with #4186) into shader/s2-frame-motion ### 📊 Changes **8 files changed** (+297 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+41 -1) 📝 `crates/horizon-client-render/src/gfx/native_material.rs` (+5 -2) 📝 `crates/horizon-client-render/src/gfx/native_post.rs` (+189 -13) 📝 `crates/horizon-client-render/src/gfx/world_post.rs` (+5 -2) 📝 `crates/horizon-shader-api/src/inputs.rs` (+20 -2) 📝 `crates/horizon-shader-api/src/stages.rs` (+22 -2) 📝 `docs/api/shaders-reference.md` (+9 -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 #4344 Builds on #4335 (this branch contains its commit); this PR's own change is the last commit. ## What and why Within API 0.1, additively, `Frame` gains: - `previous_view_projection`: last frame's `projection * view` (camera-relative), so a point at `p` now was at `p + camera_motion` for last frame's camera; this frame's on the first. - `camera_motion` (blocks) and `delta_time` (seconds) since last frame. - `eye_light_smooth`: `eye_light` eased with a 2 s half-life; `in_water` and `in_lava`: `eye_in` 1 and 2 eased with a quarter second, so exposure and underwater fog fade instead of stepping. `frame_inputs` still builds a frame on its own (zero motion, unsmoothed values); `NativeFrame::write` keeps the last view-projection, camera and time, and the eased values, starting from the first frame's own. The fields are ordered so the struct stays a multiple of 16 bytes and the Rust and WGSL offsets agree (`tests/reference.rs` checks them against naga); `frame_fields_carry_their_docs` counts 34 fields and 496 bytes. ## pr_ready **pr_ready** (`tools/pr_ready.py --quick` on Teiwazik, against origin/main at 68f036059, 4 min 34 s) | Check | Result | | --- | --- | | Scope | ✅ 8 files, +277 −22 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 480 passed (1 min 16 s) | | rustfmt | ✅ (14 s) | | clippy | ✅ (1 min 27 s) | | tests: horizon-client-render, horizon-shader-api | ✅ 588 passed (1 min 7 s) | | doc tests | ✅ 0 passed (26 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:13:30 +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#5574
No description provided.