No Description
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.

ShadowsMidtonesHighlights.cs 2.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. using System;
  2. namespace UnityEngine.Rendering.Universal
  3. {
  4. /// <summary>
  5. /// A volume component that holds settings for the Shadows, Midtones, Highlights effect.
  6. /// </summary>
  7. [Serializable, VolumeComponentMenu("Post-processing/Shadows, Midtones, Highlights")]
  8. [SupportedOnRenderPipeline(typeof(UniversalRenderPipelineAsset))]
  9. [URPHelpURL("Post-Processing-Shadows-Midtones-Highlights")]
  10. public sealed class ShadowsMidtonesHighlights : VolumeComponent, IPostProcessComponent
  11. {
  12. /// <summary>
  13. /// Use this to control and apply a hue to the shadows.
  14. /// </summary>
  15. public Vector4Parameter shadows = new Vector4Parameter(new Vector4(1f, 1f, 1f, 0f));
  16. /// <summary>
  17. /// Use this to control and apply a hue to the midtones.
  18. /// </summary>
  19. public Vector4Parameter midtones = new Vector4Parameter(new Vector4(1f, 1f, 1f, 0f));
  20. /// <summary>
  21. /// Use this to control and apply a hue to the highlights.
  22. /// </summary>
  23. public Vector4Parameter highlights = new Vector4Parameter(new Vector4(1f, 1f, 1f, 0f));
  24. /// <summary>
  25. /// Start point of the transition between shadows and midtones.
  26. /// </summary>
  27. [Header("Shadow Limits")]
  28. [Tooltip("Start point of the transition between shadows and midtones.")]
  29. public MinFloatParameter shadowsStart = new MinFloatParameter(0f, 0f);
  30. /// <summary>
  31. /// End point of the transition between shadows and midtones.
  32. /// </summary>
  33. [Tooltip("End point of the transition between shadows and midtones.")]
  34. public MinFloatParameter shadowsEnd = new MinFloatParameter(0.3f, 0f);
  35. /// <summary>
  36. /// Start point of the transition between midtones and highlights
  37. /// </summary>
  38. [Header("Highlight Limits")]
  39. [Tooltip("Start point of the transition between midtones and highlights.")]
  40. public MinFloatParameter highlightsStart = new MinFloatParameter(0.55f, 0f);
  41. /// <summary>
  42. /// End point of the transition between midtones and highlights.
  43. /// </summary>
  44. [Tooltip("End point of the transition between midtones and highlights.")]
  45. public MinFloatParameter highlightsEnd = new MinFloatParameter(1f, 0f);
  46. /// <inheritdoc/>
  47. public bool IsActive()
  48. {
  49. var defaultState = new Vector4(1f, 1f, 1f, 0f);
  50. return shadows != defaultState
  51. || midtones != defaultState
  52. || highlights != defaultState;
  53. }
  54. /// <inheritdoc/>
  55. [Obsolete("Unused #from(2023.1)", false)]
  56. public bool IsTileCompatible() => true;
  57. }
  58. }