[PR #5694] [MERGED] Frame generation: mobs' and dropped items' own motion vectors #6443

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

📋 Pull Request Information

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

Base: main ← Head: fsr-entity-motion


📝 Commits (1)

  • 5fb3fa4 Frame generation: mobs' and dropped items' own motion vectors

📊 Changes

9 files changed (+459 additions, -8 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+3 -0)
📝 crates/horizon-client-render/src/gfx/frame_gen.rs (+4 -2)
📝 crates/horizon-client-render/src/gfx/frame_gen/interpolation.rs (+60 -4)
📝 crates/horizon-client-render/src/gfx/frame_gen/interpolation.wgsl (+9 -2)
➕ crates/horizon-client-render/src/gfx/frame_gen/motion.rs (+306 -0)
➕ crates/horizon-client-render/src/gfx/frame_gen/motion.wgsl (+58 -0)
📝 crates/horizon-client/src/game.rs (+15 -0)
📝 crates/horizon-client/src/game/creatures.rs (+3 -0)
📝 crates/horizon-client/src/game/item_draw.rs (+1 -0)

📄 Description

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

Frame generation: mobs' and dropped items' own motion vectors. The first of the two smaller PRs asked for when #3764 was closed. The Frame Generation setting that runs this follows in its own PR, stacked on this one. Toward #2922.

What it does

The camera's motion vectors (from the depth) see mobs and dropped items as still, so a made frame would show them where the real one does. This adds what the interpolation needs to move them on their own:

  • The game tags entity vertices (Frame::entity_motion): mark_motion(start, id) opens a span for each mob (mob_geometry) and each dropped item (dropped_item_geometry); id 0 closes it. Per #3764's review, the mob loop's last span is now closed right after the loop, so the elder guardian apparition, spawner mobs and projectiles no longer join the last mob's span.
  • gfx/frame_gen/motion.{rs,wgsl} (ObjectMotion): an entity whose vertices have the same shape as last frame (count, UVs, layers) gets each vertex's own motion (walking, limbs, bobbing, spin) in this frame's camera space. A pass draws those vectors into a texture at the render size, only where the world shows the entity: where the depth is its own or, for translucent items (which don't write depth, as in vanilla), where its texture is opaque.
  • The interpolation takes that texture as Inputs::object_motion (binding 34), and its prepare pass uses it over the camera's motion vector where it has one. That's the game motion vectors FSR expects.

Nothing runs it yet: like parts 1 and 2, the module is #[allow(dead_code)] until the setting lands, and players see no change. Label: skip-release, for the maintainer to add.

Checked

  • tracks_each_entity_by_id: an entity seen last frame gets its vertices' own motion in this frame's camera space; a new entity, one whose model changed, and untagged geometry get none.
  • moves_what_has_its_own_motion_vectors_halfway: with a still camera and a picture moving by its own motion vectors, the made frame's error against the true halfway frame is under a quarter of either real frame's.
  • cargo test -p horizon-client-render --lib: 827 passed. cargo test -p horizon-client --lib --bins: all passed. cargo clippy -p horizon-client-render -p horizon-client --all-targets -- -D warnings and rustfmt are clean.
  • tools/pr_ready.py wasn't run; CI's checks cover it.

459 lines added, 8 removed.

🤖 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/5694 **Author:** [@spidercraft](https://github.com/spidercraft) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fsr-entity-motion` --- ### 📝 Commits (1) - [`5fb3fa4`](https://github.com/horizon-rust/horizon/commit/5fb3fa4c324e84de655e908142d98bc048c233ac) Frame generation: mobs' and dropped items' own motion vectors ### 📊 Changes **9 files changed** (+459 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+3 -0) 📝 `crates/horizon-client-render/src/gfx/frame_gen.rs` (+4 -2) 📝 `crates/horizon-client-render/src/gfx/frame_gen/interpolation.rs` (+60 -4) 📝 `crates/horizon-client-render/src/gfx/frame_gen/interpolation.wgsl` (+9 -2) ➕ `crates/horizon-client-render/src/gfx/frame_gen/motion.rs` (+306 -0) ➕ `crates/horizon-client-render/src/gfx/frame_gen/motion.wgsl` (+58 -0) 📝 `crates/horizon-client/src/game.rs` (+15 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+3 -0) 📝 `crates/horizon-client/src/game/item_draw.rs` (+1 -0) </details> ### 📄 Description > 🤖 Opened by spidercraft's AI agent (Claude Code, Opus 5.5), not by spidercraft personally. **Frame generation: mobs' and dropped items' own motion vectors.** The first of the two smaller PRs asked for when #3764 was closed. The Frame Generation setting that runs this follows in its own PR, stacked on this one. Toward #2922. ## What it does The camera's motion vectors (from the depth) see mobs and dropped items as still, so a made frame would show them where the real one does. This adds what the interpolation needs to move them on their own: - **The game tags entity vertices** (`Frame::entity_motion`): `mark_motion(start, id)` opens a span for each mob (`mob_geometry`) and each dropped item (`dropped_item_geometry`); id 0 closes it. Per #3764's review, the mob loop's last span is now closed right after the loop, so the elder guardian apparition, spawner mobs and projectiles no longer join the last mob's span. - **`gfx/frame_gen/motion.{rs,wgsl}`** (`ObjectMotion`): an entity whose vertices have the same shape as last frame (count, UVs, layers) gets each vertex's own motion (walking, limbs, bobbing, spin) in this frame's camera space. A pass draws those vectors into a texture at the render size, only where the world shows the entity: where the depth is its own or, for translucent items (which don't write depth, as in vanilla), where its texture is opaque. - **The interpolation** takes that texture as `Inputs::object_motion` (binding 34), and its prepare pass uses it over the camera's motion vector where it has one. That's the game motion vectors FSR expects. Nothing runs it yet: like parts 1 and 2, the module is `#[allow(dead_code)]` until the setting lands, and players see no change. Label: `skip-release`, for the maintainer to add. ## Checked - `tracks_each_entity_by_id`: an entity seen last frame gets its vertices' own motion in this frame's camera space; a new entity, one whose model changed, and untagged geometry get none. - `moves_what_has_its_own_motion_vectors_halfway`: with a still camera and a picture moving by its own motion vectors, the made frame's error against the true halfway frame is under a quarter of either real frame's. - `cargo test -p horizon-client-render --lib`: 827 passed. `cargo test -p horizon-client --lib --bins`: all passed. `cargo clippy -p horizon-client-render -p horizon-client --all-targets -- -D warnings` and rustfmt are clean. - `tools/pr_ready.py` wasn't run; CI's checks cover it. 459 lines added, 8 removed. 🤖 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 06:20: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#6443
No description provided.