升级水插件

This commit is contained in:
2026-01-08 22:30:55 +08:00
parent febff82d24
commit ca68084264
415 changed files with 18138 additions and 7134 deletions

View File

@@ -245,6 +245,14 @@ namespace WaveHarmonic.Crest
/// Requires a two component texture format.
/// </remarks>
public bool EnableSignedDistanceFields { get => _EnableSignedDistanceFields; set => SetEnableSignedDistanceFields(_EnableSignedDistanceFields, _EnableSignedDistanceFields = value); }
/// <summary>
/// Whether to include the terrain height automatically.
/// </summary>
/// <remarks>
/// This will not include terrain details, nor will it produce a signed-distance field. There may also be a slight deviation due to differences in height data and terrain mesh. In these cases, please use the DepthProbe.
/// </remarks>
public bool IncludeTerrainHeight { get => _IncludeTerrainHeight; set => _IncludeTerrainHeight = value; }
}
}
@@ -740,6 +748,27 @@ namespace WaveHarmonic.Crest
}
}
namespace WaveHarmonic.Crest
{
partial class Meniscus
{
/// <summary>
/// Whether the meniscus is enabled.
/// </summary>
public bool Enabled { get => GetEnabled(); set => SetEnabled(_Enabled, _Enabled = value); }
/// <summary>
/// Any camera with this layer in its culling mask will render the meniscus.
/// </summary>
public int Layer { get => _Layer; set => _Layer = value; }
/// <summary>
/// The meniscus material.
/// </summary>
public UnityEngine.Material Material { get => _Material; set => SetMaterial(_Material, _Material = value); }
}
}
namespace WaveHarmonic.Crest
{
partial class PersistentLod
@@ -1013,6 +1042,14 @@ namespace WaveHarmonic.Crest
/// </remarks>
public float MaximumVerticalDisplacement { get => _MaximumVerticalDisplacement; set => _MaximumVerticalDisplacement = value; }
/// <summary>
/// Whether to use the wind turbulence on this component rather than the global wind turbulence.
/// </summary>
/// <remarks>
/// Global wind turbulence comes from the Water Renderer component.
/// </remarks>
public bool OverrideGlobalWindTurbulence { get => _OverrideGlobalWindTurbulence; set => _OverrideGlobalWindTurbulence = value; }
/// <summary>
/// FFT waves will loop with a period of this many seconds.
/// </summary>
@@ -1026,7 +1063,7 @@ namespace WaveHarmonic.Crest
/// <summary>
/// How turbulent/chaotic the waves are.
/// </summary>
public float WindTurbulence { get => _WindTurbulence; set => _WindTurbulence = value; }
public float WindTurbulence { get => GetWindTurbulence(); set => _WindTurbulence = value; }
}
}
@@ -1039,6 +1076,11 @@ namespace WaveHarmonic.Crest
/// </summary>
public int ComponentsPerOctave { get => _ComponentsPerOctave; set => _ComponentsPerOctave = value; }
/// <summary>
/// Prevent data arrays from being written to so one can provide their own.
/// </summary>
public bool ManualGeneration { get => _ManualGeneration; set => _ManualGeneration = value; }
/// <summary>
/// Change to get a different set of waves.
/// </summary>
@@ -1050,7 +1092,15 @@ namespace WaveHarmonic.Crest
/// <remarks>
/// Each Gerstner wave is actually a pair of waves travelling in opposite directions (similar to FFT). This weight is applied to the wave travelling in against-wind direction. Set to zero to obtain simple single waves which are useful for shorelines waves.
/// </remarks>
public float ReverseWaveWeight { get => _ReverseWaveWeight; set => _ReverseWaveWeight = value; }
public float ReverseWaveWeight { get => GetReverseWaveWeight(); set => _ReverseWaveWeight = value; }
/// <summary>
/// Use a swell spectrum as the default.
/// </summary>
/// <remarks>
/// Uses a swell spectrum as default (when none is assigned), and disabled reverse waves.
/// </remarks>
public bool Swell { get => _Swell; set => _Swell = value; }
}
}
@@ -1066,6 +1116,14 @@ namespace WaveHarmonic.Crest
/// </remarks>
public bool EvaluateSpectrumAtRunTimeEveryFrame { get => _EvaluateSpectrumAtRunTimeEveryFrame; set => _EvaluateSpectrumAtRunTimeEveryFrame = value; }
/// <summary>
/// Whether to use the wind direction on this component rather than the global wind direction.
/// </summary>
/// <remarks>
/// Global wind direction comes from the Water Renderer component.
/// </remarks>
public bool OverrideGlobalWindDirection { get => _OverrideGlobalWindDirection; set => _OverrideGlobalWindDirection = value; }
/// <summary>
/// Whether to use the wind speed on this component rather than the global wind speed.
/// </summary>
@@ -1101,7 +1159,7 @@ namespace WaveHarmonic.Crest
/// <remarks>
/// This is the angle from x axis in degrees that the waves are oriented towards. If a spline is being used to place the waves, this angle is relative to the spline.
/// </remarks>
public float WaveDirectionHeadingAngle { get => _WaveDirectionHeadingAngle; set => _WaveDirectionHeadingAngle = value; }
public float WaveDirectionHeadingAngle { get => GetWaveDirectionHeadingAngle(); set => _WaveDirectionHeadingAngle = value; }
/// <summary>
/// Wind speed in km/h. Controls wave conditions.
@@ -1203,10 +1261,79 @@ namespace WaveHarmonic.Crest
}
}
namespace WaveHarmonic.Crest
{
partial class SurfaceRenderer
{
/// <summary>
/// Whether to allow sorting using the render queue.
/// </summary>
/// <remarks>
/// If you need to change the minor part of the render queue (eg +100), then enable this option. As a side effect, it will also disable the front-to-back rendering optimization for Crest. This option does not affect changing the major part of the render queue (eg AlphaTest, Transparent), as that is always allowed.
/// </remarks>
public bool AllowRenderQueueSorting { get => _AllowRenderQueueSorting; set => _AllowRenderQueueSorting = value; }
/// <summary>
/// Have the water surface cast shadows for albedo (both foam and custom).
/// </summary>
public bool CastShadows { get => GetCastShadows(); set => _CastShadows = value; }
/// <summary>
/// Whether the underwater effect is enabled.
/// </summary>
/// <remarks>
/// Allocates/releases resources if state has changed.
/// </remarks>
public bool Enabled { get => GetEnabled(); set => SetEnabled(_Enabled, _Enabled = value); }
/// <summary>
/// The water chunk renderers will have this layer.
/// </summary>
public int Layer { get => _Layer; set => _Layer = value; }
/// <summary>
/// Material to use for the water surface.
/// </summary>
public UnityEngine.Material Material { get => _Material; set => _Material = value; }
/// <summary>
/// How many frames to distribute the chunk bounds calculation.
/// </summary>
/// <remarks>
/// The chunk bounds are calculated per frame to ensure culling is correct when using inputs that affect displacement. Some performance can be saved by distributing the load over several frames. The higher the frames, the longer it will take - lowest being instant.
/// </remarks>
public int TimeSliceBoundsUpdateFrameCount { get => _TimeSliceBoundsUpdateFrameCount; set => _TimeSliceBoundsUpdateFrameCount = value; }
/// <summary>
/// Underwater will copy from this material if set.
/// </summary>
/// <remarks>
/// Useful for overriding properties for the underwater effect. To see what properties can be overriden, see the disabled properties on the underwater material. This does not affect the surface.
/// </remarks>
public UnityEngine.Material VolumeMaterial { get => _VolumeMaterial; set => _VolumeMaterial = value; }
/// <summary>
/// Whether 'Water Body' components will cull the water tiles.
/// </summary>
/// <remarks>
/// Disable if you want to use the 'Material Override' feature and still have an ocean.
/// </remarks>
public bool WaterBodyCulling { get => _WaterBodyCulling; set => _WaterBodyCulling = value; }
}
}
namespace WaveHarmonic.Crest
{
partial class TextureLodInputData
{
/// <summary>
/// Multiplies the texture sample.
/// </summary>
/// <remarks>
/// This is useful for normalized textures. The four components map to the four color/alpha components of the texture (if they exist).
/// </remarks>
public UnityEngine.Vector4 Multiplier { get => _Multiplier; set => _Multiplier = value; }
/// <summary>
/// Texture to render into the simulation.
/// </summary>
@@ -1506,7 +1633,8 @@ namespace WaveHarmonic.Crest
/// <remarks>
/// If you need to change the minor part of the render queue (eg +100), then enable this option. As a side effect, it will also disable the front-to-back rendering optimization for Crest. This option does not affect changing the major part of the render queue (eg AlphaTest, Transparent), as that is always allowed.
/// </remarks>
public bool AllowRenderQueueSorting { get => _AllowRenderQueueSorting; set => _AllowRenderQueueSorting = value; }
[System.Obsolete("This property can now be found on WaterRenderer.Surface")]
public bool AllowRenderQueueSorting { get => GetAllowRenderQueueSorting(); set => SetAllowRenderQueueSorting(_AllowRenderQueueSorting, _AllowRenderQueueSorting = value); }
/// <summary>
/// All waves (including Dynamic Waves) are written to this simulation.
@@ -1524,7 +1652,16 @@ namespace WaveHarmonic.Crest
/// <summary>
/// Have the water surface cast shadows for albedo (both foam and custom).
/// </summary>
public bool CastShadows { get => GetCastShadows(); set => _CastShadows = value; }
[System.Obsolete("This property can now be found on WaterRenderer.Surface")]
public bool CastShadows { get => GetCastShadows(); set => SetCastShadows(_CastShadows, _CastShadows = value); }
/// <summary>
/// Keep the center of detail from drifting from the viewpoint.
/// </summary>
/// <remarks>
/// Large horizontal displacement can displace the center of detail. This uses queries to keep the center of detail aligned.
/// </remarks>
public bool CenterOfDetailDisplacementCorrection { get => _CenterOfDetailDisplacementCorrection; set => _CenterOfDetailDisplacementCorrection = value; }
/// <summary>
/// Clip surface information for clipping the water surface.
@@ -1593,10 +1730,19 @@ namespace WaveHarmonic.Crest
/// </summary>
public float GravityOverride { get => _GravityOverride; set => _GravityOverride = value; }
/// <summary>
/// When in the render pipeline the water is rendered.
/// </summary>
/// <remarks>
/// Default is the old behaviour which is controlled by Unity.
/// </remarks>
public WaterInjectionPoint InjectionPoint { get => _InjectionPoint; set => _InjectionPoint = value; }
/// <summary>
/// The water chunk renderers will have this layer.
/// </summary>
public int Layer { get => _Layer; set => _Layer = value; }
[System.Obsolete("This property can now be found on WaterRenderer.Surface")]
public int Layer { get => GetLayer(); set => SetLayer(_Layer, _Layer = value); }
/// <summary>
/// Varying water level to support water bodies at different heights and rivers to run down slopes.
@@ -1606,7 +1752,13 @@ namespace WaveHarmonic.Crest
/// <summary>
/// Material to use for the water surface.
/// </summary>
public UnityEngine.Material Material { get => _Material; set => _Material = value; }
[System.Obsolete("This property can now be found on WaterRenderer.Surface")]
public UnityEngine.Material Material { get => GetMaterial(); set => SetMaterial(_Material, _Material = value); }
/// <summary>
/// The meniscus module.
/// </summary>
public Meniscus Meniscus => _Meniscus;
/// <summary>
/// Provide your own gravity value instead of Physics.gravity.
@@ -1689,6 +1841,11 @@ namespace WaveHarmonic.Crest
/// </remarks>
public int LodLevels { get => _Slices; set => _Slices = value; }
/// <summary>
/// The water surface renderer.
/// </summary>
public SurfaceRenderer Surface => _Surface;
/// <summary>
/// The distance threshold for when the viewer has considered to have teleported.
/// </summary>
@@ -1703,7 +1860,8 @@ namespace WaveHarmonic.Crest
/// <remarks>
/// The chunk bounds are calculated per frame to ensure culling is correct when using inputs that affect displacement. Some performance can be saved by distributing the load over several frames. The higher the frames, the longer it will take - lowest being instant.
/// </remarks>
public int TimeSliceBoundsUpdateFrameCount { get => _TimeSliceBoundsUpdateFrameCount; set => _TimeSliceBoundsUpdateFrameCount = value; }
[System.Obsolete("This property can now be found on WaterRenderer.Surface")]
public int TimeSliceBoundsUpdateFrameCount { get => GetTimeSliceBoundsUpdateFrameCount(); set => SetTimeSliceBoundsUpdateFrameCount(_TimeSliceBoundsUpdateFrameCount, _TimeSliceBoundsUpdateFrameCount = value); }
/// <summary>
/// The underwater renderer.
@@ -1724,7 +1882,8 @@ namespace WaveHarmonic.Crest
/// <remarks>
/// Useful for overriding properties for the underwater effect. To see what properties can be overriden, see the disabled properties on the underwater material. This does not affect the surface.
/// </remarks>
public UnityEngine.Material VolumeMaterial { get => _VolumeMaterial; set => _VolumeMaterial = value; }
[System.Obsolete("This property can now be found on WaterRenderer.Surface")]
public UnityEngine.Material VolumeMaterial { get => GetVolumeMaterial(); set => SetVolumeMaterial(_VolumeMaterial, _VolumeMaterial = value); }
/// <summary>
/// Whether 'Water Body' components will cull the water tiles.
@@ -1732,7 +1891,16 @@ namespace WaveHarmonic.Crest
/// <remarks>
/// Disable if you want to use the 'Material Override' feature and still have an ocean.
/// </remarks>
public bool WaterBodyCulling { get => _WaterBodyCulling; set => _WaterBodyCulling = value; }
[System.Obsolete("This property can now be found on WaterRenderer.Surface")]
public bool WaterBodyCulling { get => GetWaterBodyCulling(); set => SetWaterBodyCulling(_WaterBodyCulling, _WaterBodyCulling = value); }
/// <summary>
/// Base wind direction in degrees.
/// </summary>
/// <remarks>
/// Controls wave conditions. Can be overridden on Shape* components.
/// </remarks>
public float WindDirection { get => GetWindDirection(); set => _WindDirection = value; }
/// <summary>
/// Base wind speed in km/h.
@@ -1740,7 +1908,23 @@ namespace WaveHarmonic.Crest
/// <remarks>
/// Controls wave conditions. Can be overridden on Shape* components.
/// </remarks>
public float WindSpeed { get => _WindSpeed; set => _WindSpeed = value; }
public float WindSpeed { get => GetWindSpeed(); set => _WindSpeed = value; }
/// <summary>
/// Base wind turbulence.
/// </summary>
/// <remarks>
/// Controls wave conditions. Can be overridden on ShapeFFT components.
/// </remarks>
public float WindTurbulence { get => GetWindTurbulence(); set => _WindTurbulence = value; }
/// <summary>
/// Uses a provided WindZone as the source of global wind.
/// </summary>
/// <remarks>
/// It must be directional. Wind speed units are presumed to be in m/s.
/// </remarks>
public UnityEngine.WindZone WindZone { get => _WindZone; set => _WindZone = value; }
/// <summary>
/// Whether to enable motion vector support.
@@ -1748,12 +1932,20 @@ namespace WaveHarmonic.Crest
public bool WriteMotionVectors { get => GetWriteMotionVectors(); set => _WriteMotionVectors = value; }
/// <summary>
/// Whether to write the water surface depth to the depth texture (URP only).
/// Whether to write the water surface color to the color/opaque texture.
/// </summary>
/// <remarks>
/// The water surface writes to the depth buffer, but Unity does not copy it to the depth texture for post-processing effects like Depth of Field. This will copy the depth buffer to the depth texture.
/// This is likely only beneficial if the water injection point is before transparency, and there are shaders which need it (like refraction).
/// </remarks>
public bool WriteToDepthTexture { get => _WriteToDepthTexture; set => _WriteToDepthTexture = value; }
public bool WriteToColorTexture { get => GetWriteToColorTexture(); set => _WriteToColorTexture = value; }
/// <summary>
/// Whether to write the water surface depth to the depth texture.
/// </summary>
/// <remarks>
/// The water surface writes to the depth buffer, but Unity does not copy it to the depth texture for post-processing effects like Depth of Field (or refraction). This will copy the depth buffer to the depth texture.
/// </remarks>
public bool WriteToDepthTexture { get => GetWriteToDepthTexture(); set => _WriteToDepthTexture = value; }
}
}

