# [Using Arm ASR in Unreal Engine](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/get-started-with-arm-asr/02-ue/)

## In this learning path

- [Introduction](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/get-started-with-arm-asr/)
- [What is Arm Accuracy Super Resolution?](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/get-started-with-arm-asr/01-what-is-arm-asr/)
- [Using Arm ASR in Unreal Engine](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/get-started-with-arm-asr/02-ue/)
- [Using Arm ASR in a Custom Engine using the Generic Library](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/get-started-with-arm-asr/04-generic_library/)
- [Acknowledgements and Licensing](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/get-started-with-arm-asr/05-get-help/)
- [Next Steps](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/get-started-with-arm-asr/_next-steps/)

## Objective
This Learning Path describes how to get started with Arm® Accuracy Super Resolution™ (Arm ASR) using an example project in Unreal Engine. It is for Unreal Engine developers who want to apply upscaling techniques to their projects. You will walk through the processes of installing Arm ASR performing some of the common setup tasks.

## Before you begin
It is recommended that you use Unreal Engine versions 5.3-5.5 through this tutorial.

## Installing the Arm ASR plugin
Follow these steps to install the Arm ASR plugin in Unreal Engine:

1. Open the Unreal Engine project you plan to use with Arm ASR.

The Third Person pack is available as an example, see below:

![Third Person pack](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/get-started-with-arm-asr/images/third_person_pack.png)
*Third Person pack*

2. Download the Arm ASR plugin by cloning the repository:
   ```
   git clone https://github.com/arm/accuracy-super-resolution-for-unreal
   ```

3. Check out the branch corresponding to your Unreal Engine version.
   The repository contains branches containing the plugin for each supported version of Unreal Engine. For example, use branch `5.5` for Unreal Engine 5.5.
   ```
   cd accuracy-super-resolution-for-unreal
   git checkout 5.5
   ```

4. From the directory for your version of Unreal Engine, copy the Arm ASR plugin into the `Plugins` folder in the game directory.

![Plugin folder](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/get-started-with-arm-asr/images/plugin_folder.png)
*Plugin folder*

![Copied Arm ASR plugin](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/get-started-with-arm-asr/images/copied_arm_asr_plugin.png)
*Copied Arm ASR plugin*

5. Navigate back to your Unreal Engine project.

6. When the pop-up window opens prompting you to build Arm ASR, select **Yes**.

![Arm ASR pop-up window](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/get-started-with-arm-asr/images/asr_popup.png)
*Arm ASR pop-up window*

## Enable and configure Arm ASR
After reopening the Unreal Engine project, ensure that the Arm ASR plugin is enabled.

1. Go to **Edit > Plugins**, search for **Arm ASR**, and make sure that it is checked.

![Verify the plugin](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/get-started-with-arm-asr/images/verify_plugin.webp)
*Verify the plugin*

![Plugin screen](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/get-started-with-arm-asr/images/plugin_screen.png)
*Plugin screen*

2. To enable Arm ASR upscaling, open **Project Settings** and set the **Anti-Aliasing Method** to **Temporal Anti-Aliasing**. 

> **Tip:** Mobile Anti-Aliasing Method is used for the mobile renderer, however this Learning Path uses the desktop renderer. For information about other available renderers, see the `README.md` in the `accuracy-super-resolution-for-unreal` repository.

![Set the Anti-Aliasing Method](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/get-started-with-arm-asr/images/change_anti_aliasing_method.png)
*Set the Anti-Aliasing Method*

3. To verify that Arm ASR is enabled and active, use the `ShowFlag.VisualizeTemporalUpscaler 1` console command.

> **Tip:** The debug views produced by this command are generated by Unreal Engine’s TAA, not directly by Arm ASR.

If Arm ASR is active, you will see Arm ASR listed as the **ThirdParty TemporalUpscaler** in the console window.

![Visualize console command](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/get-started-with-arm-asr/images/visualise_console_command.png)
*Visualize console command*

4. If Arm ASR is not shown here, use the `r.ArmASR.Enable 1` console command to enable upscaling.

![ArmASR.Enable 1 command](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/get-started-with-arm-asr/images/arm_asr_enable_command.png)
*ArmASR.Enable 1 command*

## Further Configuration Settings
You can configure Arm ASR further in two ways:

