Awesome
snapdragon-gsr
Snapdragon Game Super Resolution for Unity BIRP
For more information and up-to-date versions, check the official GSR git page: Snapdragon GSR GitHub
Quick Readme (also included in the HLSL file)
SGSR is used the same way FSR1 is used. Like this:
- Call SGSR pass right after you anti-alias (if) your image and before applying any kind of noise or grain to it
- Provide a low ress RT (the size you are rendering your scene) to the SGSR pass.
Note: Keep in mind your viewport/screen size must be the size you want to upscale (max up to 2x).
Integration:
-
Include the
sgsr_mobile.hlsl
file in your post-process shader. -
Use the
UNITY_DECLARE_TEX2D
Macro as it takes care of both the Texture and Sampler declaration, like so:UNITY_DECLARE_TEX2D(_MainTex);
-
Declare this additional sampler. I believe the one declared with the
UNITY_DECLARE_TEX2D
macro is enough, but just in case:SamplerState sampler_LinearClamp;
-
Call the
SgsrYuvH
function in your post-process fragment shader.
Function Parameters Explanation:
- ViewportInfo: Should be a
float4
containing{1.0/screen_width, 1.0/screen_height, screen_width, screen_height}
.- The
xy
components will be used to shift UVs to read adjacent texels. - The
zw
components will be used to map from UV space[0, 1][0, 1]
to image space[0, w][0, h]
.
- The
- color: Your your final filtered image
- i.uv: Screen space UVs.
Example usage:
half4 color = half4(0, 0, 0, 1);
SgsrYuvH(color, i.uv, ViewportInfo);