diff options
Diffstat (limited to 'Valheim_v0.141.2_r202102/Valheim/assembly_postprocessing/UnityEngine.PostProcessing/AntialiasingModel.cs')
-rw-r--r-- | Valheim_v0.141.2_r202102/Valheim/assembly_postprocessing/UnityEngine.PostProcessing/AntialiasingModel.cs | 222 |
1 files changed, 222 insertions, 0 deletions
diff --git a/Valheim_v0.141.2_r202102/Valheim/assembly_postprocessing/UnityEngine.PostProcessing/AntialiasingModel.cs b/Valheim_v0.141.2_r202102/Valheim/assembly_postprocessing/UnityEngine.PostProcessing/AntialiasingModel.cs new file mode 100644 index 0000000..d5bda1d --- /dev/null +++ b/Valheim_v0.141.2_r202102/Valheim/assembly_postprocessing/UnityEngine.PostProcessing/AntialiasingModel.cs @@ -0,0 +1,222 @@ +using System; + +namespace UnityEngine.PostProcessing; + +[Serializable] +public class AntialiasingModel : PostProcessingModel +{ + public enum Method + { + Fxaa, + Taa + } + + public enum FxaaPreset + { + ExtremePerformance, + Performance, + Default, + Quality, + ExtremeQuality + } + + [Serializable] + public struct FxaaQualitySettings + { + [Tooltip("The amount of desired sub-pixel aliasing removal. Effects the sharpeness of the output.")] + [Range(0f, 1f)] + public float subpixelAliasingRemovalAmount; + + [Tooltip("The minimum amount of local contrast required to qualify a region as containing an edge.")] + [Range(0.063f, 0.333f)] + public float edgeDetectionThreshold; + + [Tooltip("Local contrast adaptation value to disallow the algorithm from executing on the darker regions.")] + [Range(0f, 0.0833f)] + public float minimumRequiredLuminance; + + public static FxaaQualitySettings[] presets = new FxaaQualitySettings[5] + { + new FxaaQualitySettings + { + subpixelAliasingRemovalAmount = 0f, + edgeDetectionThreshold = 0.333f, + minimumRequiredLuminance = 0.0833f + }, + new FxaaQualitySettings + { + subpixelAliasingRemovalAmount = 0.25f, + edgeDetectionThreshold = 0.25f, + minimumRequiredLuminance = 0.0833f + }, + new FxaaQualitySettings + { + subpixelAliasingRemovalAmount = 0.75f, + edgeDetectionThreshold = 0.166f, + minimumRequiredLuminance = 0.0833f + }, + new FxaaQualitySettings + { + subpixelAliasingRemovalAmount = 1f, + edgeDetectionThreshold = 0.125f, + minimumRequiredLuminance = 0.0625f + }, + new FxaaQualitySettings + { + subpixelAliasingRemovalAmount = 1f, + edgeDetectionThreshold = 0.063f, + minimumRequiredLuminance = 0.0312f + } + }; + } + + [Serializable] + public struct FxaaConsoleSettings + { + [Tooltip("The amount of spread applied to the sampling coordinates while sampling for subpixel information.")] + [Range(0.33f, 0.5f)] + public float subpixelSpreadAmount; + + [Tooltip("This value dictates how sharp the edges in the image are kept; a higher value implies sharper edges.")] + [Range(2f, 8f)] + public float edgeSharpnessAmount; + + [Tooltip("The minimum amount of local contrast required to qualify a region as containing an edge.")] + [Range(0.125f, 0.25f)] + public float edgeDetectionThreshold; + + [Tooltip("Local contrast adaptation value to disallow the algorithm from executing on the darker regions.")] + [Range(0.04f, 0.06f)] + public float minimumRequiredLuminance; + + public static FxaaConsoleSettings[] presets = new FxaaConsoleSettings[5] + { + new FxaaConsoleSettings + { + subpixelSpreadAmount = 0.33f, + edgeSharpnessAmount = 8f, + edgeDetectionThreshold = 0.25f, + minimumRequiredLuminance = 0.06f + }, + new FxaaConsoleSettings + { + subpixelSpreadAmount = 0.33f, + edgeSharpnessAmount = 8f, + edgeDetectionThreshold = 0.125f, + minimumRequiredLuminance = 0.06f + }, + new FxaaConsoleSettings + { + subpixelSpreadAmount = 0.5f, + edgeSharpnessAmount = 8f, + edgeDetectionThreshold = 0.125f, + minimumRequiredLuminance = 0.05f + }, + new FxaaConsoleSettings + { + subpixelSpreadAmount = 0.5f, + edgeSharpnessAmount = 4f, + edgeDetectionThreshold = 0.125f, + minimumRequiredLuminance = 0.04f + }, + new FxaaConsoleSettings + { + subpixelSpreadAmount = 0.5f, + edgeSharpnessAmount = 2f, + edgeDetectionThreshold = 0.125f, + minimumRequiredLuminance = 0.04f + } + }; + } + + [Serializable] + public struct FxaaSettings + { + public FxaaPreset preset; + + public static FxaaSettings defaultSettings + { + get + { + FxaaSettings result = default(FxaaSettings); + result.preset = FxaaPreset.Default; + return result; + } + } + } + + [Serializable] + public struct TaaSettings + { + [Tooltip("The diameter (in texels) inside which jitter samples are spread. Smaller values result in crisper but more aliased output, while larger values result in more stable but blurrier output.")] + [Range(0.1f, 1f)] + public float jitterSpread; + + [Tooltip("Controls the amount of sharpening applied to the color buffer.")] + [Range(0f, 3f)] + public float sharpen; + + [Tooltip("The blend coefficient for a stationary fragment. Controls the percentage of history sample blended into the final color.")] + [Range(0f, 0.99f)] + public float stationaryBlending; + + [Tooltip("The blend coefficient for a fragment with significant motion. Controls the percentage of history sample blended into the final color.")] + [Range(0f, 0.99f)] + public float motionBlending; + + public static TaaSettings defaultSettings + { + get + { + TaaSettings result = default(TaaSettings); + result.jitterSpread = 0.75f; + result.sharpen = 0.3f; + result.stationaryBlending = 0.95f; + result.motionBlending = 0.85f; + return result; + } + } + } + + [Serializable] + public struct Settings + { + public Method method; + + public FxaaSettings fxaaSettings; + + public TaaSettings taaSettings; + + public static Settings defaultSettings + { + get + { + Settings result = default(Settings); + result.method = Method.Fxaa; + result.fxaaSettings = FxaaSettings.defaultSettings; + result.taaSettings = TaaSettings.defaultSettings; + return result; + } + } + } + + [SerializeField] + private Settings m_Settings = Settings.defaultSettings; + + public Settings settings + { + get + { + return m_Settings; + } + set + { + m_Settings = value; + } + } + + public override void Reset() + { + m_Settings = Settings.defaultSettings; + } +} |