Vignette.cs 1.1 KB

123456789101112131415161718192021222324252627
  1. using System;
  2. namespace UnityEngine.Rendering.Universal
  3. {
  4. [Serializable, VolumeComponentMenu("Post-processing/Vignette")]
  5. public sealed class Vignette : VolumeComponent, IPostProcessComponent
  6. {
  7. [Tooltip("Vignette color.")]
  8. public ColorParameter color = new ColorParameter(Color.black, false, false, true);
  9. [Tooltip("Sets the vignette center point (screen center is [0.5,0.5]).")]
  10. public Vector2Parameter center = new Vector2Parameter(new Vector2(0.5f, 0.5f));
  11. [Tooltip("Amount of vignetting on screen.")]
  12. public ClampedFloatParameter intensity = new ClampedFloatParameter(0f, 0f, 1f);
  13. [Tooltip("Smoothness of the vignette borders.")]
  14. public ClampedFloatParameter smoothness = new ClampedFloatParameter(0.2f, 0.01f, 1f);
  15. [Tooltip("Should the vignette be perfectly round or be dependent on the current aspect ratio?")]
  16. public BoolParameter rounded = new BoolParameter(false);
  17. public bool IsActive() => intensity.value > 0f;
  18. public bool IsTileCompatible() => true;
  19. }
  20. }