[PR #3439] [MERGED] TAA and TAA upscaling: sub-pixel jitter, camera motion vectors, Native to Ultra Performance #4978

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3439
Author: @spidercraft
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @ludovic111

Base: main ← Head: taa


📝 Commits (4)

  • 511eb49 TAA: a sub-pixel jitter, camera motion vectors from depth, and a history clamped to the frame
  • fa727a6 TAA upscaling: Native, Quality, Balanced, Performance and Ultra Performance
  • fc409d2 TAA: no jitter shake, and Upscaling shows only with TAA
  • d900488 Merge main into this branch after the render crate split (#3186)

📊 Changes

8 files changed (+575 additions, -72 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+25 -10)
📝 crates/horizon-client-render/src/gfx/world_post.rs (+298 -28)
📝 crates/horizon-client-render/src/graphics.rs (+68 -1)
📝 crates/horizon-client-render/src/graphics_ui.rs (+94 -28)
📝 crates/horizon-client-render/src/options_ui.rs (+1 -1)
📝 crates/horizon-client-render/src/world_post.wgsl (+76 -0)
📝 crates/horizon-client/src/game/options.rs (+6 -1)
📝 docs/graphics.md (+7 -3)

📄 Description

🤖 Opened by Claude Code.

First step toward #2922 and #1403: temporal anti-aliasing and TAA upscaling, built on the jitter and motion vectors that FSR 2/3 or DLSS would need later.

What players get

In Options → Video Settings (Horizon's graphics settings):

  • Anti-aliasing cycles Off → FXAA → TAA (taa in horizon-graphics.txt, next to fxaa).
  • Upscaling, right below it and shown only while Anti-aliasing is TAA: Native, Quality, Balanced, Performance, Ultra Performance. The world renders 1×, 1.5×, 1.7×, 2× or 3× smaller along each axis (FSR's and DLSS's ratios), and TAA rebuilds it at full size (upscaling in horizon-graphics.txt). Switching Anti-aliasing away from TAA puts Upscaling back to Native.

Both are off by default, so the vanilla look doesn't change.

How it works (gfx/world_post.rs, world_post.wgsl)

  • Jitter: each frame the world's projection is shifted by a sub-pixel offset on a Halton (2, 3) sequence, over 8 frames per output pixel (8 × ratio², as FSR does). Frustum culling, the eye position and the hand keep the unjittered projection.
  • Motion vectors: the resolve pass computes them from the depth buffer and one matrix: this frame's clip space to last frame's (reprojection, camera-relative, built in f64). It uses the nearest depth of the 3×3, so the edges of what's in front don't trail.
  • Resolve: it runs at the output size, into an Rgba16Float history that stays unjittered. For each output pixel, the pass:
    • looks the history up at the pixel's own centre with a 5-tap Catmull-Rom;
    • clamps it to the 3×3 min/max of the world pixel whose jittered sample lands nearest;
    • blends the new frame at 10%, scaled by a Gaussian of how far that sample landed. This is what keeps a still camera steady: frames change no more than with TAA off.
  • The history resets when the targets are rebuilt or after a frame without TAA. The alpha (the emissive mark for HDR) passes through.
  • It runs at the resolution scale, before the hand and HUD. It's off on the title screen and under a shader pack, which does its own. While TAA is on, the world depth is stored instead of discarded.

Known limits:

  • Motion vectors come from the camera only. Mobs, items and anything else that moves on its own relies on the clamp, so it can trail slightly. Per-object motion vectors are the follow-up.
  • In upscaled modes, textures keep the mipmap level of the smaller frame, so far blocks are softer than at Native.

Size: 637 lines of code, over the ~500 guideline. Upscaling can't ship without TAA, and about 150 of those lines are tests and docs. Happy to split it if you'd rather.

Checked

  • Unit tests:
    • the reprojection matches a camera-relative point across a moving, turning camera;
    • the Halton offsets stay inside the pixel;
    • the button cycles Off/FXAA/TAA;
    • Upscaling turns TAA on, and leaving TAA resets it;
    • the Upscaling row is hidden without TAA;
    • the settings file round-trips the new keys.
  • In game: ran it offscreen with horizon-ctl in every upscaling mode.
    • Block edges come out smooth.
    • Ultra Performance is only slightly softer than Native.
    • A shot taken mid-turn shows no ghosting.
    • With the camera still, frame-to-frame change is 0.54–0.57 against 0.55 with TAA off, so TAA adds no shake.
  • Tested by hand in the game on an RTX 5090 (Vulkan, Linux).

pr_ready (tools/pr_ready.py --quick on SpiderPC, against origin/main at fe3333f3f, 1 min 51 s)

Check Result
Scope ⚠️ 8 files, +575 −72; 637 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 408 passed (24 s)
rustfmt ✅ (4 s)
clippy ✅ (30 s)
tests: horizon-client ✅ 1289 passed (36 s)
doc tests ✅ 0 passed (16 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/3439 **Author:** [@spidercraft](https://github.com/spidercraft) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `taa` --- ### 📝 Commits (4) - [`511eb49`](https://github.com/horizon-rust/horizon/commit/511eb496298bd854d6e43465043d3ba12f83fb88) TAA: a sub-pixel jitter, camera motion vectors from depth, and a history clamped to the frame - [`fa727a6`](https://github.com/horizon-rust/horizon/commit/fa727a627a9b2ecd5f37757f945446a748f47f98) TAA upscaling: Native, Quality, Balanced, Performance and Ultra Performance - [`fc409d2`](https://github.com/horizon-rust/horizon/commit/fc409d28f40f7b5626d3ce4ef286d398e003b0a1) TAA: no jitter shake, and Upscaling shows only with TAA - [`d900488`](https://github.com/horizon-rust/horizon/commit/d900488d123f5763a5c0c4d8be07424a4c20af6b) Merge main into this branch after the render crate split (#3186) ### 📊 Changes **8 files changed** (+575 additions, -72 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+25 -10) 📝 `crates/horizon-client-render/src/gfx/world_post.rs` (+298 -28) 📝 `crates/horizon-client-render/src/graphics.rs` (+68 -1) 📝 `crates/horizon-client-render/src/graphics_ui.rs` (+94 -28) 📝 `crates/horizon-client-render/src/options_ui.rs` (+1 -1) 📝 `crates/horizon-client-render/src/world_post.wgsl` (+76 -0) 📝 `crates/horizon-client/src/game/options.rs` (+6 -1) 📝 `docs/graphics.md` (+7 -3) </details> ### 📄 Description > 🤖 Opened by Claude Code. First step toward #2922 and #1403: temporal anti-aliasing and TAA upscaling, built on the jitter and motion vectors that FSR 2/3 or DLSS would need later. ## What players get In Options → Video Settings (Horizon's graphics settings): - **Anti-aliasing** cycles **Off → FXAA → TAA** (`taa` in `horizon-graphics.txt`, next to `fxaa`). - **Upscaling**, right below it and shown only while Anti-aliasing is TAA: **Native, Quality, Balanced, Performance, Ultra Performance**. The world renders 1×, 1.5×, 1.7×, 2× or 3× smaller along each axis (FSR's and DLSS's ratios), and TAA rebuilds it at full size (`upscaling` in `horizon-graphics.txt`). Switching Anti-aliasing away from TAA puts Upscaling back to Native. Both are off by default, so the vanilla look doesn't change. ## How it works (`gfx/world_post.rs`, `world_post.wgsl`) - **Jitter:** each frame the world's projection is shifted by a sub-pixel offset on a Halton (2, 3) sequence, over 8 frames per output pixel (8 × ratio², as FSR does). Frustum culling, the eye position and the hand keep the unjittered projection. - **Motion vectors:** the resolve pass computes them from the depth buffer and one matrix: this frame's clip space to last frame's (`reprojection`, camera-relative, built in f64). It uses the nearest depth of the 3×3, so the edges of what's in front don't trail. - **Resolve:** it runs at the output size, into an `Rgba16Float` history that stays unjittered. For each output pixel, the pass: - looks the history up at the pixel's own centre with a 5-tap Catmull-Rom; - clamps it to the 3×3 min/max of the world pixel whose jittered sample lands nearest; - blends the new frame at 10%, scaled by a Gaussian of how far that sample landed. This is what keeps a still camera steady: frames change no more than with TAA off. - The history resets when the targets are rebuilt or after a frame without TAA. The alpha (the emissive mark for HDR) passes through. - It runs at the resolution scale, before the hand and HUD. It's off on the title screen and under a shader pack, which does its own. While TAA is on, the world depth is stored instead of discarded. **Known limits:** - Motion vectors come from the camera only. Mobs, items and anything else that moves on its own relies on the clamp, so it can trail slightly. Per-object motion vectors are the follow-up. - In upscaled modes, textures keep the mipmap level of the smaller frame, so far blocks are softer than at Native. **Size:** 637 lines of code, over the ~500 guideline. Upscaling can't ship without TAA, and about 150 of those lines are tests and docs. Happy to split it if you'd rather. ## Checked - **Unit tests:** - the reprojection matches a camera-relative point across a moving, turning camera; - the Halton offsets stay inside the pixel; - the button cycles Off/FXAA/TAA; - Upscaling turns TAA on, and leaving TAA resets it; - the Upscaling row is hidden without TAA; - the settings file round-trips the new keys. - **In game:** ran it offscreen with horizon-ctl in every upscaling mode. - Block edges come out smooth. - Ultra Performance is only slightly softer than Native. - A shot taken mid-turn shows no ghosting. - With the camera still, frame-to-frame change is 0.54–0.57 against 0.55 with TAA off, so TAA adds no shake. - Tested by hand in the game on an RTX 5090 (Vulkan, Linux). **pr_ready** (`tools/pr_ready.py --quick` on SpiderPC, against origin/main at fe3333f3f, 1 min 51 s) | Check | Result | | --- | --- | | Scope | ⚠️ 8 files, +575 −72; 637 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 408 passed (24 s) | | rustfmt | ✅ (4 s) | | clippy | ✅ (30 s) | | tests: horizon-client | ✅ 1289 passed (36 s) | | doc tests | ✅ 0 passed (16 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:09:19 +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#4978
No description provided.