using System; using System.Collections.Generic; 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. Obsolete and not supported. /// [Obsolete("Bilinear upscale filter is considered obsolete and is not supported anymore, please use CatmullRom for a very cheap, but blurry filter.", false)] Bilinear, /// /// Bicubic Catmull-Rom upscaling filter. /// CatmullRom, /// /// Lanczos upscaling filter. Obsolete and not supported. /// [Obsolete("Lanczos upscale filter is considered obsolete and is not supported anymore, please use Contrast Adaptive Sharpening for very sharp filter or FidelityFX Super Resolution 1.0.", false)] Lanczos, /// /// Contrast Adaptive Sharpening upscaling filter. /// ContrastAdaptiveSharpen, /// /// FidelityFX Super Resolution 1.0 /// [InspectorName("FidelityFX Super Resolution 1.0")] EdgeAdaptiveScalingUpres, /// /// Temporal Upscaling. /// [InspectorName("TAA Upscale")] TAAU } /// User-facing settings for advanced upscalers. public enum AdvancedUpscalers : byte { /// /// NVIDIA Deep Learning Super Sampling (DLSS). /// [InspectorName("Deep Learning Super Sampling (DLSS)")] DLSS = 0, /// /// AMD FidelityFX Super Resolution (FSR2). /// [InspectorName("FidelityFX Super Resolution 2.0 (FSR2)")] FSR2 = 1, /// /// Spatial-Temporal Post-Processing /// [InspectorName("Spatial-Temporal Post-Processing (STP)")] STP = 2 } /// User-facing settings for dynamic resolution. [Serializable] public struct GlobalDynamicResolutionSettings { /// Default GlobalDynamicResolutionSettings /// A GlobalDynamicResolutionSettings instance initialized with default values. public static GlobalDynamicResolutionSettings NewDefault() => new GlobalDynamicResolutionSettings() { useMipBias = false, 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, lowResTransparencyMinimumThreshold = 0.0f, lowResVolumetricCloudsMinimumThreshold = 50.0f, rayTracingHalfResThreshold = 50.0f, DLSSUseOptimalSettings = true, DLSSPerfQualitySetting = 0, DLSSSharpness = 0.5f, DLSSInjectionPoint = DynamicResolutionHandler.UpsamplerScheduleType.BeforePost, FSR2InjectionPoint = DynamicResolutionHandler.UpsamplerScheduleType.BeforePost, advancedUpscalersByPriority = new List() { AdvancedUpscalers.STP }, fsrOverrideSharpness = false, fsrSharpness = FSRUtils.kDefaultSharpnessLinear }; /// Select whether the dynamic resolution is enabled or not. public bool enabled; /// Offsets the mip bias to recover mode detail. This only works if the camera is utilizing TAA. public bool useMipBias; /// Enables upsamplers available for certain platforms by priority. public List advancedUpscalersByPriority; /// Opaque quality setting of NVIDIA Deep Learning Super Sampling (DLSS). Use the system enum UnityEngine.NVIDIA.DLSSQuality to set the quality. public uint DLSSPerfQualitySetting; /// The injection point at which to apply DLSS upscaling. public DynamicResolutionHandler.UpsamplerScheduleType DLSSInjectionPoint; /// Toggle NVIDIA Deep Learning Super Sampling (DLSS) automatic recommendation system for scaling and sharpness. /// If this is on, the manually established scale callback for Dynamic Resolution Scaling is ignored. The sharpness setting of DLSS is also ignored. /// public bool DLSSUseOptimalSettings; /// Pixel sharpness of NVIDIA Deep Leraning Super Sampling (DLSS). [Range(0, 1)] public float DLSSSharpness; /// Enable sharpness control for FidelityFX 2.0 Super Resolution (FSR2). public bool FSR2EnableSharpness; /// Pixel sharpness of AMD FidelityFX 2.0 Super Resolution (FSR2). [Range(0, 1)] public float FSR2Sharpness; /// Toggle AMD FidelityFX 2.0 Super Resolution (FSR2) automatic recommendation system for scaling. /// If this is on, the manually established scale callback for Dynamic Resolution Scaling is ignored. /// public bool FSR2UseOptimalSettings; /// Opaque quality setting of AMD FidelityFX 2.0 Super Resolution (FSR2). Use the system enum UnityEngine.AMD.FSR2Quality to set the quality. public uint FSR2QualitySetting; /// The injection point at which to apply FSR2 upscaling. public DynamicResolutionHandler.UpsamplerScheduleType FSR2InjectionPoint; /// Toggle sharpness override for AMD FidelityFX Super Resolution (FSR). /// If this is on, a sharpness value specified by the user will be used instead of the default. /// public bool fsrOverrideSharpness; /// Pixel sharpness of AMD FidelityFX Super Resolution (FSR). [Range(0, 1)] public float fsrSharpness; /// 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 default of upscaling filter used. It can be overridden via the API DynamicResolutionHandler.SetUpscaleFilter 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; /// The minimum percentage threshold allowed to clamp low resolution transparency. When the resolution percentage falls below this threshold, HDRP will clamp the low resolution to this percentage. public float lowResTransparencyMinimumThreshold; /// The minimum percentage threshold allowed to render ray tracing effects at half resolution. When the resolution percentage falls below this threshold, HDRP will render ray tracing effects at full resolution. public float rayTracingHalfResThreshold; /// The minimum percentage threshold allowed to clamp low resolution for SSGI (Screen Space Global Illumination). When the resolution percentage falls below this threshold, HDRP will clamp the low resolution to this percentage. public float lowResSSGIMinimumThreshold; /// The minimum percentage threshold allowed to clamp tracing resolution for Volumetric Clouds. When the resolution percentage falls below this threshold, HDRP will trace the Volumetric Clouds in half res. public float lowResVolumetricCloudsMinimumThreshold; #pragma warning disable 618 // Type or member is obsolete /// Obsolete, used only for data migration. Use the advancedUpscalersByPriority list instead to add the proper supported advanced upscaler by priority. [Obsolete("Obsolete, used only for data migration. Use the advancedUpscalersByPriority list instead to add the proper supported advanced upscaler by priority.")] public bool enableDLSS; #pragma warning restore 618 } }