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/GrainModel.cs | |
+init
Diffstat (limited to 'UnityEngine.PostProcessing/GrainModel.cs')
| -rw-r--r-- | UnityEngine.PostProcessing/GrainModel.cs | 59 | 
1 files changed, 59 insertions, 0 deletions
| diff --git a/UnityEngine.PostProcessing/GrainModel.cs b/UnityEngine.PostProcessing/GrainModel.cs new file mode 100644 index 0000000..20ca694 --- /dev/null +++ b/UnityEngine.PostProcessing/GrainModel.cs @@ -0,0 +1,59 @@ +using System; + +namespace UnityEngine.PostProcessing; + +[Serializable] +public class GrainModel : PostProcessingModel +{ +	[Serializable] +	public struct Settings +	{ +		[Tooltip("Enable the use of colored grain.")] +		public bool colored; + +		[Range(0f, 1f)] +		[Tooltip("Grain strength. Higher means more visible grain.")] +		public float intensity; + +		[Range(0.3f, 3f)] +		[Tooltip("Grain particle size.")] +		public float size; + +		[Range(0f, 1f)] +		[Tooltip("Controls the noisiness response curve based on scene luminance. Lower values mean less noise in dark areas.")] +		public float luminanceContribution; + +		public static Settings defaultSettings +		{ +			get +			{ +				Settings result = default(Settings); +				result.colored = true; +				result.intensity = 0.5f; +				result.size = 1f; +				result.luminanceContribution = 0.8f; +				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; +	} +} | 
