A game about forced loneliness, made by TACStudios
at master 198 lines 10 kB view raw
1using System; 2using System.Collections.Generic; 3 4namespace UnityEngine.Rendering 5{ 6 /// <summary> 7 /// 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. 8 /// </summary> 9 public enum DynamicResolutionType : byte 10 { 11 /// <summary> 12 /// Software dynamic resolution. 13 /// </summary> 14 Software, 15 /// <summary> 16 /// Hardware dynamic resolution. 17 /// </summary> 18 Hardware, 19 } 20 21 /// <summary> 22 /// Types of filters that can be used to upscale rendered result to native resolution. 23 /// </summary> 24 public enum DynamicResUpscaleFilter : byte 25 { 26 /// <summary> 27 /// Bilinear upscaling filter. Obsolete and not supported. 28 /// </summary> 29 [Obsolete("Bilinear upscale filter is considered obsolete and is not supported anymore, please use CatmullRom for a very cheap, but blurry filter.", false)] Bilinear, 30 /// <summary> 31 /// Bicubic Catmull-Rom upscaling filter. 32 /// </summary> 33 CatmullRom, 34 /// <summary> 35 /// Lanczos upscaling filter. Obsolete and not supported. 36 /// </summary> 37 [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, 38 /// <summary> 39 /// Contrast Adaptive Sharpening upscaling filter. 40 /// </summary> 41 ContrastAdaptiveSharpen, 42 /// <summary> 43 /// FidelityFX Super Resolution 1.0 44 /// </summary> 45 [InspectorName("FidelityFX Super Resolution 1.0")] 46 EdgeAdaptiveScalingUpres, 47 /// <summary> 48 /// Temporal Upscaling. 49 /// </summary> 50 [InspectorName("TAA Upscale")] 51 TAAU 52 } 53 54 /// <summary>User-facing settings for advanced upscalers.</summary> 55 public enum AdvancedUpscalers : byte 56 { 57 /// <summary> 58 /// NVIDIA Deep Learning Super Sampling (DLSS). 59 /// </summary> 60 [InspectorName("Deep Learning Super Sampling (DLSS)")] 61 DLSS = 0, 62 /// <summary> 63 /// AMD FidelityFX Super Resolution (FSR2). 64 /// </summary> 65 [InspectorName("FidelityFX Super Resolution 2.0 (FSR2)")] 66 FSR2 = 1, 67 /// <summary> 68 /// Spatial-Temporal Post-Processing 69 /// </summary> 70 [InspectorName("Spatial-Temporal Post-Processing (STP)")] 71 STP = 2 72 } 73 74 /// <summary>User-facing settings for dynamic resolution.</summary> 75 [Serializable] 76 public struct GlobalDynamicResolutionSettings 77 { 78 /// <summary>Default GlobalDynamicResolutionSettings</summary> 79 /// <returns>A GlobalDynamicResolutionSettings instance initialized with default values.</returns> 80 public static GlobalDynamicResolutionSettings NewDefault() => new GlobalDynamicResolutionSettings() 81 { 82 useMipBias = false, 83 maxPercentage = 100.0f, 84 minPercentage = 100.0f, 85 // It fall-backs to software when not supported, so it makes sense to have it on by default. 86 dynResType = DynamicResolutionType.Hardware, 87 upsampleFilter = DynamicResUpscaleFilter.CatmullRom, 88 forcedPercentage = 100.0f, 89 lowResTransparencyMinimumThreshold = 0.0f, 90 lowResVolumetricCloudsMinimumThreshold = 50.0f, 91 rayTracingHalfResThreshold = 50.0f, 92 93 DLSSUseOptimalSettings = true, 94 DLSSPerfQualitySetting = 0, 95 DLSSSharpness = 0.5f, 96 DLSSInjectionPoint = DynamicResolutionHandler.UpsamplerScheduleType.BeforePost, 97 FSR2InjectionPoint = DynamicResolutionHandler.UpsamplerScheduleType.BeforePost, 98 TAAUInjectionPoint = DynamicResolutionHandler.UpsamplerScheduleType.BeforePost, 99 defaultInjectionPoint = DynamicResolutionHandler.UpsamplerScheduleType.AfterPost, 100 advancedUpscalersByPriority = new List<AdvancedUpscalers>() { AdvancedUpscalers.STP }, 101 102 fsrOverrideSharpness = false, 103 fsrSharpness = FSRUtils.kDefaultSharpnessLinear 104 }; 105 106 /// <summary>Select whether the dynamic resolution is enabled or not.</summary> 107 public bool enabled; 108 /// <summary>Offsets the mip bias to recover mode detail. This only works if the camera is utilizing TAA.</summary> 109 public bool useMipBias; 110 111 /// <summary> Enables upsamplers available for certain platforms by priority. </summary> 112 public List<AdvancedUpscalers> advancedUpscalersByPriority; 113 114 /// <summary>Opaque quality setting of NVIDIA Deep Learning Super Sampling (DLSS). Use the system enum UnityEngine.NVIDIA.DLSSQuality to set the quality.</summary> 115 public uint DLSSPerfQualitySetting; 116 117 /// <summary>The injection point at which to apply DLSS upscaling.</summary> 118 public DynamicResolutionHandler.UpsamplerScheduleType DLSSInjectionPoint; 119 120 /// <summary>The injection point at which to apply TAAU upsampling.</summary> 121 public DynamicResolutionHandler.UpsamplerScheduleType TAAUInjectionPoint; 122 123 /// <summary>The injection point at which to apply STP upsampling.</summary> 124 public DynamicResolutionHandler.UpsamplerScheduleType STPInjectionPoint; 125 126 /// <summary>The injection point at which to apply the fallback upsampling.</summary> 127 public DynamicResolutionHandler.UpsamplerScheduleType defaultInjectionPoint; 128 129 /// <summary>Toggle NVIDIA Deep Learning Super Sampling (DLSS) automatic recommendation system for scaling and sharpness. 130 /// If this is on, the manually established scale callback for Dynamic Resolution Scaling is ignored. The sharpness setting of DLSS is also ignored. 131 /// </summary> 132 public bool DLSSUseOptimalSettings; 133 134 /// <summary>Pixel sharpness of NVIDIA Deep Leraning Super Sampling (DLSS).</summary> 135 [Range(0, 1)] 136 public float DLSSSharpness; 137 138 /// <summary>Enable sharpness control for FidelityFX 2.0 Super Resolution (FSR2).</summary> 139 public bool FSR2EnableSharpness; 140 141 /// <summary>Pixel sharpness of AMD FidelityFX 2.0 Super Resolution (FSR2).</summary> 142 [Range(0, 1)] 143 public float FSR2Sharpness; 144 145 /// <summary>Toggle AMD FidelityFX 2.0 Super Resolution (FSR2) automatic recommendation system for scaling. 146 /// If this is on, the manually established scale callback for Dynamic Resolution Scaling is ignored. 147 /// </summary> 148 public bool FSR2UseOptimalSettings; 149 150 /// <summary>Opaque quality setting of AMD FidelityFX 2.0 Super Resolution (FSR2). Use the system enum UnityEngine.AMD.FSR2Quality to set the quality.</summary> 151 public uint FSR2QualitySetting; 152 153 /// <summary>The injection point at which to apply FSR2 upscaling.</summary> 154 public DynamicResolutionHandler.UpsamplerScheduleType FSR2InjectionPoint; 155 156 /// <summary>Toggle sharpness override for AMD FidelityFX Super Resolution (FSR). 157 /// If this is on, a sharpness value specified by the user will be used instead of the default. 158 /// </summary> 159 public bool fsrOverrideSharpness; 160 161 /// <summary>Pixel sharpness of AMD FidelityFX Super Resolution (FSR).</summary> 162 [Range(0, 1)] 163 public float fsrSharpness; 164 165 /// <summary>The maximum resolution percentage that dynamic resolution can reach.</summary> 166 public float maxPercentage; 167 /// <summary>The minimum resolution percentage that dynamic resolution can reach.</summary> 168 public float minPercentage; 169 170 /// <summary>The type of dynamic resolution method.</summary> 171 public DynamicResolutionType dynResType; 172 /// <summary>The default of upscaling filter used. It can be overridden via the API DynamicResolutionHandler.SetUpscaleFilter </summary> 173 public DynamicResUpscaleFilter upsampleFilter; 174 175 /// <summary>Select whether dynamic resolution system will force a specific resolution percentage.</summary> 176 public bool forceResolution; 177 /// <summary>The resolution percentage forced in case forceResolution is set to true.</summary> 178 public float forcedPercentage; 179 180 /// <summary>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.</summary> 181 public float lowResTransparencyMinimumThreshold; 182 183 /// <summary>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.</summary> 184 public float rayTracingHalfResThreshold; 185 186 /// <summary>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.</summary> 187 public float lowResSSGIMinimumThreshold; 188 189 /// <summary>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.</summary> 190 public float lowResVolumetricCloudsMinimumThreshold; 191 192#pragma warning disable 618 // Type or member is obsolete 193 /// <summary>Obsolete, used only for data migration. Use the advancedUpscalersByPriority list instead to add the proper supported advanced upscaler by priority.</summary> 194 [Obsolete("Obsolete, used only for data migration. Use the advancedUpscalersByPriority list instead to add the proper supported advanced upscaler by priority.")] 195 public bool enableDLSS; 196#pragma warning restore 618 197 } 198}