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
We evaluate GPU performance every [EvaluationFrameCount] frames. The evaluation is comparison between the averaged GPU frame time over [EvaluationFrameCount] frames and 1 / [DefaultTargetFrameRate].
Declaration
[Min(1)]
[Tooltip("Per how many frames we evaluate GPU performance against the target frame rate, using the averaged GPU frame time over frames.")]
public int EvaluationFrameCount
Field Value
Type | Description |
---|---|
int |
ScaleDownDuration
If averaged GPU framerate falls behind the target framerate [ScaleDownDuration] times consecutively, we request decreased scale to DRH.
Declaration
[Tooltip("Sets the number of consecutive times where the GPU performance is below the target to decrease dynamic resolution by one step.")]
public uint ScaleDownDuration
Field Value
Type | Description |
---|---|
uint |
ScaleDownStepCount
The number of steps to downscale from maximum screen percentage to minimum screen percentage.
Declaration
[Min(1)]
[Tooltip("Sets the number of steps to downscale from maximum screen percentage to minimum screen percentage set in the current HDRP Asset.")]
public int ScaleDownStepCount
Field Value
Type | Description |
---|---|
int |
ScaleUpDuration
If averaged GPU framerate exceeds the target framerate [ScaleUpDuration] times consecutively, we request increased scale to DRH.
Declaration
[Tooltip("Sets the number of consecutive times where the GPU performance is above the target to increase dynamic resolution by one step.")]
public uint ScaleUpDuration
Field Value
Type | Description |
---|---|
uint |
ScaleUpStepCount
The number of steps to upscale from minimum screen percentage to maximum screen percentage.
Declaration
[Min(1)]
[Tooltip("Sets the number of steps to upscale from minimum screen percentage to maximum screen percentage set in the current HDRP Asset.")]
public int ScaleUpStepCount
Field Value
Type | Description |
---|---|
int |