[PR #7292] [MERGED] Render hooks: WorldDrawn says which entity each run of entity quads is #7469

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7292
Author: @levzzz5154
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: render/world-drawn-motion


📝 Commits (4)

  • 145c2ef Render hooks: WorldDrawn says which entity each run of entity quads is
  • 1390bf8 Fragment: the docs entry comes from doc_summary, not a comment marker
  • 867677b Merge main into #7292
  • 82a73e8 Merge main into #7292

📊 Changes

4 files changed (+18 additions, -1 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+1 -0)
📝 crates/horizon-client-render/src/gfx/native_render.rs (+6 -0)
📝 docs/native-mods.md (+3 -1)
➕ tools/native-hook-fragments/world_drawn_motion.json (+8 -0)

📄 Description

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

Closes #7280.

WorldDrawn::spans key entity runs by type. So a mod that follows entities from frame to frame, like a motion blur drawing each entity's own motion vectors, could only match "the second pig" by draw order. When a pig spawned, died or was culled, or two swapped places in the order, the mod paired one pig's vertices with another's from the last frame and drew a frame of wrong streaks.

The game already records the right data every frame, for frame generation: Frame::entity_motion tags each mob's, player's and dropped item's vertices with its entity id (mark_motion, creatures.rs and item_draw.rs). This passes it on as WorldDrawn::motion:

  • native_render.rs: the field and its doc.
  • gfx.rs: one line, motion: frame.entity_motion.
  • docs/native-mods.md: the render hook points section.
  • tools/native-hook-fragments/world_drawn_motion.json: a hook-less fragment, like attachment_existing.json, so a mod that reads the field can name the API number it needs.

WorldDrawn is #[non_exhaustive], so no mod breaks. Nothing changes for players, and no new work happens per frame: the slice was already built.

Proof: I applied a motion-blur bundle that keys its runs by WorldDrawn::motion to this branch with horizon-mixins (the launcher's pinned ddd9700). cargo check -p horizon-client --bin horizon-client passes on the staged source.

Checks (cargo +stable):

  • fmt --all -- --check: ok
  • clippy -p horizon-client-render --lib --tests -D warnings: ok
  • test -p horizon-client-render --lib native_render: ok
  • check -p horizon-client --bins: ok

python3 tools/pr_ready.py --quick:

  • 5179 workspace tests passed. The 2 failures (xtask generated_output_is_current, new_hook_placeholder_is_reported_then_filled) and "mod API up to date" also failed on main's 6e1635c. Main has since been regenerated, and mod-api --check passes on 133ca8c.
  • Its clippy step ran with this machine's default Rust 1.95 and failed in horizon-world, which this PR doesn't touch. cargo +stable clippy -p horizon-world --lib -D warnings is clean.
  • Content root, doc and launcher tests pass.

🤖 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/7292 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `render/world-drawn-motion` --- ### 📝 Commits (4) - [`145c2ef`](https://github.com/horizon-rust/horizon/commit/145c2ef2633182e4012ba72055334968b91a18d4) Render hooks: WorldDrawn says which entity each run of entity quads is - [`1390bf8`](https://github.com/horizon-rust/horizon/commit/1390bf89467f579128006bc9c3c185d36319e81c) Fragment: the docs entry comes from doc_summary, not a comment marker - [`867677b`](https://github.com/horizon-rust/horizon/commit/867677bbbd8c0a4e12badf9e4999489558e4abba) Merge main into #7292 - [`82a73e8`](https://github.com/horizon-rust/horizon/commit/82a73e8423a79eb576239625733c181733625723) Merge main into #7292 ### 📊 Changes **4 files changed** (+18 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+1 -0) 📝 `crates/horizon-client-render/src/gfx/native_render.rs` (+6 -0) 📝 `docs/native-mods.md` (+3 -1) ➕ `tools/native-hook-fragments/world_drawn_motion.json` (+8 -0) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Opus 5.5), not by levzzz5154 personally. Closes #7280. `WorldDrawn::spans` key entity runs by type. So a mod that follows entities from frame to frame, like a motion blur drawing each entity's own motion vectors, could only match "the second pig" by draw order. When a pig spawned, died or was culled, or two swapped places in the order, the mod paired one pig's vertices with another's from the last frame and drew a frame of wrong streaks. The game already records the right data every frame, for frame generation: `Frame::entity_motion` tags each mob's, player's and dropped item's vertices with its entity id (`mark_motion`, `creatures.rs` and `item_draw.rs`). This passes it on as `WorldDrawn::motion`: - `native_render.rs`: the field and its doc. - `gfx.rs`: one line, `motion: frame.entity_motion`. - `docs/native-mods.md`: the render hook points section. - `tools/native-hook-fragments/world_drawn_motion.json`: a hook-less fragment, like `attachment_existing.json`, so a mod that reads the field can name the API number it needs. `WorldDrawn` is `#[non_exhaustive]`, so no mod breaks. Nothing changes for players, and no new work happens per frame: the slice was already built. **Proof:** I applied a motion-blur bundle that keys its runs by `WorldDrawn::motion` to this branch with horizon-mixins (the launcher's pinned `ddd9700`). `cargo check -p horizon-client --bin horizon-client` passes on the staged source. **Checks** (`cargo +stable`): - `fmt --all -- --check`: ok - `clippy -p horizon-client-render --lib --tests -D warnings`: ok - `test -p horizon-client-render --lib native_render`: ok - `check -p horizon-client --bins`: ok `python3 tools/pr_ready.py --quick`: - 5179 workspace tests passed. The 2 failures (`xtask` `generated_output_is_current`, `new_hook_placeholder_is_reported_then_filled`) and "mod API up to date" also failed on main's `6e1635c`. Main has since been regenerated, and `mod-api --check` passes on `133ca8c`. - Its clippy step ran with this machine's default Rust 1.95 and failed in `horizon-world`, which this PR doesn't touch. `cargo +stable clippy -p horizon-world --lib -D warnings` is clean. - Content root, doc and launcher tests pass. 🤖 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:39:54 +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#7469
No description provided.