You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.4 KiB

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