Skip to content

EN-022 shooter half: real motion vectors for all four world materials#4

Closed
proggeramlug wants to merge 1 commit into
feat/round2-quickwinsfrom
feat/round2-velocity
Closed

EN-022 shooter half: real motion vectors for all four world materials#4
proggeramlug wants to merge 1 commit into
feat/round2-quickwinsfrom
feat/round2-velocity

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

Stacked on #2 (quick wins). Pairs with engine PR Bloom-Engine/engine#82 (the engine half: real per-slot previous transforms + the abi_motion_vector helper).

What changes

Audit F8: the whole material-drawn world wrote velocity = (0,0), so TAA's motion-adaptive clamp never engaged — the primary mechanism behind TSR-0.5 thin-grass shimmer and wind-sway ghosting.

  • terrain / building (static): previous clip = view.prev_view_proj × world — pure camera reprojection.
  • tree: the sway is re-evaluated at frame.time − frame.delta_time and projected by the previous VP — swaying canopies finally write real motion.
  • grass (file + the inline copy in main.ts, kept in sync per the SH-005 note): per-blade sway one frame back.
  • All writes use the ABI's abi_motion_vector (core-path NDC-delta × 0.5 convention).

Compatibility

Older engine libs compile these shaders unchanged (prev_view_proj/prev_mvp always existed in the ABI) — object motion just reads zero there. With engine #82 the object half becomes real too.

Validation

Smoked at 4K with wind active: clean render, no smear/warp (a wrong velocity sign is immediately visible under TAA as tearing on swaying geometry). Quantified shimmer comparison (frame-diff metric at the audit's S7 strafe pose, before/after) is the follow-up measurement once both PRs merge into one build.

Round-2 audit F8: every world material wrote velocity = (0,0), so TAA's
motion-adaptive clamp never engaged for terrain / building / trees /
grass — the primary mechanism behind TSR-0.5 shimmer on thin grass and
sway ghosting. With the engine half (Bloom-Engine/engine PR #82:
per-slot prev transforms + abi_motion_vector), the four world
materials now output real motion vectors:

- terrain.wgsl / building.wgsl: static geometry — previous clip =
  view.prev_view_proj x world (pure camera reprojection).
- tree.wgsl: wind sway re-evaluated at frame.time - frame.delta_time,
  projected by the previous VP — sway finally moves the velocity
  buffer instead of ghosting through TAA at velocity 0.
- grass_instanced.wgsl + the inline copy in main.ts (kept in sync,
  as the SH-005 note requires): per-blade sway one frame back.

All velocity writes go through the ABI's abi_motion_vector (the core
path's exact NDC-delta x 0.5 convention).

Requires the engine lib from PR #82 (older libs compile these shaders
fine — prev_view_proj and prev_mvp always existed in the ABI — but
prev_mvp was filled with the current mvp there, so object motion would
read zero; camera reprojection works either way).

Smoked at 4K on the live game: all four materials compile and render
clean with wind sway active — no smearing or warp, which a wrong
velocity sign/scale would show immediately under TAA.
@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: b39ac71a-88f9-4e77-a001-33f8f6e7c60d

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/round2-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 (#5). 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