sonic2kk / steamtinkerlaunch

Linux wrapper tool for use with the Steam client for custom launch options and 3rd party programs
GNU General Public License v3.0
2.12k stars 71 forks source link

[FEATURE] add new FSR resolution options #507

Closed zany130 closed 2 years ago

zany130 commented 2 years ago

see here https://github.com/GloriousEggroll/proton-ge-custom/releases/tag/GE-Proton7-24

so the whole fsr thing for proton ge has to be reworked now I guess?

EDIT: my bad fsr strength is still there and works how it did before. It seems there are now new options for forcing a resolution?

sonic2kk commented 2 years ago

It seems that way, though doesn't Wine-tkg use the "old" variable method? Just looking by the release notes on this (very old) build: https://github.com/Frogging-Family/wine-tkg-git/releases/tag/7.6.r12.g51472395

Comes with support for AMD FSR through Proton's fullscreen hack - Enable with WINE_FULLSCREEN_FSR=1 env var, and tweak sharpening amount with WINE_FULLSCREEN_FSR_STRENGTH=2 (2 is default sharpening, higher numbers mean more sharpening)

Going purely on what I've seen (my own experience and ProtonDB), GEProton is more popular than Tkg. Maybe we should have the new-style GE FSR options as a separate menu option, and only apply the GEProton variable if a user is using a version of GEProton >= GE-Proton-7-23 (I believe this is the newest version with this option, as I don't think 7-22 did looking at the changelog, it seems like it relied on a different option that has been superseded by this new WINE_FULLSCREEN_FSR_MODE).

If this stays in GE I think it would be great for STL to have this option, but given how features like this in GE can be added and reverted in short spaces of time, maybe we should wait to make sure this will be a more permanent fixture before jumping the gun? Just my thoughts though :smile:

zany130 commented 2 years ago

it seems these are additional fsr options (which seem to be not available on tkg proton yet?) fsr strength is still used

sonic2kk commented 2 years ago

Ahhh I see, so FSR strength is still used by WINE_FULLSCREEN_FSR_MODE seems like it sets resolution?

Method 1: WINE_FULLSCREEN_FSR=1 WINE_FULLSCREEN_FSR_MODE=ultra %command%

with the options of ultra, quality, balanced, performance and it will auto-add the corresponding FSR resolution in-game for your monitor resolution if supported. You then go in game, set fullscreen mode, and choose that resolution if it is not already automatically set.

It would seem like uses the default FSR strength (which I believe is 2) and this variable sets the resolution of the game (or at least attempts to), then upscales based on the strength factor (which is 2 by default but could be changed based on the still existing WINE_FULLSCREEN_FSR_STRENGTH).

Then we also have the new WINE_FULLSCREEN_FSR_CUSTOM_MODE for custom resolutions. We could also add support for this.

I'm willing to take a stab and implementing this into STL :smile: Just want to make sure I have all the info right

sonic2kk commented 2 years ago

Hmm, when trying to test this feature normally (without STL) I can't seem to get it to work :thinking: The list of resolutions for my tested games are always the same and I can't select the preset resolution for a game. Though when setting some of the ultrawide custom modes the resolution looks correct (that is, there are bars along the top and bottom) but the list of resolutions for a game is still I guess incorrect?

Maybe I'm just misunderstanding how this feature is supposed to work :sweat_smile: I was under the impression the fullscreen resolutions for the game changed.


EDIT: Tested the behaviour with my attempt at an implementation in STL and the behaviour seems to be the same whether I use STL or the launch options from Steam, so I guess my understanding of how the feature is meant to work seems to be wrong. It is still very heavily WIP (written up in the last 40 minutes so not very extensive testing yet) but if you'd like you could have a peak on my fork's branch: https://github.com/sonic2kk/steamtinkerlaunch/tree/new-fsr-options (my fork only exists for development, so this branch is the latest STL git as of writing with an extra commit for these FSR options)

So as it stands right now, the behaviour of these variables seems to be the same whether I use STL or the launch options from Steam. There are still a handful of things to investigate:

  1. I'd like a better understanding of how the behaviour is meant to work
  2. These variables seem to be automatically exported, though I'd prefer some way to be able to check if they are set to none. I'm not sure what the behaviour is if these variables are set to none
  3. The order of precedence/behaviour when both WINE_FULLSCREEN_FSR_MODE and WINE_FULLSCREEN_FSR_CUSTOM_MODE are used. My understanding is that the Mode option sets the resolution based on the current screen resolution and the option chosen (e.g., at 1440p with performance selected the game's fullscreen resolution should be 1280x170), and Custom Mode is for setting a specific preset from the list GE has (I'll probably add these as an array and put them in the dropdown for Custom Mode, while also letting users set their own Custom Mode still).

