// Crest Water System // Copyright © 2024 Wave Harmonic. All rights reserved. using UnityEngine; namespace WaveHarmonic.Crest { /// /// Settings for fine tuning the . /// [CreateAssetMenu(fileName = "DynamicWavesSettings", menuName = "Crest/Simulation Settings/Dynamic Waves")] [@HelpURL("Manual/Waves.html#dynamic-waves-settings")] public sealed partial class DynamicWavesLodSettings : LodSettings { [Header("Simulation")] [Tooltip("How much energy is dissipated each frame.\n\nHelps simulation stability, but limits how far ripples will propagate. Set this as large as possible/acceptable. Default is 0.05.")] [@Range(0f, 1f)] [@GenerateAPI] [SerializeField] internal float _Damping = 0.05f; [Tooltip("Stability control.\n\nLower values means more stable simulation, but may slow down some dynamic waves. This value should be set as large as possible until simulation instabilities/flickering begin to appear. Default is 0.7.")] [@Range(0.1f, 1f)] [@GenerateAPI] [SerializeField] internal float _CourantNumber = 0.7f; [Header("Displacement Generation")] [Tooltip("Induce horizontal displacements to sharpen simulated waves.")] [@Range(0f, 20f)] [@GenerateAPI] [SerializeField] internal float _HorizontalDisplace = 3f; [Tooltip("Clamp displacement to help prevent self-intersection in steep waves.\n\nZero means unclamped.")] [@Range(0f, 1f)] [@GenerateAPI] [SerializeField] internal float _DisplaceClamp = 0.3f; [Tooltip("Multiplier for gravity.\n\nMore gravity means dynamic waves will travel faster. Higher values can be a source of instability.")] [@Range(0f, 64f)] [@GenerateAPI] [SerializeField] internal float _GravityMultiplier = 1f; [@Heading("Culling")] [Tooltip("Adds padding to water chunk bounds.\n\nDynamic Waves displaces the surface which can push vertices outside of the chunk bounds leading to culling issues. This value adds padding to the chunk bounds to mitigate this.")] [@GenerateAPI] [@DecoratedField] [@SerializeField] internal float _VerticalDisplacementCullingContributions = 5f; } }