GrainModel.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System;
  2. namespace UnityEngine.PostProcessing
  3. {
  4. [Serializable]
  5. public class GrainModel : PostProcessingModel
  6. {
  7. public GrainModel.Settings settings
  8. {
  9. get
  10. {
  11. return this.m_Settings;
  12. }
  13. set
  14. {
  15. this.m_Settings = value;
  16. }
  17. }
  18. public override void Reset()
  19. {
  20. this.m_Settings = GrainModel.Settings.defaultSettings;
  21. }
  22. [SerializeField]
  23. private GrainModel.Settings m_Settings = GrainModel.Settings.defaultSettings;
  24. [Serializable]
  25. public struct Settings
  26. {
  27. public static GrainModel.Settings defaultSettings
  28. {
  29. get
  30. {
  31. return new GrainModel.Settings
  32. {
  33. colored = true,
  34. intensity = 0.5f,
  35. size = 1f,
  36. luminanceContribution = 0.8f
  37. };
  38. }
  39. }
  40. [Tooltip("Enable the use of colored grain.")]
  41. public bool colored;
  42. [Range(0f, 1f)]
  43. [Tooltip("Grain strength. Higher means more visible grain.")]
  44. public float intensity;
  45. [Range(0.3f, 3f)]
  46. [Tooltip("Grain particle size.")]
  47. public float size;
  48. [Range(0f, 1f)]
  49. [Tooltip("Controls the noisiness response curve based on scene luminance. Lower values mean less noise in dark areas.")]
  50. public float luminanceContribution;
  51. }
  52. }
  53. }