using System;
namespace UnityEngine.Rendering.Universal
{
///
/// Option to control motion blur Mode.
///
public enum MotionBlurMode
{
///
/// Use this if you don't need object motion blur.
///
CameraOnly,
///
/// Use this if you need object motion blur.
///
CameraAndObjects
}
///
/// Options to control the quality the motion blur effect.
///
public enum MotionBlurQuality
{
///
/// Use this to select low motion blur quality.
///
Low,
///
/// Use this to select medium motion blur quality.
///
Medium,
///
/// Use this to select high motion blur quality.
///
High
}
///
/// A volume component that holds settings for the motion blur effect.
///
[Serializable, VolumeComponentMenu("Post-processing/Motion Blur")]
[SupportedOnRenderPipeline(typeof(UniversalRenderPipelineAsset))]
[URPHelpURL("Post-Processing-Motion-Blur")]
public sealed class MotionBlur : VolumeComponent, IPostProcessComponent
{
///
/// The motion blur technique to use. If you don't need object motion blur, CameraOnly will result in better performance.
///
[Tooltip("The motion blur technique to use. If you don't need object motion blur, CameraOnly will result in better performance.")]
public MotionBlurModeParameter mode = new MotionBlurModeParameter(MotionBlurMode.CameraOnly);
///
/// The quality of the effect. Lower presets will result in better performance at the expense of visual quality.
///
[Tooltip("The quality of the effect. Lower presets will result in better performance at the expense of visual quality.")]
public MotionBlurQualityParameter quality = new MotionBlurQualityParameter(MotionBlurQuality.Low);
///
/// Sets the intensity of the motion blur effect. Acts as a multiplier for velocities.
///
[Tooltip("The strength of the motion blur filter. Acts as a multiplier for velocities.")]
public ClampedFloatParameter intensity = new ClampedFloatParameter(0f, 0f, 1f);
///
/// Sets the maximum length, as a fraction of the screen's full resolution, that the velocity resulting from Camera rotation can have.
/// Lower values will improve performance.
///
[Tooltip("Sets the maximum length, as a fraction of the screen's full resolution, that the velocity resulting from Camera rotation can have. Lower values will improve performance.")]
public ClampedFloatParameter clamp = new ClampedFloatParameter(0.05f, 0f, 0.2f);
///
public bool IsActive() => intensity.value > 0f;
///
[Obsolete("Unused #from(2023.1)", false)]
public bool IsTileCompatible() => false;
}
///
/// A that holds a value.
///
[Serializable]
public sealed class MotionBlurModeParameter : VolumeParameter
{
///
/// Creates a new instance.
///
/// The initial value to store in the parameter.
/// The initial override state for the parameter.
public MotionBlurModeParameter(MotionBlurMode value, bool overrideState = false) : base(value, overrideState) { }
}
///
/// A that holds a value.
///
[Serializable]
public sealed class MotionBlurQualityParameter : VolumeParameter
{
///
/// Creates a new instance.
///
/// The initial value to store in the parameter.
/// The initial override state for the parameter.
public MotionBlurQualityParameter(MotionBlurQuality value, bool overrideState = false) : base(value, overrideState) { }
}
}