Once I understand how the implementation is meant to work and how it's meant to look, I can start debugging what happens when both of the new variables are used. IMO it would be nicer to have a check for if one is selected, ignore the other, or maybe more simply have Custom Mode override Mode.

Custom Mode overriding Mode could very well be the current behaviour but I'm not totally sure. I am just assuming that since Custom Mode's list of presets have comments beside them denoting which ones are for performance, balanced, etc, that this would supersede Mode. However it could simply be that whatever order the arguments are passed is the order that they are chosen over the other (so in STL's case, Custom Mode would always override Mode since Custom Mode comes after Mode).

I'll do some more research and testing but any more information would be welcome to help :smile:


EDIT2: So after more testing it seems like when you use WINE_FULLSCREEN_FSR_MODE it adds a new resolution (or maybe alters an existing one?) based on the value you provide, so if you're using a 2k screen and use balanced, it'll add a new resolution called 1506x847, at least the game I tested did not have this resolution if I did not pass the FSR mode variable. I have not yet found a game where this value is auto selected, and higher resolutions are also available (I can still select 1440p and have to move down to select this lower resolution).

Have not had any conclusive tests with how Custom Mode works or how it interacts with the regular Mode option. So far, it seems like when you enter a custom mode, it has to correspond to your current resolution. For example I'm using a 2k resolution but if I enter any of the Custom Mode presets for 1080p, Duck Tales Remastered says "Invalid Index!" for the current resolution and when going through the resolutions, it does not list the Custom Mode resolution. This happens with both STL and setting the variable through Steam, which is a nice sign that the implementation is working, but basically I still have to test to understand how the options work fully.

sonic2kk commented 2 years ago

So I've done some more tests, and here are my findings:

  1. Having either WINE_FULLSCREEN_FSR_MODE=none or WINE_FULLSCREEN_FSR_CUSTOM_MODE=none seems to make no difference and both options work either way, so we don't really need to check if these are set or what they are set to. If this is desirable though I guess we could come up with a way to check
  2. I'm not sure if changing the FSR strength really does anything when these options are used. I'll have to take screenshots and have a detailed look, but I would assume it still has an impact (these options seem to only affect resolution for upscaling, not the strength of the upscaling)
  3. Sometimes WINE_FULLSCREEN_FSR_MODE is set as the default resolution correctly and sometimes it isn't. At first it was never selected by default for me but in my recent tests after restarting Steam it seems to always be set as the default correctly. However, the GE instructions for GE-Proton7-23/24 do call for setting the resolution manually if it is not selected by default. So this seems to be acceptable
  4. If WINE_FULLSCREEN_FSR_CUSTOM_MODE is set to a valid value, it will always override the regular Mode option. So even when launching from Steam, if you use WINE_FULLSCREEN_FSR=1 WINE_FULLSCREEN_FSR_CUSTOM_MODE=3938x1108 WINE_FULLSCREEN_FSR_MODE=balanced %command%, the FSR Mode Balanced will be ignored.
  5. If I set FSR Custom Mode to something exotic like WINE_FULLSCREEN_FSR_CUSTOM_MODE=3938x1108, it shows up with black bars along the top of my 16:9 screen (I don't have an ultrawide to test with). But the ultrawide output resolution doesn't show up in the game settings.
  6. When setting the FSR Custom Mode resolution (even to something like the normal 2k Balanced preset, 1506x847 that shows up correctly when using the Regular mode argument) I can't get it to show up in the resolutions list. I've tested two games with this; Sonic Mania sets itself to "Default" and Duck Tales Remastered sets itself to "Invalid Index!". I can't tell with my eye if any kind of upscaling is being applied or not. I'll have to test some other games to see what resolutions they list when using, but this could be a non-issue/upstream issue.

I guess the important point for all of this is these apply with and without STL so it isn't anything specific to STL, but it could be that I'm doing something wrong, so I'll have to do some more testing and hopefully get confirmation from someone else that can test it. Once I'm confident I'll try and get a PR opened for this.


Something I'm unsure of is whether or not we should have a list for all the GE presets in STL. There are a lot of presets, but also they are intended to be used with different monitor resolutions. There are 4 custom modes for 1080p, 1440p, Ultrawide, 4k, and 32:9, making for 20 custom outputs. A user could theoretically use any of these custom modes on any resolution monitor, but that is not the intended use case.

My current idea is to include all of these resolutions, and have a section about these entries on the wiki and when they should be used, essentially quoting what is in the GE-Proton changelog. (Of course the wiki would also include all of the findings I have made for this feature, in a much more organised way :slightly_smiling_face:)

zany130 commented 2 years ago

Tbh i use FSR through gamescope (since i need gamescope anyway to help with multi monitor issues i have) instead of proton. I just noticed there was a newer version of GE and thought it changed how fsr works. I changed it to a feature request as i thought this could be useful for people who use protons fsr implementation.

Im kinda confused as well how exactly it works as well. I guess this is supposed to be similar to gamescope fsr where you can specify an internal resolution and then an upscaled one.

Instead of specifying both resolutions you only specify the internal resolution and by how much you want to up scale it (ultra quality, performance, and balance) and the strength of the sharpening.this is actually how fsr on windows works

See page 10 https://github.com/GPUOpen-Effects/FidelityFX-FSR/blob/a21ffb8f6c13233ba336352bdff293894c706575/docs/FidelityFX-FSR-Overview-Integration.pdf

Where they explain how the different upscale modes

sonic2kk commented 2 years ago

Tbh i use FSR through gamescope

Me too, though I've had a lot of trouble with Gamescope recently so I was very interested in implementing this for Proton's FSR :smile: Although interestingly I did try this with Gamescope enabled and it seems to work (I didn't try with Gamescope's FSR enabled though, having both FSR filters on would probably make the universe implode or maybe it would just make the game look a bit weird :sweat_smile:)

Instead of specifying both you only specify the internal resolution and by how much you want to up scale it (ultra quality, performance, and balance) and the strength 0f the sharpening.this is actually how fsr on windows works

Indeed, this seems to be spot on!

Where they explain how the different upscale modes

Ah, we should also link to this too on a potential wiki page. Thanks for this! So the numbers aren't completely unique to GE-Proton, that makes sense.

I tested another game (Sonic Origins) and the behaviour seems to be the same, although I did find something interesting. I accidentally launched Sonic Origins with GE-Proton7-20 and with Proton FSR enabled and the Balanced mode set, the Balanced preset resolution showed up! Although there was no upscaling as far as I could tell. Removing the Balanced mode option made the resolution disappear. Very strange and not something I'm very interested in testing right now as this feature is mainly meant to target the newer release of GE that officially lists this as an implemented feature in the changelog.

So for now the rough implementation I made seems about right. I'll tweak the code a little more and hopefully get a PR up soon :partying_face:

frostworx commented 2 years ago

WOW, you're both crazy. Sleeping one night and you create, discuss and apparently even pull request a new feature together. thank you very much both! just to make sure I haven't missed anything important. When merging https://github.com/frostworx/steamtinkerlaunch/pull/509 everything you discussed here would be resolved, right? (still need to review it, only trying to gather all facts to be up2date)

sonic2kk commented 2 years ago

Everything I mentioned here should be resolved (I know it was a bit of a mess, my tabs were a mess too haha), I tested with a handful of games and even though there were a few quirks they were unrelated to STL. Basically for Custom Mode sometimes the resolution won't be named correctly in the settings even if it's something that can be set using the Mode variable. That happens without STL too so I just put it down to GEProton behaviour 😄

Thanks for the merge as well 😄 👍

frostworx commented 2 years ago

Thanks for confirming (I don't think it was a mess though, but only thought it would be easier to find out whewn I simply ask - yes a bit lazy ;)). I'll leave it up to @zany130 to test the PR and close the issue :)

zany130 commented 2 years ago

Well like I said above I can't really test this as I can't run games without gamescope on my multi-monitor setup (I don't know why I have to disable my monitor and make my tv primary in order to launch a game without gamescope) and gamescope seems to override these options from my testing, but I was able to get it to work by disabling one of my monitors so everything looks like its working, tried both the custom resolution and the presets. Plus I think @sonic2kk did already test this so I think it's safe to close this as complete

sonic2kk commented 2 years ago

Not sure if this is just funky DOOM Eternal and/or Gamescope behaviour but I was testing out DOOM Eternal with Gamescope and it seems like it has less resolutions to choose from. I don't think this is a regression as the two variables shouldn't do anything if Wine FSR is disabled but just in case it is a regression, can anyone test if they have less resolutions to choose from in games with STL now (with or without Gamescope)? The games I tested before making the PR didn't seem to have any less, so this could be unrelated behaviour.

zany130 commented 2 years ago

hmm that is indeed strange I haven't noticed that. did you try launching the game without steamtinkerlaunch? I would also try cleaning the prefix in case it did something there but doubt it

sonic2kk commented 2 years ago

Glad to hear you haven't experienced anything (I won't lie, I panicked just a little :sweat_smile:) and you probably use GameScope a heck of a lot more than me! I was editing my first message but I'll put my experience in this message instead.

Here is the resolution list with DOOM Eternal - Gamescope + STL DOOM Eternal - Gamescope and STL

Here is the resolution list with DOOM Eternal - Gamescope + No STL DOOM Eternal - Gamescope and no STL

It seems like the 2560x1440 option is missing when using STL, and is replaced with 2259x1270 (a very odd resolution, not one that is listed in the GE-Proton presets from what I could see).

I've had a lot of strange issues with Gamescope for the last couple of months (I have an open issue for it on their issue tracker too) so this could be another oddity. I'll look into some other games and see what I can find. Hopefully it's not a regression caused by the PR and just some Gamescope weirdness on my end

sonic2kk commented 2 years ago

Okay so I tested NieR:Automata and displays the same resolutions with and without Gamescope, though it had a few problems of its own with GE-Proton7-24 (my system was really stuttery when I tabbed out without Gamescope)

Seems like there's no issue here, just either Gamescope or GE-Proton being funny :-)

Thanks @zany130, let me know if you run into any problems though :)

EDIT: Spoke too soon, I'm just blind. NieR:Automata lists more resolutions than DOOM Eternal (it goes into smaller resolutions) but it still shows that strange 2259x1270 resolution instead of 2560x1440 when using STL. Really odd.

EDIT2: So 2259x1270 is one of the FSR resolutions, it's the 4k Balanced preset. I wonder why that's being used when FSR is disabled in STL settings (I wonder if "Balanced" is the default?). I'll have to do some more tests and what's up here. I wonder if the Balanced preset shows up when I'm not using Gamescope, for me it would be the 2k Balanced preset (I use Gamescope to run games at 4k on my scaled display), so 1506x847. I'm fairly positive it didn't last night as I tested with FSR enabled and disabled through STL.

sonic2kk commented 2 years ago

So I tested Sonic Mania and DuckTales without Gamescope and indeed, with the FSR setting disabled they don't show any of the FSR preset values. So Wine FSR without Gamescope seems to work as expected. I suspect GameScope is the culprit here...

EDIT: What the heck, Sonic Mania doesn't show their preset resolutions with GameScope at 2k or 4k. This is a strange one...

zany130 commented 2 years ago

Hmm strange you could probably try installing and older commit or the stable of STL to see if that helps.

Tbh the games i been playing lately ( legend of heroes trails games i mention these games everywhere 😅) don't have resolution settings built into the game you have to use a launcher which sometimes doesn't work on proton or manually edit the resolution settings. So i would really notice even if something was wrong

I'll try a hat in time which is what I used initially to test this and see if i get any weird resolutions with STL

sonic2kk commented 2 years ago

Thanks, I appreciate it :+1:

This behaviour is really strange. Sonic Mania doesn't show that weird FSR resolution, yet NieR:Automata does but only when using GameScope and only with GameScope's resolution set to 4k. Even at 2k + Gamescope, NieR:Automata doesn't show the 2k balanced preset resolution (I triple checked this time) but NieR:Automata and DOOM Eternal always show their Balanced presets with GameScope. NieR:Automata actually shows its balanced preset without Gamescope, I don't think DOOM Eternal did though

It seems like for some reason the variable is defaulting to the Balanced preset even if Wine Fullscreen FSR should be disabled (WINE_FULLSCREEN_FSR=0)

zany130 commented 2 years ago

hmm strange I couldn't reproduce this with a hat in time shows the same resolutions with proton-ge + gamescope without STL and proton-ge + gamescope with STL. Though I did set both of the new fsr options to none. Maybe try that?

sonic2kk commented 2 years ago

I think this is an issue with STL exporting the variables wrong. I can't reproduce the behaviour without STL unless I put in the variables correctly. Even WINE_FULLSCREEN_FSR=0 WINE_FULLSCREEN_FSR_MODE=balanced %command% didn't enable the balanced preset for me.

Launching NieR:Automata without STL and WINE_FULLSCREEN_FSR=0 WINE_FULLSCREEN_FSR_MODE=none %command% produces expected results, no resolution weirdness

Launching NieR:Automata with STL and having Wine FSR unchecked, and both of the new FSR variables set to "none", will always show a Balanced preset variable (the correct one depending on whether I'm running at 2k or 4k). Even though FSR should be disabled entirely.

I guess for some reason for some of my games STL is defaulting to FSR being on now and using the Balanced Preset. I can't reproduce this with Sonic Mania or DuckTales Remastered, the two games I used for testing.

I'm gonna clear /dev/shm/steamtinkerlaunch and restart my computer, and see if I get anywhere...

sonic2kk commented 2 years ago

That didn't fix it unfortunately.

@zany130 Thanks again for testing, this is really odd. And the fact that it only affects some of my games is even stranger. Sonic Mania and DuckTales Remastered are completely unaffected for me, the only commonality between those two games is that I tested them when working on implementing the FSR features.

I'm gonna have to take a deeper dive into this and figure out what's going on

sonic2kk commented 2 years ago

Actually @zany130, if you really don't mind testing again, could you check if A Hat in Time shows the same resolutions with and without STL? Oh you already tested it, many apologies :disappointed: Thank you for testing it, I'm really not sure what's going on with my setup then...

zany130 commented 2 years ago

I was able to reproduce this in nier automata. Using STL+ proton-ge + gamescope there is no 2560x1440 resolution in the settings. No STL with proton-ge + gamescope (so the same exact settings between the two minus STL) the 2560x1440 resolution shows up

STL


Screenshot_9


No STL

Screenshot_8

this happens on the latest stable though (so before this PR) so it seems unrelated to this PR

Very strange though

sonic2kk commented 2 years ago

I tested DOOM Eternal without STL, with STL + Wine FSR disabled, with STL + Wine FSR disabled + Wine FSR at max strength, and with STL + Wine FSR enabled + Wine FSR at max strength. I can confirm that FSR is not being enabled incorrectly, however for some reason with STL, that weird Balanced preset display resolution is being added for some reason.

So FSR is not actually enabled, but now with STL for some reason that strange preset keeps showing up. I'll have to test some more without STL and see why that is, but for now it seems like my PR has caused a regression on my end

sonic2kk commented 2 years ago

this happens on the latest stable though (so before this PR) so it seems unrelated to this PR

Oh wow, that's crazy! I wonder if this is a GE bug? couldn't be a GE bug. This is so weird, I wonder what's up...

zany130 commented 2 years ago

not sure I was using GE in the screenshot where the 1440p resolution does show. I could try downgrading my proton-ge package to see

sonic2kk commented 2 years ago

Yeah I tested again with GE outside of STL and 1440p shows up for me when running with Gamescope at 4k. But when using STL it gets replaced just how your screenshots show.

I tested with Proton 7.0-3 and it behaves as expected, 1440p shows up with and without STL using Proton 7.0-3

So you're definitely using a version of STL before this PR? I don't recall seeing this behaviour before but I've also never really looked for it. It's also strange that it happens to be the FSR balanced preset.

If that's the case, I guess this behaviour can be reproduced in at least some games using GE-Proton7-24 and STL versions at least v10.0 and the latest git version of v10.0.20220701 (and maybe other versions in-between if not all of them).

Also once again, thank you so much for going out of your way to test this with me. It is much appreciated, major major kudos :+1:

zany130 commented 2 years ago

just for fun trying to see if downgrading GE does anything (doubt it) Also yeah I made sure to move my config directory to a backup folder so that there no issues there and also deleting /dev/shm/steamtinkerlaunch then Installed the non-git steamtinkerlaunch package from the aur.

also np I like troubleshooting these kinds of things have to since it happens to me on an almost daily bases. Ask frostworx I would go through periods where I open at least one 1 issue a day for a while 😂

EDIT: Im dumb forgot that STL has a handy proton version downloader so no need to build an older version and downgrade it lol

EDIT2: it seems to be a proton-ge issue (using 7.15 there are no missing resolutions) ill ask glorious egg

sonic2kk commented 2 years ago

Hmm, interesting that it doesn't affect other versions of GE. I wonder why this seems to affect 7-24 but only with STL...