View File

@@ -0,0 +1,453 @@
// <auto-generated/>
// Crest Water System
// Copyright © 2024 Wave Harmonic. All rights reserved.
namespace WaveHarmonic.Crest.Generated
{
enum CollisionLayer
{
/// <summary>
/// Include all displacement.
/// </summary>
Everything,
/// <summary>
/// Only include Animated Waves.
/// </summary>
AfterAnimatedWaves,
/// <summary>
/// Include Animated Waves and Dynamic Waves.
/// </summary>
AfterDynamicWaves,
}
}
namespace WaveHarmonic.Crest.Generated
{
enum CollisionLayers
{
/// <summary>
/// All layers.
/// </summary>
Everything,
/// <summary>
/// No extra layers (ie single layer).
/// </summary>
Nothing,
/// <summary>
/// Separate layer for dynamic waves.
/// </summary>
/// <remarks>
/// Dynamic waves are normally combined together for efficiency. By enabling this layer, dynamic waves are combined and added in a separate pass.
/// </remarks>
DynamicWaves,
/// <summary>
/// Extra displacement layer for visual displacement.
/// </summary>
Displacement,
}
}
namespace WaveHarmonic.Crest.Generated
{
enum CollisionSource
{
/// <summary>
/// No collision source. Flat water.
/// </summary>
None,
/// <summary>
/// Uses AsyncGPUReadback to retrieve data from GPU to CPU.
/// </summary>
/// <remarks>
/// This is the most optimal approach.
/// </remarks>
GPU,
/// <summary>
/// Computes data entirely on the CPU.
/// </summary>
CPU,
}
}
namespace WaveHarmonic.Crest.Generated
{
enum DefaultClippingState
{
/// <summary>
/// By default, nothing is clipped. Use clip inputs to remove water.
/// </summary>
NothingClipped,
/// <summary>
/// By default, everything is clipped. Use clip inputs to add water.
/// </summary>
EverythingClipped,
}
}
namespace WaveHarmonic.Crest.Generated
{
enum DepthProbeMode
{
/// <summary>
/// Update in real-time in accordance to refresh mode.
/// </summary>
RealTime,
/// <summary>
/// Baked in the editor.
/// </summary>
Baked,
}
}
namespace WaveHarmonic.Crest.Generated
{
enum DepthProbeRefreshMode
{
/// <summary>
/// Populates the DepthProbe in Start.
/// </summary>
OnStart,
/// <summary>
/// Requires manual updating via DepthProbe.Populate.
/// </summary>
ViaScripting,
}
}
namespace WaveHarmonic.Crest.Generated
{
enum DisplacementPass
{
/// <summary>
/// Displacement that is dependent on an LOD (eg waves).
/// </summary>
/// <remarks>
/// Uses filtering to determine which LOD to write to.
/// </remarks>
LodDependent,
/// <summary>
/// Renders to all LODs.
/// </summary>
LodIndependent,
/// <summary>
/// Renders to all LODs, but as a separate pass.
/// </summary>
/// <remarks>
/// Typically used to render visual displacement which does not affect collisions.
/// </remarks>
LodIndependentLast,
}
}
namespace WaveHarmonic.Crest.Generated
{
enum FloatingObjectModel
{
/// <summary>
/// A simple model which aligns the object with the wave normal.
/// </summary>
AlignNormal,
/// <summary>
/// A more advanced model which samples water at the probes positions.
/// </summary>
Probes,
}
}
namespace WaveHarmonic.Crest.Generated
{
enum LodInputBlend
{
/// <summary>
/// No blending. Overwrites.
/// </summary>
Off,
/// <summary>
/// Additive blending.
/// </summary>
Additive,
/// <summary>
/// Takes the minimum value.
/// </summary>
Minimum,
/// <summary>
/// Takes the maximum value.
/// </summary>
Maximum,
/// <summary>
/// Applies the inverse weight to the target.
/// </summary>
/// <remarks>
/// Basically overwrites what is already in the simulation.
/// </remarks>
Alpha,
/// <summary>
/// Same as alpha except anything above zero will overwrite rather than blend.
/// </summary>
AlphaClip,
}
}
namespace WaveHarmonic.Crest.Generated
{
enum LodInputMode
{
/// <summary>
/// Unset is the serialization default.
/// </summary>
/// <remarks>
/// This will be replaced with the default mode automatically. Unset can also be used if something is invalid.
/// </remarks>
Unset,
/// <summary>
/// Hand-painted data by the user.
/// </summary>
Paint,
/// <summary>
/// Driven by a user created spline.
/// </summary>
Spline,
/// <summary>
/// Attached 'Renderer' (mesh, particle or other) used to drive data.
/// </summary>
Renderer,
/// <summary>
/// Driven by a mathematical primitive such as a cube or sphere.
/// </summary>
Primitive,
/// <summary>
/// Covers the entire water area.
/// </summary>
Global,
/// <summary>
/// Data driven by a user provided texture.
/// </summary>
Texture,
/// <summary>
/// Renders geometry using a default material.
/// </summary>
Geometry,
}
}
namespace WaveHarmonic.Crest.Generated
{
enum LodInputPrimitive
{
/// <summary>
/// Spheroid.
/// </summary>
Sphere,
/// <summary>
/// Cuboid.
/// </summary>
Cube,
/// <summary>
/// Quad.
/// </summary>
Quad,
}
}
namespace WaveHarmonic.Crest.Generated
{
enum LodTextureFormatMode
{
/// <summary>
/// Uses the Texture Format property.
/// </summary>
Manual,
/// <summary>
/// Chooses a texture format for performance.
/// </summary>
Performance,
/// <summary>
/// Chooses a texture format for precision.
/// </summary>
/// <remarks>
/// This format can reduce artifacts.
/// </remarks>
Precision,
/// <summary>
/// Chooses a texture format based on another.
/// </summary>
/// <remarks>
/// For example, Dynamic Waves will match precision of Animated Waves.
/// </remarks>
Automatic,
}
}
namespace WaveHarmonic.Crest.Generated
{
enum Placement
{
/// <summary>
/// The component is in a fixed position.
/// </summary>
Fixed,
/// <summary>
/// The component follows the transform.
/// </summary>
Transform,
/// <summary>
/// The component follows the viewpoint.
/// </summary>
Viewpoint,
}
}
namespace WaveHarmonic.Crest.Generated
{
enum QuerySource
{
/// <summary>
/// This game object's transform.
/// </summary>
Transform,
/// <summary>
/// The viewer's transform.
/// </summary>
/// <remarks>
/// The viewer is the main camera the system uses.
/// </remarks>
Viewer,
}
}
namespace WaveHarmonic.Crest.Generated
{
enum ShorelineVolumeColorSource
{
/// <summary>
/// No depth color.
/// </summary>
None,
/// <summary>
/// Depth color based on water depth.
/// </summary>
Depth,
/// <summary>
/// Depth color based on shoreline distance.
/// </summary>
Distance,
}
}
namespace WaveHarmonic.Crest.Generated
{
enum WaterInjectionPoint
{
/// <summary>
/// Renders in the default pass.
/// </summary>
/// <remarks>
/// For the water surface, this will be determined by the material (opaque or transparent). This pass is controlled by Unity, and is not compatible with certain features like soft particles.
/// </remarks>
Default,
/// <summary>
/// Renders before the transparent pass.
/// </summary>
/// <remarks>
/// This has advantages like being compatible with soft particles, refractive shaders, and possibly third-party fog.
/// </remarks>
BeforeTransparent,
}
}
namespace WaveHarmonic.Crest.Generated
{
enum WaterReflectionSide
{
/// <summary>
/// Both sides. Most expensive.
/// </summary>
Both,
/// <summary>
/// Above only. Typical for planar reflections.
/// </summary>
Above,
/// <summary>
/// Below only. For total internal reflections.
/// </summary>
Below,
}
}
namespace WaveHarmonic.Crest.Generated
{
enum WatertightHullMode
{
/// <summary>
/// Use displacement to remove water.
/// </summary>
/// <remarks>
/// Using displacement will also affect the underwater and can nest bouyant objects. Requires the displacement layer to be enabled.
/// </remarks>
Displacement,
/// <summary>
/// Clips the surface to remove water.
/// </summary>
/// <remarks>
/// This option is more precise and can be submerged.
/// </remarks>
Clip,
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3b32089d5327840948a90ac2add66a1d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: