Home » Blogs » AMD FSR 2 in Unity URP

Integrating AMD FidelityFX™ Super Resolution 2 (FSR 2) into Unity URP

GPUOpen
GPUOpen

The home for games and graphics developers. Discover how our open source tools, SDKs, and effects can help you find your best graphics performance. Learn tips and tricks with our extensive tutorials and samples.

​ AMD FidelityFX Super Resolution 2 (FSR2) is an open source, high-quality solution for producing high resolution frames from lower resolution inputs. FSR2 uses temporal feedback to reconstruct high-resolution images while maintaining and even improving image quality compared to native rendering. ​ FSR2 can enable “practical performance” for costly render operations, such as hardware ray tracing. ​

Version

​ While this patch targets URP 12.1.7 in particular, you can still use this patch for other versions (including newer) with a few careful changes. Note that this version of the patch supports DX11 only. ​

Integration method

  1. Apply 0001-Added-FSR2-support-for-URP.patch to your local URP repository.
    • If you can’t use git apply <path to patch> directly due to your own modifications, merge this patch into your local code manually.
  2. Apply 0001-fsr-2.2-dx11-backend.patch to FidelityFX-FSR2 @v2.2.1.
  3. Follow the build instruction from here to compile the FSR 2 API library.
    • For DirectX® 11, you should run GenerateSolutionDX11.bat instead of GenerateSolutions.bat to get the Visual Studio® solution file (.sln).
  4. Generate the VisualStudio solution (.sln) file with CMake for the plugin.

Generate VS sln

  • UNITY_PLUGINAPI_INCLUDE_DIR: Unity plugin API include directory.
  • FFX_FSR2_API_INCLUDE_DIR: FSR 2 API include directory.
  • FFX_FSR2_LIB_DIR: FSR 2 link library directory.
  • FSR2_BACKEND: Set the backend. NOTE! Currently only dx11 is supported.
  • FSR2_UNITY_PLUGIN_DST_DIR: Destination directory for compiled fsr2-unity-plugin[d].dll. ​
  1. Add FSR2Feature into your URP renderer data.Add FSR2Feature

  1. Choose FidelityFX Super Resolution 2.0 as your Upscaling Filter and turn off MSAA. ​Choose FSR2

  1. Add FSR2PassControl to GameObject where it has a camera, and you want use FSR 2 to upscale the output of that camera. ​FSR2PassControl

  • Disable all the anti-aliasing methods applied to this camera.
  • Disable any post effects, e.g. Panini Projection, that cannot be used on the same camera with FSR 2. Try to use multi-cameras and put the effect on a different camera.
  • If you want FSR 2 to automatically generate reactive mask for you, you should make sure Output Reactive Mask is checked. Otherwise, you should provide your own masks with ReactiveMaskParameter.OptReactiveMaskTex and ReactiveMaskParameter.OptTransparencyAndCompositionTex.

More information

​ To find out more about FSR 2, please visit our AMD FidelityFX FSR 2 page on GPUOpen.

This plugin is developed by AMD and is distributed subject to the MIT license. For more information about the plugin, FSR, or if you have any support questions, please visit GPUOpen.

“Unity”, Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere.

DirectX and Microsoft are registered trademarks of Microsoft Corporation in the US and other jurisdictions.

GPUOpen
GPUOpen

The home for games and graphics developers. Discover how our open source tools, SDKs, and effects can help you find your best graphics performance. Learn tips and tricks with our extensive tutorials and samples.

Enjoy this blog post? If you found it useful, why not share it with other game developers?

You may also like...

Getting started: AMD GPUOpen software

New or fairly new to AMD’s tools, libraries, and effects? This is the best place to get started on GPUOpen!

AMD GPUOpen Getting Started Development and Performance

Looking for tips on getting started with developing and/or optimizing your game, whether on AMD hardware or generally? We’ve got you covered!

GPUOpen Manuals

Don’t miss our manual documentation! And if slide decks are what you’re after, you’ll find 100+ of our finest presentations here.

AMD GPUOpen Technical blogs

Browse our technical blogs, and find valuable advice on developing with AMD hardware, ray tracing, Vulkan®, DirectX®, Unreal Engine, and lots more.

AMD GPUOpen videos

Words not enough? How about pictures? How about moving pictures? We have some amazing videos to share with you!

AMD GPUOpen Performance Guides

The home of great performance and optimization advice for AMD RDNA™ 2 GPUs, AMD Ryzen™ CPUs, and so much more.

AMD GPUOpen software blogs

Our handy software release blogs will help you make good use of our tools, SDKs, and effects, as well as sharing the latest features with new releases.

AMD GPUOpen publications

Discover our published publications.