Unity-NorthStar / data /Packages /com.unity.render-pipelines.universal /Runtime /Overrides /LensDistortion.cs
| using System; | |
| namespace UnityEngine.Rendering.Universal | |
| { | |
| /// <summary> | |
| /// A volume component that holds settings for the Lens Distortion effect. | |
| /// </summary> | |
| [] | |
| [] | |
| [] | |
| public sealed class LensDistortion : VolumeComponent, IPostProcessComponent | |
| { | |
| /// <summary> | |
| /// Total distortion amount. | |
| /// </summary> | |
| [] | |
| public ClampedFloatParameter intensity = new ClampedFloatParameter(0f, -1f, 1f); | |
| /// <summary> | |
| /// Intensity multiplier on X axis. Set it to 0 to disable distortion on this axis. | |
| /// </summary> | |
| [] | |
| public ClampedFloatParameter xMultiplier = new ClampedFloatParameter(1f, 0f, 1f); | |
| /// <summary> | |
| /// Intensity multiplier on Y axis. Set it to 0 to disable distortion on this axis. | |
| /// </summary> | |
| [] | |
| public ClampedFloatParameter yMultiplier = new ClampedFloatParameter(1f, 0f, 1f); | |
| /// <summary> | |
| /// Distortion center point. 0.5,0.5 is center of the screen | |
| /// </summary> | |
| [] | |
| public Vector2Parameter center = new Vector2Parameter(new Vector2(0.5f, 0.5f)); | |
| /// <summary> | |
| /// Controls global screen scaling for the distortion effect. Use this to hide the screen borders when using high \"Intensity.\" | |
| /// </summary> | |
| [] | |
| public ClampedFloatParameter scale = new ClampedFloatParameter(1f, 0.01f, 5f); | |
| /// <inheritdoc/> | |
| public bool IsActive() | |
| { | |
| return Mathf.Abs(intensity.value) > 0 | |
| && (xMultiplier.value > 0f || yMultiplier.value > 0f); | |
| } | |
| /// <inheritdoc/> | |
| [] | |
| public bool IsTileCompatible() => false; | |
| } | |
| } | |