Skip to content

EN-022 engine half: real previous-frame transforms for material draws#82

Closed
proggeramlug wants to merge 1 commit into
fix/round2-stabilityfrom
feat/en022-material-velocity
Closed

EN-022 engine half: real previous-frame transforms for material draws#82
proggeramlug wants to merge 1 commit into
fix/round2-stabilityfrom
feat/en022-material-velocity

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

Stacked on #75. The ABI's PerDraw.prev_mvp existed "for motion vectors" since day one — but every submit path filled it with the current mvp, so world motion vectors were zero by construction and TAA's motion-adaptive clamp never engaged for the material-drawn world (audit F8, the primary TSR-shimmer mechanism).

  • Per-slot model history in MaterialSystem (slot = submission order, the same stable-identity convention the cached-model path uses); submit_draw/submit_draw_instanced compose prev_vp × prev_model[slot]; fresh slots fall back to zero object motion for one frame.
  • reset_draw_slot rotates the history and pins prev_vp_matrix (which already fed PerView.prev_view_proj correctly).
  • The legacy prev_mvp submit parameter is ignored (_legacy_prev_mvp) — callers passed current-mvp garbage.
  • material_abi.wgsl gains abi_motion_vector(curr, prev) matching the core path's NDC-delta × 0.5 convention, with doc guidance for static vs wind-displaced shaders (PerFrame.delta_time already enables prev-time wind — no ABI layout change anywhere).

Behavioral no-op until materials write velocity — the shooter's four world materials do exactly that in the stacked shooter PR. Suite green (99 lib + 7 golden, unchanged — static scenes are velocity-neutral by definition).

…erial draws

The material ABI carried PerDraw.prev_mvp "for motion vectors" since
day one, but every submit path filled it with the CURRENT mvp — world
motion vectors were identically zero by construction, so TAA's
motion-adaptive clamp never engaged for material-drawn geometry
(round-2 audit F8, the primary TSR-shimmer mechanism).

- MaterialSystem keeps a per-slot model history (draw slot =
  submission order, stable frame-to-frame — the same identity
  convention the cached-model path relies on). submit_draw /
  submit_draw_instanced now compose prev_vp x prev_model[slot] into
  PerDraw.prev_mvp; a fresh slot falls back to the current model
  (zero object motion on its first frame).
- reset_draw_slot rotates the history and pins the previous frame's
  view-projection (from Renderer::prev_vp_matrix, which already fed
  PerView.prev_view_proj correctly).
- The legacy prev_mvp parameter on the submit APIs is ignored and
  renamed _legacy_prev_mvp (callers passed current-mvp garbage).
- material_abi.wgsl gains `abi_motion_vector(curr, prev)` — the core
  path's exact NDC-delta x 0.5 convention — plus doc guidance for
  static vs wind-displaced vertex shaders (PerFrame.delta_time already
  enables prev-time wind evaluation with no ABI change).

Behavioral no-op until materials read prev_mvp / write velocity (the
shooter's material updates ride a stacked shooter PR). Suite green:
99 lib + 7 golden, all unchanged.
@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f75f0137-5585-4981-8a99-2ec26ee0fcb7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/en022-material-velocity

Comment @coderabbitai help to get the list of available commands.

@proggeramlug

Copy link
Copy Markdown
Contributor Author

Landed in main via the round-2 consolidation merge (#83). All commits from this branch are now on main; closing as merged-through-integration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant