Class DynamicResolutionHandler | Core RP Library | 7.2.1
docs.unity3d.com
    Show / Hide Table of Contents

    Class DynamicResolutionHandler

    The class responsible to handle dynamic resolution.

    Inheritance
    Object
    DynamicResolutionHandler
    Namespace: UnityEngine.Rendering
    Syntax
    public class DynamicResolutionHandler

    Properties

    filter

    The filter that is used to upscale the rendering result to the native resolution.

    Declaration
    public DynamicResUpscaleFilter filter { get; set; }
    Property Value
    Type Description
    DynamicResUpscaleFilter

    instance

    Get the instance of the global dynamic resolution handler.

    Declaration
    public static DynamicResolutionHandler instance { get; }
    Property Value
    Type Description
    DynamicResolutionHandler

    Methods

    DynamicResolutionEnabled()

    Identifies whether dynamic resolution is enabled and scaling the render targets.

    Declaration
    public bool DynamicResolutionEnabled()
    Returns
    Type Description
    Boolean

    True: Dynamic resolution is enabled.

    ForceSoftwareFallback()

    Forces software fallback for dynamic resolution. Needs to be called in case Hardware dynamic resolution is requested by the user, but not supported by the platform.

    Declaration
    public void ForceSoftwareFallback()

    GetCurrentScale()

    Returns the scale that is currently applied by the dynamic resolution system.

    Declaration
    public float GetCurrentScale()
    Returns
    Type Description
    Single

    The scale that is currently applied by the dynamic resolution system.

    GetLastScaledSize()

    Returns the latest scaled size that has been produced by GetScaledSize.

    Declaration
    public Vector2Int GetLastScaledSize()
    Returns
    Type Description
    Vector2Int

    The latest scaled size that has been produced by GetScaledSize.

    GetScaledSize(Vector2Int)

    Applies to the passed size the scale imposed by the dynamic resolution system.

    Declaration
    public Vector2Int GetScaledSize(Vector2Int size)
    Parameters
    Type Name Description
    Vector2Int size

    The starting size of the render target that will be scaled by dynamic resolution.

    Returns
    Type Description
    Vector2Int

    The parameter size scaled by the dynamic resolution system.

    HardwareDynamicResIsEnabled()

    Determines whether hardware dynamic resolution is enabled or not.

    Declaration
    public bool HardwareDynamicResIsEnabled()
    Returns
    Type Description
    Boolean

    True: Hardware dynamic resolution is enabled

    RequestsHardwareDynamicResolution()

    Identifies whether hardware dynamic resolution has been requested and is going to be used.

    Declaration
    public bool RequestsHardwareDynamicResolution()
    Returns
    Type Description
    Boolean

    True: Hardware dynamic resolution is requested by user and software fallback has not been forced

    SetCurrentCameraRequest(Boolean)

    Set whether the camera that is currently processed by the pipeline has requested dynamic resolution or not.

    Declaration
    public void SetCurrentCameraRequest(bool cameraRequest)
    Parameters
    Type Name Description
    Boolean cameraRequest

    Determines whether the camera has requested dynamic resolution or not.

    SetDynamicResScaler(PerformDynamicRes, DynamicResScalePolicyType)

    Set the scaler method used to drive dynamic resolution.

    Declaration
    public static void SetDynamicResScaler(PerformDynamicRes scaler, DynamicResScalePolicyType scalerType = DynamicResScalePolicyType.ReturnsMinMaxLerpFactor)
    Parameters
    Type Name Description
    PerformDynamicRes scaler

    The delegate used to determine the resolution percentage used by the dynamic resolution system.

    DynamicResScalePolicyType scalerType

    The type of scaler that is used, this is used to indicate the return type of the scaler to the dynamic resolution system.

    SoftwareDynamicResIsEnabled()

    Determines whether software dynamic resolution is enabled or not.

    Declaration
    public bool SoftwareDynamicResIsEnabled()
    Returns
    Type Description
    Boolean

    True: Software dynamic resolution is enabled

    Update(GlobalDynamicResolutionSettings, Action)

    Update the state of the dynamic resolution system.

    Declaration
    public void Update(GlobalDynamicResolutionSettings settings, Action OnResolutionChange = null)
    Parameters
    Type Name Description
    GlobalDynamicResolutionSettings settings

    The settings that are to be used by the dynamic resolution system.

    Action OnResolutionChange

    An action that will be called every time the dynamic resolution system triggers a change in resolution.

    In This Article
    • Properties
      • filter
      • instance
    • Methods
      • DynamicResolutionEnabled()
      • ForceSoftwareFallback()
      • GetCurrentScale()
      • GetLastScaledSize()
      • GetScaledSize(Vector2Int)
      • HardwareDynamicResIsEnabled()
      • RequestsHardwareDynamicResolution()
      • SetCurrentCameraRequest(Boolean)
      • SetDynamicResScaler(PerformDynamicRes, DynamicResScalePolicyType)
      • SoftwareDynamicResIsEnabled()
      • Update(GlobalDynamicResolutionSettings, Action)
    Back to top
    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