Class DynamicResolutionHandler
The class responsible to handle dynamic resolution.
Inherited Members
Namespace: UnityEngine.Rendering
Assembly: Unity.RenderPipelines.Core.Runtime.dll
Syntax
public class DynamicResolutionHandler
Properties
Name | Description |
---|---|
filter | The filter that is used to upscale the rendering result to the native resolution. |
finalViewport | The viewport of the final buffer. This is likely the resolution the dynamic resolution starts from before any scaling. Note this is NOT the target resolution the rendering will happen in but the resolution the scaled rendered result will be upscaled to. |
instance | Get the instance of the global dynamic resolution handler. |
runUpscalerFilterOnFullResolution | By default, dynamic resolution scaling is turned off automatically when the source matches the final viewport (100% scale). That is, DynamicResolutionEnabled and SoftwareDynamicResIsEnabled will return false if the scale is 100%. For certain upscalers, we dont want this behavior since they could possibly include anti aliasing and other quality improving post processes. Setting this to true will eliminate this behavior. Note: when the EdgeAdaptiveScalingUpres (FSR 1.0) filter is set, this will cause this parameter to always be true. |
upsamplerSchedule | Property that sets / gets the state of the upscaling schedule. This must be set at the beginning of the frame, once per camera. |
Methods
Name | Description |
---|---|
ApplyScalesOnSize(Vector2Int) | Applies to the passed size the scale imposed by the dynamic resolution system. This function uses the internal resolved scale from the dynamic resolution system. Note: this function is pure (has no side effects), this function does not cache the pre-scale size |
CalculateMipBias(Vector2Int, Vector2Int, bool) | Returns the mip bias to apply in the rendering pipeline. This mip bias helps bring detail since sampling of textures occurs at the target rate. |
ClearSelectedCamera() | Will clear the currently used camera. Use this function to restore the default instance when UpdateAndUseCamera is called. |
DynamicResolutionEnabled() | Identifies whether dynamic resolution is enabled and scaling the render targets. |
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. |
GetCurrentScale() | Returns the scale that is currently applied by the dynamic resolution system. |
GetLastScaledSize() | Returns the latest scaled size that has been produced by GetScaledSize. |
GetLowResMultiplier(float) | Returns the resolved low res multiplier based on the low res transparency threshold settings. Note: The pipeline can use this to drive the scale for low res transparency if available. |
GetResolvedScale() | Gets the resolved scale |
GetScaledSize(Vector2Int) | Applies to the passed size the scale imposed by the dynamic resolution system. Note: this function has the side effect of caching the last scale size, and the output is always smaller or equal then the input. |
HardwareDynamicResIsEnabled() | Determines whether hardware dynamic resolution is enabled or not. |
RequestsHardwareDynamicResolution() | Identifies whether hardware dynamic resolution has been requested and is going to be used. |
SetActiveDynamicScalerSlot(DynamicResScalerSlot) | Sets the active dynamic scaler slot to be used by the runtime when calculating frame resolutions. See DynamicResScalerSlot for more information. |
SetCurrentCameraRequest(bool) | Set whether the camera that is currently processed by the pipeline has requested dynamic resolution or not. |
SetDynamicResScaler(PerformDynamicRes, DynamicResScalePolicyType) | Set the scaler method used to drive dynamic resolution by the user. |
SetSystemDynamicResScaler(PerformDynamicRes, DynamicResScalePolicyType) | Set the scaler method used to drive dynamic resolution internally from the Scriptable Rendering Pipeline. This function should only be called by Scriptable Rendering Pipeline. |
SetUpscaleFilter(Camera, DynamicResUpscaleFilter) | Set the Upscale filter used by the camera when dynamic resolution is run. |
SoftwareDynamicResIsEnabled() | Determines whether software dynamic resolution is enabled or not. |
Update(GlobalDynamicResolutionSettings, Action) | Update the state of the dynamic resolution system. |
UpdateAndUseCamera(Camera, GlobalDynamicResolutionSettings?, Action) | Update the state of the dynamic resolution system for a specific camera. Call this function also to switch context between cameras (will set the current camera as active). Passing a null camera has the same effect as calling Update without the camera parameter. |