1. Using the UI:
   - Go to **Edit > Project Settings > Plugins > Arm ASR**.

   ![Configure settings using UI](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/get-started-with-arm-asr/images/ui_settings.png)
   *Configure settings using UI*

2. Through the console:
   - Type `r.ArmASR.` into the console window to see configuration options.

   ![Configuration options](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/get-started-with-arm-asr/images/configuration_options.png)
   *Configuration options*

For example, you can change the upscaling ratio by modifying the **ScreenPercentage**, through the command option `r.ScreenPercentage`. A value of `50.0` means frames are upscaled by a factor of 2.

You can configure Arm ASR’s behavior through the following plugin-specific console variables:

| Console Variable                              | Default Value | Value Range | Details                                                                                               |
|-----------------------------------------------|---------------|-------------|-------------------------------------------------------------------------------------------------------|
| `r.ArmASR.Enable`                            | 1             | 0, 1        | Enable / disable Arm ASR.                                                                              |
| `r.ArmASR.AutoExposure`                      | 0             | 0, 1        | Set to 1 to use Arm ASR’s own auto-exposure, otherwise the engine’s auto-exposure value is used.     |
| `r.ArmASR.Sharpness`                         | 0             | 0-1         | If greater than 0 this enables Robust Contrast Adaptive Sharpening Filter to sharpen the output image. |
| `r.ArmASR.ShaderQuality`                     | 1             | 1, 2, 3     | Select shader quality preset: 1 - Quality, 2 - Balanced, 3 - Performance.                             |
| `r.ArmASR.CreateReactiveMask`                | 1             | 0-1         | Create the reactive mask.                                                                               |
| `r.ArmASR.ReactiveMaskReflectionScale`       | 0.4           | 0-1         | Range from 0.0 to 1.0, scales the Unreal Engine reflection contribution to the reactive mask.         |
| `r.ArmASR.ReactiveMaskRoughnessScale`        | 0.15          | 0-1         | Range from 0.0 to 1.0, scales the GBuffer roughness for the reactive mask.                           |
| `r.ArmASR.ReactiveMaskRoughnessBias`         | 0.25          | 0-1         | Range from 0.0 to 1.0, biases the reactive mask value with the GBuffer roughness.                    |
| `r.ArmASR.ReactiveMaskRoughnessMaxDistance`  | 6000          | -           | Maximum distance for using material roughness to contribute to the reactive mask.                     |
| `r.ArmASR.ReactiveMaskRoughnessForceMaxDistance` | 0             | -           | Enable to force maximum distance for using material roughness.                                         |
| `r.ArmASR.ReactiveMaskReflectionLumaBias`    | 0             | 0-1         | Range from 0.0 to 1.0, biases the reactive mask by the luminance of the reflection.                   |
| `r.ArmASR.ReactiveHistoryTranslucencyBias`   | 0.5           | 0-1         | Range from 0.0 to 1.0, scales how much translucency suppresses history.                               |
| `r.ArmASR.ReactiveHistoryTranslucencyLumaBias`| 0             | 0-1         | Range from 0.0 to 1.0, biases the translucency contribution by the luminance of transparency.        |
| `r.ArmASR.ReactiveMaskTranslucencyBias`      | 1             | 0-1         | Range from 0.0 to 1.0, scales contribution translucency makes to the reactive mask.                  |
| `r.ArmASR.ReactiveMaskTranslucencyLumaBias`  | 0             | 0-1         | Range from 0.0 to 1.0, biases the translucency contribution by the luminance of transparency.        |
| `r.ArmASR.ReactiveMaskTranslucencyMaxDistance`| 500000        | -           | Maximum distance for using translucency to contribute to the reactive mask.                          |
| `r.ArmASR.ReactiveMaskForceReactiveMaterialValue` | 0        | 0, 1        | Force the reactive mask value for Reactive Shading Model materials.                                   |
| `r.ArmASR.ReactiveMaskReactiveShadingModelID`| MSM_NUM       | -           | Treat specified shading model as reactive, using the value to write into the mask.                    |

## Next steps
You are now ready to use Arm ASR in your Unreal Engine projects. You can use [Arm Performance Studio](https://developer.arm.com/Tools%20and%20Software/Arm%20Performance%20Studio) tools to measure the performance of your game as it runs on a mobile device, allowing you to monitor the effect of Arm ASR.
