using System;
namespace UnityEngine.Rendering
{
///
/// Types of dynamic resolution that can be requested. Note that if Hardware is selected, but not available on the platform, the system will fallback to Software.
///
public enum DynamicResolutionType : byte
{
///
/// Software dynamic resolution.
///
Software,
///
/// Hardware dynamic resolution.
///
Hardware,
}
///
/// Types of filters that can be used to upscale rendered result to native resolution.
///
public enum DynamicResUpscaleFilter : byte
{
///
/// Bilinear upscaling filter.
///
Bilinear,
///
/// Bicubic Catmull-Rom upscaling filter.
///
CatmullRom,
///
/// Lanczos upscaling filter.
///
Lanczos,
///
/// Contrast Adaptive Sharpening upscaling filter.
///
ContrastAdaptiveSharpen,
}
/// User-facing settings for dynamic resolution.
[Serializable]
public struct GlobalDynamicResolutionSettings
{
/// Default GlobalDynamicResolutionSettings
///
public static GlobalDynamicResolutionSettings NewDefault() => new GlobalDynamicResolutionSettings()
{
maxPercentage = 100.0f,
minPercentage = 100.0f,
// It fall-backs to software when not supported, so it makes sense to have it on by default.
dynResType = DynamicResolutionType.Hardware,
upsampleFilter = DynamicResUpscaleFilter.CatmullRom,
forcedPercentage = 100.0f
};
/// Select whether the dynamic resolution is enabled or not.
public bool enabled;
/// The maximum resolution percentage that dynamic resolution can reach.
public float maxPercentage;
/// The minimum resolution percentage that dynamic resolution can reach.
public float minPercentage;
/// The type of dynamic resolution method.
public DynamicResolutionType dynResType;
/// The type of upscaling filter to use.
public DynamicResUpscaleFilter upsampleFilter;
/// Select whether dynamic resolution system will force a specific resolution percentage.
public bool forceResolution;
/// The resolution percentage forced in case forceResolution is set to true.
public float forcedPercentage;
}
}