[GitHub]
Hey all,
These past few months I have been working independently on researching FidelityFX Super Resolution 2 (or FSR2 for short) and seeing if I could make it work within Unity. My goals were rather specific: I wanted to make it work with Unity’s built-in render pipeline, Post-Processing Stack V2 and the older DX11 graphics API, as well as on Mac, Linux and consoles.
When starting out I had no idea if this was possible at all. After all, FSR2 is generally associated with more modern PC graphics APIs (DX12 and Vulkan) and more advanced rendering pipelines. My particular needs were the driving force for how I approached this project and they called for some unorthodox solutions. I was half-expecting to run into some insurmountable roadblocks and having to give up halfway through, but to my pleasant surprise I managed to make FSR 2.2 work, in Unity, on the built-in render pipeline, with DX11 and even on Linux, MacOS, and both 8th gen and 9th gen consoles. And the results are rather spectacular:
Compared to the standard post-process anti-aliasing methods offered by Unity (FXAA, SMAA and TAA), FSR 2.2 produces a much sharper and cleaner picture, with better sub-pixel detail resolution, far less temporal shimmering and no unsightly ghosting artifacts in fast motion. In addition to that, because FSR2 upscales from lower internal rendering resolutions, you will see improved framerates even when compared to having no AA. This is a major boon for games that are GPU-bottlenecked, as it will improve both image quality and performance.
While I did work on FSR2 for Unity with a specific game in mind (more on that later), I developed this plugin as a standalone project with the intention of open sourcing it and allowing anyone to play around with it. And so that is what I’m doing now: the source code of FSR2 for Unity is available on GitHub right now, licensed under MIT meaning you are free to do whatever you like with it. More details on how this implementation works can be found on the GitHub page.
Right now this project only offers an integration with the built-in render pipeline. The core FSR2 implementation however is render pipeline-agnostic, so there’s nothing stopping anyone from building a URP or HDRP integration based on the same core classes.
I have also been testing this with Unity’s Post-Processing Stack V2 (PPV2) to make sure the two play well together. While this does work, the setup is not ideal yet: PPV2 currently has to run entirely before FSR2 which works fine for most effects, but ideally effects like bloom, depth of field and motion blur should be applied after FSR2’s upscaling. It still produces rather nice results though:
I have spent some time trying to adapt FSR2 into a PPV2 post effect, but it seems PPV2’s framework is a bit too rigid to make this work well. The way I’m looking at it now, I think the best way forward would be to modify PPV2 itself and customize it to make it upscaling-aware, to add FSR2 as an alternative anti-aliasing method, and to split the existing built-in effects into before- and after-upscaling steps. This is something of a project in itself, but I hope to look into this in the near future.
Update: Full integration with PPV2 is now available too. This is the recommended way of combining FSR2 with PPV2. More details in the post below.
As I mentioned, I worked on this project with a specific game in mind and I have been collaborating with its creators over the past couple of months to integrate FSR2 into that game, after demonstrating my initial results. I cannot divulge right now which game that is, but rest assured that this implementation is already being battle tested. Hopefully within the next few weeks I can tell you which game it is and I’ll also be able to show you better comparison pictures.
Update: The game in question is Isonzo, more details and screenshots in the post below.
Before anyone asks, I am aware of what The Naked Dev is working on and it is not my intention to ‘compete’ with or in any way undermine what they’re doing. I felt justified in working on my own project because my priorities (focus on built-in render pipeline, DX11, Mac, Linux and console support) did not appear to align entirely with what they’re committing to, at least not initially. I also couldn’t be sure if their approach to integrating FSR2 into Unity would work for the game I had in mind. You should see my project more as a tinkerer’s version of FSR2 for Unity; if you’re not afraid to get your hands dirty and adapt it to work for your particular application, then you might find a good starting point here. If you’re looking for something more plug-and-play, more polished and with a better guarantee of long-term support, then you will want to keep an eye on TND’s project. The way I see it, having more options available is never a bad thing.
Update: The FSR Upscaling asset from The Naked Dev migrated from a native plugin solution to make use of my open source tech shortly after its release, so their asset now combines the best of both worlds!
Have fun picking this apart! I’m looking forward to seeing all of your reactions.