Skip to content

Commit ce1c355

Browse files
committed
New LP for Arm ASR
1 parent 6da345f commit ce1c355

28 files changed

+346
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: What is Arm Accuracy Super Resolution?
3+
weight: 2
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
## Introduction
10+
11+
[Arm® Accuracy Super Resolution™ (ASR)](https://www.arm.com/developer-hub/mobile-graphics-and-gaming/accuracy-super-resolution) is a mobile-optimized temporal upscaling technique derived from [AMD's Fidelity Super Resolution 2 v2.2.2](https://github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK/blob/main/docs/techniques/super-resolution-temporal.md). Arm ASR extends this technnology with multiple optimizations to make the technique suited for the more resource-constrained environment of mobile gaming.
12+
13+
With an Unreal Engine plug-in available now, open-source library code to integrate into your customized engines, and Unity and Godot plug-ins coming later in the year, you can easily improve frames per second, enhance visual quality, and prevent thermal throttling for smoother, longer gameplay.
14+
15+
## What is Super Resolution?
16+
17+
Super-resolution techniques render some frames at a lower resolution and use shader upscaling to reconstruct how the frames should look at native resolution. This offers significant performance and battery life improvements for mobile devices.
18+
19+
Arm ASR outperforms spatial upscalers when reconstructing fine details, such as:
20+
21+
- Thin features
22+
- Grid-like structures
23+
- Fast-moving objects
24+
25+
You can control a range of different settings for Arm ASR:
26+
27+
- The upscaling ratio. For example, a value of 50.0 will mean that the plugin upscales frames by a factor of 2.
28+
- Use Arm ASR’s own auto-exposure or use the game engine’s auto-exposure value.
29+
- Use a Robust Contrast Adaptive Sharpening (RCAS) filter to sharpen the output image.
30+
- The shader quality preset: 1 - Quality, 2 - Balanced, 3 - Performance.
31+
32+
## How to get Arm ASR
33+
34+
The Arm ASR experience kit is a combination of materials that provide access to the technology, to help you evaluate it and make the best use of it. It includes:
35+
36+
- The Arm ASR source code so developers can access it fully and even evolve the technology for their needs.
37+
- Tutorials and sample materials to help developers with the integration of the technology and how to use it.
38+
- Plugin for Unreal Engine
39+
40+
[Get Arm ASR on GitHub](https://github.com/arm/accuracy-super-resolution)
41+
42+
## Unreal Engine Plugin
43+
44+
We provide an Unreal Engine 5 plugin that you can install into your project in a matter of minutes. Once installed, simply enable temporal upscaling on your project and the plugin will automatically handle the upscaling of all frames.
45+
46+
[Using Arm ASR in Unreal Engine](../03-ue)
47+
48+
## Custom engine usage
49+
50+
If you are using your own custom engine, you can still integrate Arm ASR using our open-source reference library.
51+
52+
[Using Arm ASR in a custom engine with the Universal SDK](../04-universal-sdk)
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
---
2+
title: Using Arm ASR in Unreal Engine
3+
weight: 3
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
10+
## Introduction
11+
12+
This guide describes how to get started with Arm® Accuracy Super Resolution™ (Arm ASR) through 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 and some of the common tasks that you might encounter when setting up Arm ASR for the first time.
13+
14+
## Before you begin
15+
16+
We recommend using Unreal Engine versions 5.3-5.5 or 4.27 through this tutorial. Please get in contact with us at [email protected] if you have any questions.
17+
18+
## Installing the Arm ASR plugin
19+
20+
The following steps describe how to install the Arm ASR plugin in Unreal Engine:
21+
22+
1. Open the Unreal Engine project you intend to use with Arm ASR. The Third Person pack is available as an example.
23+
24+
![Third person pack](images/third_person_pack.png "Third person pack")
25+
26+
![Third person pack opening screen](images/third_person_pack_opening_screen.png "Third person pack opening screen")
27+
28+
1. Download the plugin by running the following command.
29+
30+
```
31+
git clone https://github.com/arm/accuracy-super-resolution-for-unreal
32+
```
33+
34+
1. Depending on your Unreal Engine version, navigate to the corresponding directory in the cloned repository.
35+
36+
| Unreal Engine version | Directory |
37+
|-----------------------|-----------|
38+
| 4.27 | UE-4.27 |
39+
| 5.3-5.5 | UE-5 |
40+
41+
1. Copy the Arm ASR plugin into the `Plugins` folder in the game directory.
42+
43+
![Plugin folder](images/plugin_folder.png "Plugin folder")
44+
45+
![Copied Arm ASR plugin](images/copied_arm_asr_plugin.png "Copied Arm ASR plugin")
46+
47+
1. Navigate back to your Unreal Engine project.
48+
49+
1. When the pop-up window opens asking to build Arm ASR, select **Yes**.
50+
51+
![Arm ASR pop up window](images/asr_popup.png "Arm ASR pop up window")
52+
53+
## Enable and configure Arm ASR
54+
55+
After reopening the Unreal Engine project, the Arm ASR plugin should be enabled.
56+
57+
1. Go to **Edit > Plugins**, and search for Arm ASR. Make sure Arm ASR is checked.
58+
59+
![Verify the plugin](images/verify_plugin.png "Verify the plugin")
60+
61+
![Plugin screen](images/plugin_screen.png "Plugin screen")
62+
63+
1. To enable Arm ASR upscaling, open **Project Settings** and change the Anti-Aliasing Method to **Temporal Anti-Aliasing**.
64+
65+
{{% notice %}}
66+
**Mobile Anti-Aliasing Method** is used for the mobile renderer, however this tutorial describes the desktop renderer. You can learn about other available renderers by studying the `README.md` of the `accuracy-super-resolution-for-unreal` repository.
67+
{{% /notice %}}
68+
69+
![Change anti-aliasing method](images/change_anti_aliasing_method.png "Change anti-aliasing method")
70+
71+
1. To check that Arm ASR is enabled and working, use the `ShowFlag.VisualizeTemporalUpscaler 1` console command. If Arm ASR is working, you will see Arm ASR listed as the **ThirdParty TemporalUpscaler** in the command window.
72+
73+
{{% notice %}}
74+
When you use the `ShowFlag.VisualizeTemporalUpscaler 1` console command, the debug views are not generated from Arm ASR but from Unreal Engines TAA.
75+
{{% /notice %}}
76+
77+
![Visualize console command](images/visualise_console_command.png "Visualize console command")
78+
79+
1. If Arm ASR is not shown here, use the `r.ArmASR.Enable 1` console command to enable upscaling.
80+
81+
![Arm ASR.Enable 1 command](images/arm_asr_enable_command.png "ArmASR.Enable 1 command")
82+
83+
## Further configuration {.section}
84+
85+
Arm ASR's behaviour can be configured via the following plugin-specific console variables:
86+
87+
Table: Arm ASR Setting options
88+
89+
|Console Variable | Default Value | Value Range | Details |
90+
|:------------------------------------------------- | :------------ | :---------- | :----------------------------------------------------------------------------------------------------- |
91+
|`r.ArmASR.Enable` | 1 | 0, 1 | Enable / disable Arm ASR. |
92+
|`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. |
93+
|`r.ArmASR.Sharpness` | 0 | 0-1 | If greater than 0 this enables Robust Contrast Adaptive Sharpening Filter to sharpen the output image. |
94+
|`r.ArmASR.ShaderQuality` | 1 | 1, 2, 3 | Select shader quality preset: 1 - Quality, 2 - Balanced, 3 - Performance. |
95+
|`r.ArmASR.CreateReactiveMask` | 1 | 0-1 | Create the reactive mask. |
96+
|`r.ArmASR.ReactiveMaskReflectionScale` | 0.4 | 0-1 | Range from 0.0 to 1.0, scales the Unreal Engine reflection contribution to the reactive mask, which can be used to control the amount of aliasing on reflective surfaces. |
97+
|`r.ArmASR.ReactiveMaskRoughnessScale` | 0.15 | 0-1 | Range from 0.0 to 1.0, scales the GBuffer roughness to provide a fallback value for the reactive mask when screenspace & planar reflections are disabled or don't affect a pixel. |
98+
|`r.ArmASR.ReactiveMaskRoughnessBias` | 0.25 | 0-1 | Range from 0.0 to 1.0, biases the reactive mask value when screenspace/planar reflections are weak with the GBuffer roughness to account for reflection environment captures. |
99+
|`r.ArmASR.ReactiveMaskRoughnessMaxDistance` | 6000 | - | Maximum distance in world units for using material roughness to contribute to the reactive mask, the maximum of this value and View.FurthestReflectionCaptureDistance will be used. |
100+
|`r.ArmASR.ReactiveMaskRoughnessForceMaxDistance` | 0 | - | Enable to force the maximum distance in world units for using material roughness to contribute to the reactive mask rather than using View.FurthestReflectionCaptureDistance. |
101+
|`r.ArmASR.ReactiveMaskReflectionLumaBias` | 0 | 0-1 | Range from 0.0 to 1.0, biases the reactive mask by the luminance of the reflection. Use to balance aliasing against ghosting on brightly lit reflective surfaces. |
102+
|`r.ArmASR.ReactiveHistoryTranslucencyBias` | 0.5 | 0-1 | Range from 0.0 to 1.0, scales how much translucency suppresses history via the reactive mask. Higher values will make translucent materials more reactive which can reduce smearing. |
103+
|`r.ArmASR.ReactiveHistoryTranslucencyLumaBias` | 0 | 0-1 | Range from 0.0 to 1.0, biases how much the translucency suppresses history via the reactive mask by the luminance of the transparency. Higher values will make bright translucent materials more reactive which can reduce smearing. |
104+
|`r.ArmASR.ReactiveMaskTranslucencyBias` | 1 | 0-1 | Range from 0.0 to 1.0, scales how much contribution translucency makes to the reactive mask. Higher values will make translucent materials more reactive which can reduce smearing. |
105+
|`r.ArmASR.ReactiveMaskTranslucencyLumaBias` | 0 | 0-1 | Range from 0.0 to 1.0, biases the translucency contribution to the reactive mask by the luminance of the transparency. Higher values will make bright translucent materials more reactive which can reduce smearing. |
106+
|`r.ArmASR.ReactiveMaskTranslucencyMaxDistance` | 500000 | - | Maximum distance in world units for using translucency to contribute to the reactive mask. This is a way to remove sky-boxes and other back-planes from the reactive mask, at the expense of nearer translucency not being reactive. |
107+
|`r.ArmASR.ReactiveMaskForceReactiveMaterialValue` | 0 | 0, 1 | Force the reactive mask value for Reactive Shading Model materials, when > 0 this value can be used to override the value supplied in the Material Graph. |
108+
|`r.ArmASR.ReactiveMaskReactiveShadingModelID` | MSM_NUM | - | Treat the specified shading model as reactive, taking the CustomData0.x value as the reactive value to write into the mask. |
109+
110+
There are two ways to configure further settings.
111+
112+
Option 1 is using the UI. Go to **Edit > Project Settings > Plugins > Arm ASR**.
113+
114+
![Configure settings using UI](images/ui_settings.png "Configure settings using UI")
115+
116+
Option 2 is through the console. By typing `r.ArmASR.` into the console window, you can see the configuration options.
117+
118+
![Configuration options](images/configuration_options.png "Configuration options")
119+
120+
For example, you can change the upscaling ratio by modifying the [ScreenPercentage]{.ui}. The upscaling ratio of Arm ASR can be set via `r.ScreenPercentage`. For example, a value of `50.0` will mean that the plugin upscales frames by a factor of 2.
121+
122+
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.
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
title: Using Arm ASR in a custom engine with the Universal SDK
3+
weight: 5
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
## Introduction
10+
11+
Use the following steps to implement **Arm Accuracy Super-Resolution** in your own custome engine. Arm ASR is an optimized version of [Fidelity Super Resolution 2](https://github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK/blob/main/docs/techniques/super-resolution-temporal.md) that has been heavily modified to included many mobile-oriented optimizations to make the technique suited for mobile.
12+
13+
There are two ways you can integrate Arm ASR into your custom engine:
14+
15+
- [Quick integration](#quick-integration) - using the built-in standalone backend.
16+
- [Tight integration](#tight-integration) - using your own backend/renderer.
17+
18+
## Quick integration
19+
20+
To quickly integrate Arm ASR, which means the built-in standalone backend is used, follow the steps below:
21+
22+
1. Get the Arm ASR package from GitHub:
23+
24+
```
25+
git clone https://github.com/arm/accuracy-super-resolution-universal-sdk
26+
```
27+
1. For the purposes of this tutorial, we will set a variable to identify the location of the Arm ASR package. This path will be used to refer to files in the repository throughout this learning path.
28+
29+
```
30+
export $ARMASR_DIR=$(pwd)
31+
```
32+
33+
1. Copy the **Arm_ASR** directory into your project, and add **Arm_ASR/src/backends/shared/blob_accessors/prebuilt_shaders** in the incude path if you want to use prebuilt shaders.
34+
35+
1. Include the following header files in your codebase where you wish to interact with the technique:
36+
37+
- `$ARMASR_DIR/include/host/ffxm_fsr2.h#L1`
38+
- `$ARMASR_DIR/include/host/backends/vk/ffxm_vk.h#L1`
39+
40+
1. Create a Vulkan backend.
41+
- Allocate a Vulkan scratch buffer of the size returned by `$ARMASR_DIR/include/host/backends/vk/ffxm_vk.h#L65`.
42+
- Create `FfxmDevice` via `$ARMASR_DIR/include/host/backends/vk/ffxm_vk.h#L65`.
43+
- Create `FfxmInterface` by calling `$ARMASR_DIR/include/host/backends/vk/ffxm_vk.h#L99`.
44+
45+
1. Create a context by calling `ffxmFsr2ContextCreate` accessed via `$ARMASR_DIR/include/host/ffxm_fsr2.h#L296`. The parameters structure should be filled out matching the configuration of your application.
46+
47+
1. Each frame call `ffxmFsr2ContextDispatch` via `$ARMASR_DIR/include/host/ffxm_fsr2.h#L337' to record/execute the technique's workloads. The parameters structure should be filled out matching the configuration of your application.
48+
49+
1. When your application is terminating (or you wish to destroy the context for another reason) you should call `ffxmFsr2ContextDestroy` accessed via `$ARMASR_DIR/include/host/ffxm_fsr2.h#L360`. The GPU should be idle before calling this function.
50+
51+
1. Sub-pixel jittering should be applied to your application's projection matrix. This should be done when performing the main rendering of your application. You should use the `ffxmFsr2GetJitterOffset` function accessed via `$ARMASR_DIR/include/host/ffxm_fsr2.h#L504` to compute the precise jitter offsets.
52+
53+
1. A global mip bias should be applied when texturing.
54+
55+
1. For the best upscaling quality it is strongly advised that you populate the Reactive mask according to our guidelines. You can also use `ffxmFsr2ContextGenerateReactiveMask` accessed via `$ARMASR_DIR/include/host/ffxm_fsr2.h#L348` as a starting point.
56+
57+
1. Finally, link the two built libraries (**Arm_ASR_api** and **Arm_ASR_backend**).
58+
59+
## Tight integration
60+
61+
If you wish to use your own backend/renderer, a tight integration with your engine is required. For this, a similar process to the [quick integration](#quick-integration) described above is required, but with the added requirement to fill the `FfxmInterface` accessed via `$ARMASR_DIR/include/host/ffxm_interface.h#L438` with functions implemented on your end.
62+
63+
In this approach the shaders are expected to be built by the engine. Arm ASR's shaders have been micro-optimized to use explicit 16-bit floating-point types so it is advisable that the shaders are built using such types (for example, `min16float` in hlsl or `float16_t` in glsl). For this you should define the symbols `#define FFXM_HLSL_6_2 1` and `#define FFXM_HALF 1` (FFXM_HALF is already defined in the provided shader sources) enabled with a value of `1`.
64+
65+
1. Include the `ffxm_interface.h` header file from `$ARMASR_DIR/include/host/ffxm_interface.h#L1` in your codebase.
66+
67+
1. Implement your own functions (assume the names are `xxxGetInterfacexxx`, `xxxGetScratchMemorySizexxx`) and callbacks in `FfxmInterface` accessed via `$ARMASR_DIR/include/host/ffxm_interface.h#L438` to link Arm ASR with the engine's renderer.
68+
69+
1. Create your own backend by calling `xxxGetInterfacexxx`. A scratch buffer should be allocated of the size returned by calling `xxxGetScratchMemorySizexxx` and the pointer to that buffer passed to `xxxGetInterfacexxx`.
70+
71+
1. Now, you can follow the same steps from quick integration above, starting from step 6, creating a Arm ASR context. In the final step it is only necessary to link the **Arm_ASR_api** library.
72+
73+
### HLSL-based workflows
74+
75+
In an HLSL-based workflow using DirectX Shader Compiler to cross-compile to SPIRV do the following:
76+
77+
- Use the following flags when building:
78+
79+
```
80+
-fspv-target-env=vulkan1.1spirv1.4 -enable-16bit-types
81+
```
82+
83+
- The extension **VK_KHR_shader_float16_int8** should be used at runtime.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: How to get help
3+
weight: 6
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
## Get support
10+
11+
You can reach out to us on the following email address: <[email protected]>.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: Additional resources
3+
weight: 8
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
## Additional resources
10+
11+
The following links provide additional information about Arm ASR.
12+
13+
* [Arm ASR on Arm Developer Hub](https://www.arm.com/developer-hub/mobile-graphics-and-gaming/accuracy-super-resolution)
14+
* [Arm ASR Manga Comic](https://developer.arm.com/Mobile%20Graphics%20and%20Gaming/FeaturedContent/Mali%20Manga/FeaturedContent-MaliManga-Volume4)
15+
* [Arm Community Blog](https://community.arm.com/arm-community-blogs/b/graphics-gaming-and-vr-blog/posts/introducing-arm-accuracy-super-resolution)
16+
* [Arm Accuracy Super Resolution for Unreal Engine Tutorial](https://developer.arm.com/documentation/109993/latest/)
17+
* [Arm Accuracy Super Resolution for Unreal Engine Tutorial](https://developer.arm.com/documentation/109993/latest/)

0 commit comments

Comments
 (0)