diff options
author | chai <215380520@qq.com> | 2024-03-13 11:00:58 +0800 |
---|---|---|
committer | chai <215380520@qq.com> | 2024-03-13 11:00:58 +0800 |
commit | 6ce8b9e22fc13be34b442c7b6af48b42cd44275a (patch) | |
tree | b38119d2acf0a982cb67e381f146924b9bfc3b3f /UnityEngine.PostProcessing/AmbientOcclusionModel.cs |
+init
Diffstat (limited to 'UnityEngine.PostProcessing/AmbientOcclusionModel.cs')
-rw-r--r-- | UnityEngine.PostProcessing/AmbientOcclusionModel.cs | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/UnityEngine.PostProcessing/AmbientOcclusionModel.cs b/UnityEngine.PostProcessing/AmbientOcclusionModel.cs new file mode 100644 index 0000000..c8fa258 --- /dev/null +++ b/UnityEngine.PostProcessing/AmbientOcclusionModel.cs @@ -0,0 +1,78 @@ +using System; + +namespace UnityEngine.PostProcessing; + +[Serializable] +public class AmbientOcclusionModel : PostProcessingModel +{ + public enum SampleCount + { + Lowest = 3, + Low = 6, + Medium = 10, + High = 16 + } + + [Serializable] + public struct Settings + { + [Range(0f, 4f)] + [Tooltip("Degree of darkness produced by the effect.")] + public float intensity; + + [Min(0.0001f)] + [Tooltip("Radius of sample points, which affects extent of darkened areas.")] + public float radius; + + [Tooltip("Number of sample points, which affects quality and performance.")] + public SampleCount sampleCount; + + [Tooltip("Halves the resolution of the effect to increase performance at the cost of visual quality.")] + public bool downsampling; + + [Tooltip("Forces compatibility with Forward rendered objects when working with the Deferred rendering path.")] + public bool forceForwardCompatibility; + + [Tooltip("Enables the ambient-only mode in that the effect only affects ambient lighting. This mode is only available with the Deferred rendering path and HDR rendering.")] + public bool ambientOnly; + + [Tooltip("Toggles the use of a higher precision depth texture with the forward rendering path (may impact performances). Has no effect with the deferred rendering path.")] + public bool highPrecision; + + public static Settings defaultSettings + { + get + { + Settings result = default(Settings); + result.intensity = 1f; + result.radius = 0.3f; + result.sampleCount = SampleCount.Medium; + result.downsampling = true; + result.forceForwardCompatibility = false; + result.ambientOnly = false; + result.highPrecision = false; + 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; + } +} |