mirror of
https://github.com/FelipePrado0/SpartanPort.git
synced 2026-11-07 10:45:59 -10:00
One package on top of upstream main (d7645860). Upstream's FSR 3.1, FSR 4 and FSR 4.1 are not
changed; everything below is either new or gated behind its own setting.
1. Anti-aliasing: FXAA and SMAA 1x of the finished frame
- New host pass (host_passes/aa_pass.cpp, fxaa.comp, smaa.comp, SMAA reference implementation by Jimenez et al.
with its licence, smaa/LICENSE.txt). It runs on the final image, so it also touches the HUD slightly.
- Launcher: "Anti-aliasing" row (Off / FXAA / SMAA) on the Graphics page, `anti_aliasing` in
spartanport.ini (Rust launcher and the legacy Python one); Insert menu: Anti-aliasing row with a
live "not active" note when the graphics card cannot set it up.
- The pipeline cache is keyed by the guest multisampling mode: a cache built with MSAA is rebuilt
when the mode differs (vk_pipeline_serialization.cpp), instead of loading incompatible pipelines.
- Tests: tests/test_aa_pass.cpp (runs the production AA pass on a Vulkan device, optionally under
validation), launcher settings and snapshots.
2. TAA for God of War III (upscaler=taa, "Native AA")
Why this exists although a TAA was being worked on upstream: the game's frame is not the 5-target
G-buffer layout the generic path expects. It has a depth pre-pass without a colour target, a
material pass drawing with that depth, no engine motion vectors and no jitter, and its 30 fps scenes
are shown by 60 Hz display passes. A TAA that works needs to know the frame, so this one is built
on an analysis of it (docs/upscaler.md, "God of War III Remastered layout"):
- The scene, not the display pass, is the frame: it opens at its first pre-pass draw and closes at
the composite; repeated display passes no longer reset the history or the jitter.
- Camera: the main camera is found by content as a view-projection matrix in the pre-pass vertex
constants (camera_view_projection.h, tests/test_camera_vp.cpp); motion vectors come from
previousVP * inverse(currentVP) through the game's viewport and depth range
(camera_motion_vp.comp).
- One Halton(2,3) jitter per scene, applied as a viewport offset to the draws that use the scene
depth; screen-space quads are not shifted.
- taa.comp: unjittered current colour, Catmull-Rom history, depth rejection, variance clipping in
tonemapped YCoCg. Characters have no motion vectors, so a 3x3 patch that changed against the
history loses history (needs a changed neighbour in the previous frame, which halved the flicker
of a still picture in the simulator), and refused pixels get an edge-directed spatial smoothing.
- A negative texture mip bias on the scene's material draws, and a sharpening pass after the
accumulation (the RCAS pass the port already has, taa_sharpen.comp).
- The defaults are the optimized ones, tuned in game on a GTX 1070 Ti. Every setting is a slider
in the Insert menu (Image > "TAA look"): history on still / moving picture, colour tolerance,
moving objects, texture detail, moving object edges, sharpening and a history debug view, so
anyone can adjust the TAA to their taste.
- Guest MSAA is turned off for the TAA (the cache profile records that); TAA is selectable in the
launcher under Upscaler. It was tested on a GTX 1070 Ti; DLSS and RTX cards were not tested.
3. FSR 3.1 with native HUD and text (upscaler=fsr3ui), next to upstream's FSR 3.1
- Upstream's FSR 3.1 is unchanged. With the Native AA preset the launcher patches the render size to
1918x1078, so the HUD, text and loading screens are drawn at that size and stretched, which
smooths them. The new "FSR 3.1 (native HUD and text)" keeps the game's own 1920x1080 targets (the
live path the TAA uses) and runs FSR after the composite, before the HUD, so HUD, text and
loading screens stay untouched.
- It has its own sharpening (the Sharpening (RCAS) switch and strength, with an extra pass above
FSR's maximum); upstream's FSR keeps upstream's sharpening.
- Two sliders in the Insert menu (Image > "FSR 3.1 look"): Texture detail (`fsr_lod`) and Moving
objects (`fsr_objects`, the strength of the stencil reactive mask).
- Trade-off: the game composites straight into the display buffer at 1920x1080, so FSR has to run on
the finished 8-bit frame instead of the earlier scene colour. That keeps the HUD sharp and costs a
slight drop in scene quality compared with the patched FSR 3.1. It is a separate choice so the
maintainer can keep it, rework it or fold it into the existing FSR path.
4. Czech
- Complete Czech translation of the launcher (UI, extra strings, trophies) and of the Insert menu,
with the language picker entries. The new Insert menu texts also have Simplified Chinese; the
other languages show English for the TAA / FSR 3.1 slider texts until translated.
Also: a Motion blur row in the Insert menu, a log line for the upscaler's sharpening state, docs/upscaler.md
and updated launcher snapshots.
Tests: cargo test (launcher, 791 + integration), tests/test_ui_language.cpp, test_graphics_settings,
test_upscaler_support, test_aa_pass, test_camera_vp. The GPU code is built by CI (Windows zip).
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XtU1iHgWpXde4Af9YrW3Y6