namespace UnityEngine.Rendering { /// /// An Asset which holds a set of settings to use with a . /// public sealed class ProbeReferenceVolumeProfile : ScriptableObject { internal enum Version { Initial, } [SerializeField] Version version = CoreUtils.GetLastEnumValue(); // TODO: This is here just to find a place where to serialize it. It might not be the best spot. [SerializeField] internal bool freezePlacement = false; /// /// How many levels contains the probes hierarchical structure. /// [Range(2, 5)] public int simplificationLevels = 3; /// /// The size of a Cell in number of bricks. /// public int cellSizeInBricks => (int)Mathf.Pow(3, simplificationLevels); /// /// The minimum distance between two probes in meters. /// [Min(0.1f)] public float minDistanceBetweenProbes = 1.0f; /// /// Maximum subdivision in the structure. /// public int maxSubdivision => simplificationLevels + 1; // we add one for the top subdiv level which is the same size as a cell /// /// Minimum size of a brick in meters. /// public float minBrickSize => Mathf.Max(0.01f, minDistanceBetweenProbes * 3.0f); /// /// Size of the cell in meters. /// public float cellSizeInMeters => (float)cellSizeInBricks * minBrickSize; /// /// Layer mask filter for all renderers. /// public LayerMask renderersLayerMask = -1; /// /// Specifies the minimum bounding box volume of renderers to consider placing probes around. /// [Min(0)] public float minRendererVolumeSize = 0.1f; void OnEnable() { if (version != CoreUtils.GetLastEnumValue()) { // Migration code } } /// /// Determines if the Probe Reference Volume Profile is equivalent to another one. /// /// The profile to compare with. /// Whether the Probe Reference Volume Profile is equivalent to another one. public bool IsEquivalent(ProbeReferenceVolumeProfile otherProfile) { return minDistanceBetweenProbes == otherProfile.minDistanceBetweenProbes && cellSizeInMeters == otherProfile.cellSizeInMeters && simplificationLevels == otherProfile.simplificationLevels && renderersLayerMask == otherProfile.renderersLayerMask; } } }