ShadowsMidtonesHighlights.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. namespace UnityEngine.Rendering.Universal
  3. {
  4. [Serializable, VolumeComponentMenu("Post-processing/Shadows, Midtones, Highlights")]
  5. public sealed class ShadowsMidtonesHighlights : VolumeComponent, IPostProcessComponent
  6. {
  7. [Tooltip("Controls the darkest portions of the render.")]
  8. public Vector4Parameter shadows = new Vector4Parameter(new Vector4(1f, 1f, 1f, 0f));
  9. [Tooltip("Power function that controls mid-range tones.")]
  10. public Vector4Parameter midtones = new Vector4Parameter(new Vector4(1f, 1f, 1f, 0f));
  11. [Tooltip("Controls the lightest portions of the render.")]
  12. public Vector4Parameter highlights = new Vector4Parameter(new Vector4(1f, 1f, 1f, 0f));
  13. [Tooltip("Start point of the transition between shadows and midtones.")]
  14. public MinFloatParameter shadowsStart = new MinFloatParameter(0f, 0f);
  15. [Tooltip("End point of the transition between shadows and midtones.")]
  16. public MinFloatParameter shadowsEnd = new MinFloatParameter(0.3f, 0f);
  17. [Tooltip("Start point of the transition between midtones and highlights.")]
  18. public MinFloatParameter highlightsStart = new MinFloatParameter(0.55f, 0f);
  19. [Tooltip("End point of the transition between midtones and highlights.")]
  20. public MinFloatParameter highlightsEnd = new MinFloatParameter(1f, 0f);
  21. public bool IsActive()
  22. {
  23. var defaultState = new Vector4(1f, 1f, 1f, 0f);
  24. return shadows != defaultState
  25. || midtones != defaultState
  26. || highlights != defaultState;
  27. }
  28. public bool IsTileCompatible() => true;
  29. }
  30. }