ChannelMixer.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System;
  2. namespace UnityEngine.Rendering.Universal
  3. {
  4. [Serializable, VolumeComponentMenu("Post-processing/Channel Mixer")]
  5. public sealed class ChannelMixer : VolumeComponent, IPostProcessComponent
  6. {
  7. [Tooltip("Modify influence of the red channel in the overall mix.")]
  8. public ClampedFloatParameter redOutRedIn = new ClampedFloatParameter(100f, -200f, 200f);
  9. [Tooltip("Modify influence of the green channel in the overall mix.")]
  10. public ClampedFloatParameter redOutGreenIn = new ClampedFloatParameter(0f, -200f, 200f);
  11. [Tooltip("Modify influence of the blue channel in the overall mix.")]
  12. public ClampedFloatParameter redOutBlueIn = new ClampedFloatParameter(0f, -200f, 200f);
  13. [Tooltip("Modify influence of the red channel in the overall mix.")]
  14. public ClampedFloatParameter greenOutRedIn = new ClampedFloatParameter(0f, -200f, 200f);
  15. [Tooltip("Modify influence of the green channel in the overall mix.")]
  16. public ClampedFloatParameter greenOutGreenIn = new ClampedFloatParameter(100f, -200f, 200f);
  17. [Tooltip("Modify influence of the blue channel in the overall mix.")]
  18. public ClampedFloatParameter greenOutBlueIn = new ClampedFloatParameter(0f, -200f, 200f);
  19. [Tooltip("Modify influence of the red channel in the overall mix.")]
  20. public ClampedFloatParameter blueOutRedIn = new ClampedFloatParameter(0f, -200f, 200f);
  21. [Tooltip("Modify influence of the green channel in the overall mix.")]
  22. public ClampedFloatParameter blueOutGreenIn = new ClampedFloatParameter(0f, -200f, 200f);
  23. [Tooltip("Modify influence of the blue channel in the overall mix.")]
  24. public ClampedFloatParameter blueOutBlueIn = new ClampedFloatParameter(100f, -200f, 200f);
  25. public bool IsActive()
  26. {
  27. return redOutRedIn.value != 100f
  28. || redOutGreenIn.value != 0f
  29. || redOutBlueIn.value != 0f
  30. || greenOutRedIn.value != 0f
  31. || greenOutGreenIn.value != 100f
  32. || greenOutBlueIn.value != 0f
  33. || blueOutRedIn.value != 0f
  34. || blueOutGreenIn.value != 0f
  35. || blueOutBlueIn.value != 100f;
  36. }
  37. public bool IsTileCompatible() => true;
  38. }
  39. }