docs.unity3d.com
    Show / Hide Table of Contents

    Class FSRUtils

    Utility functions relating to FidelityFX Super Resolution (FSR)

    These functions are expected to be used in conjuction with the helper functions provided by FSRCommon.hlsl.

    Inheritance
    Object
    FSRUtils
    Namespace: UnityEngine.Rendering
    Syntax
    public static class FSRUtils

    Methods

    IsSupported()

    Returns true if FidelityFX Super Resolution (FSR) is supported on the current system

    FSR requires the textureGather shader instruction which wasn't supported by OpenGL ES until version 3.1

    Declaration
    public static bool IsSupported()
    Returns
    Type Description
    Boolean

    if FSR is supported on the current system

    SetEasuConstants(CommandBuffer, Vector2, Vector2, Vector2)

    Sets the constant values required by the FSR EASU shader on the provided command buffer

    Logic ported from "FsrEasuCon()" in Runtime/PostProcessing/Shaders/ffx/ffx_fsr1.hlsl

    Declaration
    public static void SetEasuConstants(CommandBuffer cmd, Vector2 inputViewportSizeInPixels, Vector2 inputImageSizeInPixels, Vector2 outputImageSizeInPixels)
    Parameters
    Type Name Description
    CommandBuffer cmd

    Command buffer to modify

    Vector2 inputViewportSizeInPixels

    This the rendered image resolution being upscaled

    Vector2 inputImageSizeInPixels

    This is the resolution of the resource containing the input image (useful for dynamic resolution)

    Vector2 outputImageSizeInPixels

    This is the display resolution which the input image gets upscaled to

    SetRcasConstants(CommandBuffer, Single)

    Sets the constant values required by the FSR RCAS shader on the provided command buffer

    Logic ported from "FsrRcasCon()" in Runtime/PostProcessing/Shaders/ffx/ffx_fsr1.hlsl

    Declaration
    public static void SetRcasConstants(CommandBuffer cmd, float sharpness = 0.2F)
    Parameters
    Type Name Description
    CommandBuffer cmd

    Command buffer to modify

    Single sharpness

    The scale is {0.0 := maximum, to N>0, where N is the number of stops(halving) of the reduction of sharpness

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023