Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for Nearest Neighbor filtering #438

Merged
merged 1 commit into from
Mar 31, 2022
Merged

Add option for Nearest Neighbor filtering #438

merged 1 commit into from
Mar 31, 2022

Conversation

sonic2kk
Copy link
Owner

@sonic2kk sonic2kk commented Mar 30, 2022

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 :)

Screenshot-20220330-193920.png

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 running gamescope -i -U -n -- supertuxkart, Nearest Neighbor (-n) would be used. Related, if you pass -n and then press Super+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 and gamescope -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.

supertuxkart-nearest-neighbor-left-and-integer-scaling-right.png

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.

ducktales-nearest-neighbor-left-and-integer-scaling-right.png

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.

@frostworx
Copy link
Collaborator

Wow, impressive description! 馃憤 (you're always very welcome to rewrite the whole wiki 馃榾)
Thanks a lot, again for your contributions!

Found a typo in your translation changes: GUI_GSNN="Nearest Neighbour"
would be great if you'd fix it, before I merge it.

@sonic2kk
Copy link
Owner Author

sonic2kk commented Mar 31, 2022

Ah! Should be fixed now, sorry for the embarrassing typos 馃槄

I'm not on my PC at the moment but I can update the wiki with a corrected screenshot and information over the weekend (fingers crossed 馃)

EDIT: I forgot one of the language files, force-pushed an update. Now it should be fixed 馃槃

@frostworx
Copy link
Collaborator

wow, that was fast! thanks a lot! :)
No hurry with the wiki, but of course it would be great if you really wanted to update it :)

@frostworx frostworx merged commit 5585ce2 into sonic2kk:master Mar 31, 2022
@sonic2kk sonic2kk deleted the gamescope-nearest-neighbor branch June 1, 2022 18:22
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.

None yet

2 participants