Add option for Nearest Neighbor filtering #438
Merged
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.
Gamescope offers nearest neighbor filtering with
-n
. This PR adds the option to enable nearest neighbor filtering in the Gamescope menu. The difference is minor between the two, and FSR is probably more desirable in most situations I imagine.I feel Integer Scaling and Nearest Neighbor are loosely related, so I put them together in the UI, code (hence the re-ordering of
GSARR
) and the language files. I didn't do this with #434 as I felt FSR is a different "kind" of technology that's kept separate. I can move it if desired :)I investigated to find any technical differences between nearest neighbor and integer scaling, I wanted to make sure they were entirely different before continuing. I didn't find much, so I decided to dive into some testing and comparisons to see for myself 馃槃
Testing
Gamescope Arguments Priority and Behaviour
I tested by launching Gamescope outside of SteamTinkerLaunch, with
-i
and then-n
to check for differences. And indeed there was! If you pass-i
,-n
, and-U
(for Integer Scaling, Nearest Neighbor and FSR respectively) it seems the option passed last takes priority. So if runninggamescope -i -U -n -- supertuxkart
, Nearest Neighbor (-n
) would be used. Related, if you pass-n
and then pressSuper+U
to enable FSR, and then again to disable FSR it goes back to Nearest Neighbor. The same applies when going from Integer Scaling (e.g., passing-i
) to Nearest Neighbor (Super+N
); it will go back to using Integer Scaling once Nearest Neighbor has been disabled.With how
GSARR
appends Gamescope arguments, the priority for Gamescope arguments will be Integer Scaling, Nearest Neighbor and FSR. Following from discussion in #434, I plan to add this information to the wiki, but will wait for decision on this PR in case information from here needs included.SuperTuxKart (Native Linux) - No SteamTinkerLaunch
Here is a comparison of SuperTuxKart, running with Gamescope's default internal resolution of 720p and fullscreened on a 4k display. I launched using
gamescope -n -- supertuxkart
andgamescope -i -- supertuxkart
. The image is PNG to preserve as much quality as possible for detailed comparison. The difference, I think, is most visible on text.DuckTales Remastered (GE-Proton7-9) - SteamTinkerLaunch
Here is another comparison, this time running the Steam game DuckTales Remastered using this PR's Nearest Neighbor checkbox. I ran with and without STL to show how it should look normally, and then how it looks with this PR to demonstrate it in action 馃槃 Zooming in on the "DuckTales" title image shows the difference, though to me I did not really see much of a difference.
Scaling up from 720p to 4k is quite the extreme example but my hope is that it demonstrates the difference between the two, and the justification for making this PR. The
-n
flag was recently updated to use-i
for Integer Scaling as per a Gamescope update (#435). This PR will bring back the option to use the-n
flag for those that were using the filtering method.Lots of background here, hopefully it justifies the logic for the feature 馃槃 As always, feedback is welcome! Still learning the ropes with shell scripts.