Meet the modder who hacked AMD’s new upscaling technology into Cyberpunk 2077

Meet the modder who hacked AMD’s new upscaling technology into Cyberpunk 2077

Earlier this week, news broke of a modder who hacked AMD’s FSR 2.0 temporal upscaling technology into Cyberpunk 2077, allowing users of non-RTX graphics cards to play the game at higher frame rates with significantly better visual quality than with FSR 1.0 upscaling. That’s huge for owners of AMD GPUs, and the mod even works beautifully on Steam Deck.

We caught up with the mod’s creator, the brilliantly named PotatoOfDoom1337, to find out exactly how it works – and whether that means FSR 2.0 will soon be available in a ton of existing games. Here is the interview, lightly edited for clarity. Enjoy!

Alex Battaglia’s primer on FSR 2.0 showcases the feature in God of War, one of three FSR 2.0 games released.

What is your background in programming and game modding? On NexusMods it looks like you’ve only been making mods since last April?

PotatoOfDoom: I study computer science, have always been interested in the technical aspect of video games and was fascinated when I learned about projects like Reshade, Special K or DXVK. I see programming as my favorite hobby and also like reverse engineering and messing around a lot with code. I made my first Cyberpunk 2077 mod because CDPR fixed a very funny bug in the game. This annoyed me so much that I downloaded the development tools and re-implemented the bug myself. The process of making this mod got me hooked, I learned more about the game over time and started making more complex mods.

What motivated you to try hacking FSR 2.0 into Cyberpunk 2077?

PotatoOfDoom: Mainly my aging GTX 1080, some envy towards RTX users due to their exclusive DLSS technology, and curiosity about how temporary upscaling solutions work in general. Also, FSR 2.0 and DLSS were described as very similar, so I just wanted to see if it was possible.

How did you develop the mod?

PotatoOfDoom: I first started the mod a few weeks ago in anticipation of the FSR 2.0 open source release. The first steps were to get the game to talk to my custom .dll and tell the game that it supports DLSS and report the available DLSS resolutions to the game by implementing the necessary interfaces. Then I wrote a small shader that just shows a blank red image. My goal was to use this as a base to verify that the DirectX parts of my code were working correctly. Then I just waited for the open source release. After AMD released the source code, I immediately replaced my test code with FSR 2.0. I expected to work on it for several days, but was pleasantly surprised that it only took me a few hours to integrate. I used debuggers like x64dbg and reverse engineering software like IDA and Ghidra to find the specifics of the DLSS behavior in the game code. RenderDoc was also incredibly helpful for debugging the buffers.

See also  I Tried TikTok's Claw-Clip Ponytail Hack: See Photos

Please enable JavaScript to use our comparison tools.

This is how the mod looks in action in Cyberpunk 2077 and Dying Light 2, compared to DLSS, FSR 1.0 and native 4K.

Were there any surprises in terms of things being harder or easier to achieve?

PotatoOfDoom: The main input buffers for DLSS and FSR are the same. I basically just copied the FSR integration from the AMD example, set the FoV/Depth values, launched the game and immediately got a pretty decent image. The worst was a quirk in Cyberpunk where the game wouldn’t reset a special DirectX structure (ComputeRootSignature) after running DLSS. This is not so important for Nvidia’s DLSS since it uses CUDA, but unfortunately FSR uses regular DirectX computer shaders, which break the game. So I had to find a way to recover that structure after running FSR.

Regarding the implementation of FSR 2.0 CP2077, what is currently working well and what needs to be fixed?

PotatoOfDoom: Ghosting and animated textures are the biggest issues right now. Both DLSS and FSR use separate masks to give the algorithm hints to reuse old temporal material or discard it, but they don’t seem to be compatible and I need to create a shader that translates the DLSS masks to FSR masks.

DLSS and FSR masks… are they similar to a Photoshop mask?

PotatoOfDoom: Yes, basically like that. You can imagine them as a grayscale image with values ​​from 0.0 to 1.0, and the temporal upscaler reprojects old frames depending on those values. The FSR documentation goes into this in more detail.

Here is a visual example. I threw an incendiary grenade on the street and as you can see there is nothing in the motion vectors or in the depth buffer. That’s because neither the 2D fire texture nor the spark particles have a 3D representation in the game. To ensure that the small sparks do not cause ugly traces, they are masked in the InputBiasColorMask so that the reprojection algorithm ignores those pixels and does not reproject anything in that place.

