267 lines
11 KiB
C#
267 lines
11 KiB
C#
// <auto-generated/>
|
|
|
|
// Crest Water System
|
|
// Copyright © 2024 Wave Harmonic. All rights reserved.
|
|
|
|
namespace WaveHarmonic.Crest.ShallowWater
|
|
{
|
|
partial class ShallowWaterSimulation
|
|
{
|
|
/// <summary>
|
|
/// Adds meters of additional water into the simulation domain on initialization.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Requires resetting the simulation.
|
|
/// </remarks>
|
|
public float AdditionalWater { get => _AdditionalWater; set => _AdditionalWater = value; }
|
|
|
|
/// <summary>
|
|
/// Affects depth-based blending of the simulation and animated waves (m).
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// For the minimum, when the water depth is less than this value, animated waves will not contribute at all, water shape will come purely from this simulation.
|
|
/// </remarks>
|
|
public UnityEngine.Vector2 BlendDepthRange { get => _BlendDepthRange; set => _BlendDepthRange = value; }
|
|
|
|
/// <summary>
|
|
/// The intensity at which waves inject water into the simulation.
|
|
/// </summary>
|
|
public float BlendPushUpStrength { get => _BlendPushUpStrength; set => _BlendPushUpStrength = value; }
|
|
|
|
/// <summary>
|
|
/// Filters the mask.
|
|
/// </summary>
|
|
public int BlurMaskIterations { get => _BlurMaskIterations; set => _BlurMaskIterations = value; }
|
|
|
|
/// <summary>
|
|
/// Filters the shape prior to rendering to smooth out sharp features.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Always enabled when baking.
|
|
/// </remarks>
|
|
public bool BlurShapeForRender { get => _BlurShapeForRender; set => _BlurShapeForRender = value; }
|
|
|
|
/// <summary>
|
|
/// Stability measure - limits velocities. Default 0.5.
|
|
/// </summary>
|
|
public float CourantNumber { get => _CourantNumber; set => _CourantNumber = value; }
|
|
|
|
/// <summary>
|
|
/// Disable simulation if viewpoint is more than this distance outside simulation domain.
|
|
/// </summary>
|
|
public float CullDistance { get => _CullDistance; set => _CullDistance = value; }
|
|
|
|
/// <summary>
|
|
/// The speed of the transition to its culled state.
|
|
/// </summary>
|
|
public float CullTransitionSpeed { get => _CullTransitionSpeed; set => _CullTransitionSpeed = value; }
|
|
|
|
/// <summary>
|
|
/// The depth of the water in the shallow water simulation (m).
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Any underwater surfaces deeper than this depth will not influence the sim. Large values can lead to instabilities / jitter in the result. Requires resetting the simulation.
|
|
/// </remarks>
|
|
public float Depth { get => _Depth; set => _Depth = value; }
|
|
|
|
/// <summary>
|
|
/// Rate at which to remove water at the boundaries of the domain.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Useful for preventing buildup of water when simulating shoreline waves.
|
|
/// </remarks>
|
|
public float DrainWaterAtBoundaries { get => _DrainWaterAtBoundaries; set => _DrainWaterAtBoundaries = value; }
|
|
|
|
/// <summary>
|
|
/// Recompute ground heights every frame.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Only enable this if terrain used by water system changes at runtime.
|
|
/// </remarks>
|
|
public bool DynamicSeabed { get => _DynamicSeabed; set => _DynamicSeabed = value; }
|
|
|
|
/// <summary>
|
|
/// Disable simulation when viewpoint far from domain.
|
|
/// </summary>
|
|
public bool EnableDistanceCulling { get => _EnableDistanceCulling; set => _EnableDistanceCulling = value; }
|
|
|
|
/// <summary>
|
|
/// Rate at which to remove water at any location.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Useful for removing remaining water from lowering tides.
|
|
/// </remarks>
|
|
public float Evaporation { get => _Evaporation; set => _Evaporation = value; }
|
|
|
|
/// <summary>
|
|
/// Multiplies flow output to scale when injecting.
|
|
/// </summary>
|
|
public float FlowStrength { get => _FlowStrength; set => _FlowStrength = value; }
|
|
|
|
/// <summary>
|
|
/// The baked texture for flow.
|
|
/// </summary>
|
|
public UnityEngine.Texture2D FlowTexture { get => _FlowTexture; set => _FlowTexture = value; }
|
|
|
|
/// <summary>
|
|
/// Multiplies foam output to scale when injecting.
|
|
/// </summary>
|
|
public float FoamStrength { get => _FoamStrength; set => _FoamStrength = value; }
|
|
|
|
/// <summary>
|
|
/// The baked texture for foam.
|
|
/// </summary>
|
|
public UnityEngine.Texture2D FoamTexture { get => _FoamTexture; set => _FoamTexture = value; }
|
|
|
|
/// <summary>
|
|
/// Friction applied to water to prevent dampen velocities.
|
|
/// </summary>
|
|
public float Friction { get => _Friction; set => _Friction = value; }
|
|
|
|
/// <summary>
|
|
/// Add the resulting flow velocities to the water system.
|
|
/// </summary>
|
|
public bool InjectFlow { get => _InjectFlow; set => _InjectFlow = value; }
|
|
|
|
/// <summary>
|
|
/// Add the resulting foam to the water system.
|
|
/// </summary>
|
|
public bool InjectFoam { get => _InjectFoam; set => _InjectFoam = value; }
|
|
|
|
/// <summary>
|
|
/// Add the resulting shape to the water system.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// If blending data from waves or height then use Waves or Level respectively. Requires resetting the simulation.
|
|
/// </remarks>
|
|
public ShallowWaterSimulationInjection InjectShape { get => _InjectShape; set => _InjectShape = value; }
|
|
|
|
/// <summary>
|
|
/// The baked texture for water level.
|
|
/// </summary>
|
|
public UnityEngine.Texture2D LevelTexture { get => _LevelTexture; set => _LevelTexture = value; }
|
|
|
|
/// <summary>
|
|
/// Inform water how much this input will displace the water surface vertically.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// This is used for culling water tiles.
|
|
/// </remarks>
|
|
public float MaximumDisplacementVertical { get => _MaximumDisplacementVertical; set => _MaximumDisplacementVertical = value; }
|
|
|
|
/// <summary>
|
|
/// Maximum resolution of simulation grid.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Safety limit to avoid simulation using large amount of video memory. Requires resetting the simulation.
|
|
/// </remarks>
|
|
public int MaximumResolution { get => _MaximumResolution; set => _MaximumResolution = value; }
|
|
|
|
/// <summary>
|
|
/// Whether to use the baked textures.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Only supported by water level.
|
|
/// </remarks>
|
|
public ShallowWaterSimulationMode Mode { get => _Mode; set => _Mode = value; }
|
|
|
|
/// <summary>
|
|
/// Overshoot is artifacts where the water will spike sharply.
|
|
/// </summary>
|
|
public float OvershootReductionStrength { get => _OvershootReductionStrength; set => _OvershootReductionStrength = value; }
|
|
|
|
/// <summary>
|
|
/// Padding area for zero activity at the edge of the domain.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Adds padding so that simulation edge can overlap with height inputs without causing a seam (m). It is important that the padding fully overlaps the water level input, or there may be a gap. Visualized by the gizmo.
|
|
/// </remarks>
|
|
public float PaddingWidth { get => _PaddingWidth; set => _PaddingWidth = value; }
|
|
|
|
/// <summary>
|
|
/// Places the simulation at sea level.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Requires resetting the simulation.
|
|
/// </remarks>
|
|
public bool PlaceAtSeaLevel { get => _PlaceAtSeaLevel; set => _PlaceAtSeaLevel = value; }
|
|
|
|
/// <summary>
|
|
/// Where the simulation is placed.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// The default performs the best.
|
|
/// </remarks>
|
|
public WaveHarmonic.Crest.Placement Placement { get => GetPlacement(); set => _Placement = value; }
|
|
|
|
/// <summary>
|
|
/// Preconfigures the simulation for a specific use case.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Requires resetting the simulation.
|
|
/// </remarks>
|
|
public ShallowWaterSimulationPreset Preset { get => _Preset; set => SetPreset(_Preset, _Preset = value); }
|
|
|
|
/// <summary>
|
|
/// Whether to sample the Depth Probe directly.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// If disabled then data will come from the LODs which will have precision losses depending on camera position. Only disable if necessary. Requires resetting the simulation.
|
|
/// </remarks>
|
|
public bool SampleDepthProbeDirectly { get => _SampleDepthProbeDirectly; set => _SampleDepthProbeDirectly = value; }
|
|
|
|
/// <summary>
|
|
/// Whether to sample water level inputs directly.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// If disabled then data will come from the LODs which will have precision losses depending on camera position. Only disable if necessary. This option only supports water level inputs using the Geometry, Spline or Renderer modes. Requires resetting the simulation.
|
|
/// </remarks>
|
|
public bool SampleWaterLevelInputsDirectly { get => GetSampleWaterLevelInputsDirectly(); set => _SampleWaterLevelInputsDirectly = value; }
|
|
|
|
/// <summary>
|
|
/// Simulation resolution - width of simulation grid cell (m).
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Smaller values will increase resolution but take more computation time and memory, and may lead to instabilities for small values. Requires resetting the simulation.
|
|
/// </remarks>
|
|
public float TexelSize { get => _TexelSize; set => _TexelSize = value; }
|
|
|
|
/// <summary>
|
|
/// Time step used for simulation (s).
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Smaller values can make simulation more stable but requires more runtime computation.
|
|
/// </remarks>
|
|
public float TimeStep { get => _TimeStep; set => _TimeStep = value; }
|
|
|
|
/// <summary>
|
|
/// Adds a margin around the water level to prevent water from degenerating at a distance and prevents water wall creep (px).
|
|
/// </summary>
|
|
public bool WaterEdgeMargin { get => _WaterEdgeMargin; set => _WaterEdgeMargin = value; }
|
|
|
|
/// <summary>
|
|
/// Same as Margin Width but for baking only.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Will use the larger value of the two.
|
|
/// </remarks>
|
|
public int WaterEdgeMarginBakedWidth { get => _WaterEdgeMarginBakedWidth; set => _WaterEdgeMarginBakedWidth = value; }
|
|
|
|
/// <summary>
|
|
/// Width of the margin.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// The default is the optimal width.
|
|
/// </remarks>
|
|
public int WaterEdgeMarginWidth { get => _WaterEdgeMarginWidth; set => _WaterEdgeMarginWidth = value; }
|
|
|
|
/// <summary>
|
|
/// The width of the simulation area (m).
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Enable gizmos to see a wireframe outline of the domain. Requires resetting the simulation.
|
|
/// </remarks>
|
|
public float Width { get => _Width; set => _Width = value; }
|
|
}
|
|
}
|