Class HDDynamicResolution
Component that controls dynamic resolution scaling in HDRP (High Definition Render Pipeline) via DRH (Dynamic Resolution Handler).
Inherited Members
Namespace: Global Namespace
Assembly: Unity.RenderPipelines.HighDefinition.Runtime.dll
Syntax
public class HDDynamicResolution : MonoBehaviour
Remarks
This class controls the dynamic resolution based on the averaged GPU frametime over [EvaluationFrameCount] frames. If it exceeds the target [ScaleUpDuration] times consecutively (which takes [ScaleUpDuration] * [EvaluationFrameCount] frames), we request an increased screen scale to DRH. If it falls behind the target framerate [ScaleDownDuration] times consecutively, we request a decreased screen scale to DRH.
Fields
DefaultTargetFrameRate
Target frame rate for dynamic resolution. If Application.targetFrameRate is already set, Application.targetFrameRate overrides this parameter.
Declaration
[Min(1)]
[Tooltip("Sets the desired target frame rate in FPS. If Application.targetFrameRate is already set, Application.targetFrameRate overrides this parameter.")]
public float DefaultTargetFrameRate
Field Value
Type | Description |
---|---|
float |
EnableDebugView
Enables the debug view of dynamic resolution. Only on development build or editor.
Declaration
[Tooltip("Enables the debug view of dynamic resolution.")]
public bool EnableDebugView
Field Value
Type | Description |
---|---|
bool |
EvaluationFrameCount
The number of frames HDRP takes into account to calculate GPU's average performance. HDRP uses these frames to determine if the frame time is short enough to meet the target frame rate.
Declaration
[Min(1)]
[Tooltip("The number of frames HDRP takes into account to calculate GPU's average performance. HDRP uses these frames to determine if the frame time is short enough to meet the target frame rate.")]
public int EvaluationFrameCount
Field Value
Type | Description |
---|---|
int |
ScaleDownDuration
The number of groups of evaluated frames below the target frame time that HDRP requires to reduce dynamic resolution by one step. To control how many frames HDRP evaluates in each group, change the Evaluation Frame Count value.
Declaration
[Tooltip("The number of groups of evaluated frames below the target frame time that HDRP requires to reduce dynamic resolution by one step. To control how many frames HDRP evaluates in each group, change the Evaluation Frame Count value.")]
public uint ScaleDownDuration
Field Value
Type | Description |
---|---|
uint |
ScaleDownStepCount
The number of downscale steps between the maximum screen percentage to the minimum screen percentage. For example, a value of 5 means that each step downscales 20% of the difference between the maximum and minimum screen resolutions. You can set the minimum and maximum screen percentage in the current HDRP Asset.
Declaration
[Min(1)]
[Tooltip("The number of downscale steps between the maximum screen percentage to the minimum screen percentage. For example, a value of 5 means that each step downscales 20% of the difference between the maximum and minimum screen resolutions. You can set the minimum and maximum screen percentage in the current HDRP Asset.")]
public int ScaleDownStepCount
Field Value
Type | Description |
---|---|
int |
ScaleUpDuration
The number of groups of evaluated frames above the target frame time that HDRP requires to increase dynamic resolution by one step. To control how many frames HDRP evaluates in each group, change the Evaluation Frame Count value.
Declaration
[Tooltip("The number of groups of evaluated frames above the target frame time that HDRP requires to increase dynamic resolution by one step. To control how many frames HDRP evaluates in each group, change the Evaluation Frame Count value.")]
public uint ScaleUpDuration
Field Value
Type | Description |
---|---|
uint |
ScaleUpStepCount
The number of downscale steps between the minimum screen percentage to the maximum screen percentage. For example, a value of 5 means that each step upscales 20% of the difference between the maximum and minimum screen resolutions. You can set the minimum and maximum screen percentage in the current HDRP Asset.
Declaration
[Min(1)]
[Tooltip("The number of downscale steps between the minimum screen percentage to the maximum screen percentage. For example, a value of 5 means that each step upscales 20% of the difference between the maximum and minimum screen resolutions. You can set the minimum and maximum screen percentage in the current HDRP Asset.")]
public int ScaleUpStepCount
Field Value
Type | Description |
---|---|
int |