暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

Vignette.cs 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System;
  2. namespace UnityEngine.Rendering.Universal
  3. {
  4. /// <summary>
  5. /// A volume component that holds settings for the Vignette effect.
  6. /// </summary>
  7. [Serializable, VolumeComponentMenu("Post-processing/Vignette")]
  8. [SupportedOnRenderPipeline(typeof(UniversalRenderPipelineAsset))]
  9. [URPHelpURL("post-processing-vignette")]
  10. public sealed class Vignette : VolumeComponent, IPostProcessComponent
  11. {
  12. /// <summary>
  13. /// Specifies the color of the vignette.
  14. /// </summary>
  15. [Tooltip("Vignette color.")]
  16. public ColorParameter color = new ColorParameter(Color.black, false, false, true);
  17. /// <summary>
  18. /// Sets the center point for the vignette.
  19. /// </summary>
  20. [Tooltip("Sets the vignette center point (screen center is [0.5,0.5]).")]
  21. public Vector2Parameter center = new Vector2Parameter(new Vector2(0.5f, 0.5f));
  22. /// <summary>
  23. /// Controls the strength of the vignette effect.
  24. /// </summary>
  25. [Tooltip("Use the slider to set the strength of the Vignette effect.")]
  26. public ClampedFloatParameter intensity = new ClampedFloatParameter(0f, 0f, 1f);
  27. /// <summary>
  28. /// Controls the smoothness of the vignette borders.
  29. /// </summary>
  30. [Tooltip("Smoothness of the vignette borders.")]
  31. public ClampedFloatParameter smoothness = new ClampedFloatParameter(0.2f, 0.01f, 1f);
  32. /// <summary>
  33. /// Controls how round the vignette is, lower values result in a more square vignette.
  34. /// </summary>
  35. [Tooltip("Should the vignette be perfectly round or be dependent on the current aspect ratio?")]
  36. public BoolParameter rounded = new BoolParameter(false);
  37. /// <inheritdoc/>
  38. public bool IsActive() => intensity.value > 0f;
  39. /// <inheritdoc/>
  40. [Obsolete("Unused #from(2023.1)", false)]
  41. public bool IsTileCompatible() => true;
  42. }
  43. }