Do FSR 2.0 and DLSS have similar requirements in terms of what inputs they require?

See also  Online Gaming Safety Children Children User Data Cyber ​​Stalking Harass Parental Controls Meity Government It Rules

PotatoOfDoom: Yes, otherwise this mod wouldn’t be possible. Both integrations need color, motion vectors and a depth buffer as input. In addition, they use the masks I mentioned earlier. They are very important for things that don’t have motion vectors, like particles or animated textures like smoke and computer screens in the game, and incorrect masks are the main reason ghosts appear in a game. The FSR also needs to know the FOV and the near and far planes of the depth buffer. DLSS doesn’t need that additional information (I guess it figures it out via the integrated ML algorithm).

With what you know now, how easy would it be to develop a similar solution for other DLSS games?

PotatoOfDoom: Yes I think so. I still haven’t finished this one, but if other games are similar this shouldn’t really take more than a few days per game. I’ve already done some initial testing with Death Stranding and the initial results look very good.

For example, can FSR 2.0 be added to Control, a game that is known to run extremely poorly on AMD GPUs, even with RT disabled?

PotatoOfDoom: Yes I think so. The controller was updated to DLSS 2.0, which means that the DLSS interface the game communicates with is the same or at least very similar to Cyberpunk. This is the most important part.

Given the massive public interest in the mod, what are your plans going forward? Would you be open to other developers joining the project to improve the results, or implement similar mods for other games?

PotatoOfDoom: I didn’t really expect this much interest in my mod, and if I had known, I would have prepared a little more when I hit the publish button last Thursday. I want to finish Cyberpunk first (if the real developers aren’t faster than me XD) and then move on to other DLSS games. And yes, of course I’d like other developers to join me and help me get this project out of the proof-of-concept stage faster and into something people can use. I heard that there are already people who want to port my mod to Red Dead Redemption 2.

The mod's official image is a Photoshop masterpiece - wow, such graphics.
Wow, such graphics. The mod’s official image is a masterpiece.

Would it be possible to create a drop-in DLSS replacement that works across a range of games (‘dlss2fsr’, as suggested by a Github user) or do you see it being more of a series of mods each tailored to a given game?

See also  The Vikings get an improbable 33-30 overtime win over the Bills in the game of the year

PotatoOfDoom: Only with a few compromises. It would be possible to make some kind of mod that gets the FoV and Depth values ​​from a simple ini file. This mod can work for almost all DLSS games, but the image quality may not be as good as it could be. I mean even Nvidia optimizes DLSS for certain games. For example, the first versions of DLSS had terrible ghosting in Cyberpunk, while later updates to DLSS improved the situation. I can’t speak for other games, but for example Cyberpunk accidentally sends the object ID buffer to DLSS (which is a buffer that assigns a single color value to each object in the scene). DLSS doesn’t need this buffer and can’t do anything with this information, but this allows me to improve anti-ghosting (especially when driving) tremendously. Also, the ComputeRootSignature bug I mentioned earlier is unique to Cyberpunk and makes this version of the FSR mod incompatible with other games. Every single game has some unique quirks or even bugs that make it important to optimize each game for the best experience. Obviously I can’t do something like this for every single game, but I think if there is some kind of DLSS2FSR framework, it should be possible for other developers with some programming experience to easily integrate and optimize FSR for other DLSS games.

Anything else you want to share about the process of making the mod or want people to know about?

PotatoOfDoom: I think my answers above should cover everything about the mod for now. This mod is only a few days old and is already so well received. I’m sure we’ll see plenty of exciting developments in the coming weeks. Stay tuned for more.

Exciting stuff indeed! Since this interview took place, another contributor of the ID of mnxn has adapted the mod for Dying Light 2, and I expect to see many more games supported in the next few weeks if all goes well. Thanks to PotatoOfDoom for taking the time to make the mod and talk to us!

If you’re interested in trying out the mod for yourself, you can find it on NexusMods. Installation is quite simple – replace a few files in your CP2077 directory and make a registry change. You can also follow the mod’s progress on PotatoOfDoom’s GitHub repository.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *