PotatoOfDoom / CyberFSR2

FidelityFx Super Resolution 2.0 for Cyberpunk
MIT License
620 stars 67 forks source link

idea: rebrand as a drop in replacement for DLSS #2

Open gabboman opened 2 years ago

gabboman commented 2 years ago

as stated in the mod description, in THEORY could be used in other games.

Here is the idea: rebrand the project as a "dlss2fsr". once its stable. Maybe now is the time of doing that instead of more down the road when there are cyberpunk specifick hacks.

is this idea crazy?

regards

a guy who has no clue on gamedev and is actually a web developer

PotatoOfDoom commented 2 years ago

No, your idea is not that crazy. Actually, I've thought of something like that myself. I just need the time and access to the other DLSS games to actually do it. Still, I'm going to have to tweak the project for every single game anyways, so it doesn't really matter if I start with cyberpunk or any other game. Odds are I'll be able to use code and findings from cyberpunk for other games.

Deus-nsf commented 2 years ago

Your project is literally DXVK, but for FSR 2.0, this has the possibility to gain a lot of momentum, I completely endorse the idea to evolve this project into a bigger thing. Doing game specific tweaks seems unavoidable yeah, but DXVK does it as well, there isn't a very huge list of DLSS 2.0 games though, and even less that really benefits from it.

GabrielSVieira97 commented 2 years ago

I can't wait to see in other games. You are the best. I can finally play cyberpunk with my GTX 1660 super and my 4k monitor.

Daist commented 2 years ago

Totally agree, would be great to see it in other games like Metro Exodus.

p0ryae commented 2 years ago

I vouch. If this mod globally works on most games with DLSS support then this project will be a big one for sure!

mnxn commented 2 years ago

I am very happy to report that I successfully got this mod working with Dying Light 2 (changes, download).

I'll describe some of my findings here (I apologize for the large comment):

I'm not familiar enough with the DLSS API to know if these parameters are a standard way to check for and use DLSS, but adding them does not interfere with the parameters that Cyberpunk uses. If the goal is to support as many DLSS games as possible, investigating and implementing the parameters that different games use is an important part of the process.

I tried to implement ViewMatrixHook in the same way as it is done for Cyberpunk2077.exe, but unfortunately quickly ran into some difficulties. Although I could find the vertical field of view value in the game's memory, I couldn't get a static address to it or find the near/far plane values at all. Luckily, from my testing it seems that these values are not as important as I expected (at least in Dying Light 2).

If using fixed values like these works for most other games, it would be possible to provide suitable defaults for the ViewMatrixHook functions and only access the game's memory for the actual values if necessary. To do that, the mod would need to check the output of GetModuleHandleW to make sure it's not zero before dereferencing a possibly invalid memory address on the next line.

I hope some of the information here will be useful for anybody trying to get FSR 2.0 working in other games. In the meantime, I'll try to send PRs for some of the fixes and changes. I too hope that this can be a drop-in replacement for DLSS in the future.

Finally, I want to thank you directly, @PotatoOfDoom, because you made it possible for me to run both Cyberpunk 2077 and Dying Light 2 with better performance and minimal quality loss. I appreciate that both AMD's FSR 2.0 and this mod is open source as it makes it possible to add better upscaling to these games when the game developers haven't done so already.

PotatoOfDoom commented 2 years ago

@mnxn First of all, thank you for your contributions. I agree with your first 2 points and have already merged your PRs. Regarding the ViewMatrixHook thing: I know it is really a barebones solution right now and nothing really substantial. I didn't touch it yet because I want to refactor the entire codebase anyways.

I think another solution for now would be to put the ViewMatrixHook values into an ini file next to the dll. That should make editing depth and fov easy enough for users until someone with cheatengine knowledge properly fetches those values.

mnxn commented 2 years ago

An ini file is an excellent idea and I can't believe I didn't mention it. Some users on Nexus have also expressed interest in tweaking other settings for the upscaling, so an external configuration file is definitely the way to go.

ABagOfPotato commented 2 years ago

Just thought I'd chime in, thanks to @mnxn using their version it appears to also work in Guardians of the galaxy! There is some weird artifacting but it definitely works!

Edit: Should point out that the artifacting was using Ultra Performance mode, and it doesn't seem to be present in higher qualities, at least not the the same effect.

GabrielSVieira97 commented 2 years ago

@ABagOfPotato did you tried on other games as well?

Xer0o commented 2 years ago

@GabrielSVieira97 Metro Exodus Enhanced Edition

GabrielSVieira97 commented 2 years ago

Okay. So far, in my tests, GTX 1660 super, 4k monitor. The cyberpunk works very well, the @mnxn dying light mod I tested in Marvel's Guardions of the galaxy and it's pretty good too, except for the ultraperfomance mode that does not work. The red dead mode is really bad in my game, tooo much flickering, at least for now, in any mode. Didn't test dying light or metro exodus, cause I don't have thoses games, but I did tried the @mnxn one in control, it does work, but bad, too much ghosting in that game, probably cause of the way of the game. But it's a blessing seeing this works in games, hope you guys keep working. I apreciatte a lot!! Thanks.

mnxn commented 2 years ago

Now that #11 is merged and this version of the mod supports multiple games, I think the project can start rebranding.

@PotatoOfDoom: what do you think?

GabrielSVieira97 commented 2 years ago

@mnxn @PotatoOfDoom It would be awesome to have some guide or video to "noobs", like me, on how to use the ini file corretctly in others gamers. Or maybe some list were people can post the values that they are using in others games. Thanks anyway 😃.

AkiraJkr commented 2 years ago

What about IU2FSR? 🤷 Image Upscaler to FSR?

koffiato commented 2 years ago

We probably should create a compatibility chart too. I just tried Death Stranding Director's Cut and Master branch works.

koffiato commented 2 years ago

Found this, might be useful. I don't know who the source is, though. https://docs.google.com/spreadsheets/d/1XyIoSqo6JQxrpdS9l5l_nZUPvFo1kUaU_Uc2DzsFlQw/edit?disco=AAAAdL7GHNM#gid=0

TheRazerMD commented 2 years ago

@koffiato that's the official spreadsheet pinned on the Discord server. It's by @AkiraJkr

koffiato commented 2 years ago

@TheRazerMD we should incorporate this into readme for easy access. I already created a PR and this'd be a good addition imo