Repository navigation
Conversation
Resolution 2x-8x (and any render size above the window's) was shrunk with one bilinear tap: at 3:1 each window pixel took 1 of the 9 game pixels it covers, so edges, the HUD and text aliased and crawled like native resolution. The upscalers only run when upscaling, so nothing else filtered it. The present shader now averages every game pixel a window pixel covers, area weighted (fractional ratios too), in linear light, clamped to the shown rect. At 1:1 or below it keeps the single tap. Both backends share the code (present_area.h); frame interpolation's in-betweens go through the same pass. LARECOMP_PRESENT_AREA=0 turns it off for A/B tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
When the game renders larger than the window (Resolution 2x-8x, or any render size above the window's), the present pass now averages every game pixel a window pixel covers, instead of taking one bilinear tap.
Before, at 3:1 (4x into a 2560x1440 window) each window pixel kept 1 of the 9 game pixels it covers, so edges, the HUD and text aliased and crawled like native resolution. 2:1 happened to average 2x2; 4:1 kept 4 of 16. The upscalers (MetalFX, FSR 1) only run when upscaling, so nothing else filtered it.
How
runtime/nvn/present_area.h(new): the shared shader snippet and its constants. Area weights per texel, so fractional ratios (3x into 1440p = 2.25:1) stay correct; averaged in linear light (sRGB decode, average, encode) so thin bright lines keep their brightness; clamped to the shown rect (interior crop, Dynamic's content part).present_srcinmetal.m;compose()passes the ratio inpf.yz. Frame Generation's in-betweens go throughcompose()too.present.fraginvulkan/shaders.c;vk_present_draw()passes the ratio in the push constants (both the normal frame and the in-betweens call it).present_rcas.frag(FSR) is untouched.LARECOMP_PRESENT_AREA=0: the old single tap, for A/B shots (added todocs/debug-hooks.md).Tested
Mac (Metal, M3 Max, 2560x1440 window):
Windows (Vulkan, RTX 3080 Ti, 2560x1440 window):
Note
With averaging on, SMAA at 2x and above is mostly redundant (the average already anti-aliases the edges). Moving SMAA after the downsample (at window size) would make it cheaper there; that's a separate decision, not part of this PR.
🤖 Generated with Claude Code