Waves#
The Animated Waves simulation contains the animated surface shape. This typically contains the waves from shape components, but can also contain waves from the Dynamic Waves simulation. All waves will eventually be combined into this simulation so the water shader only needs to sample once to animate vertices.
Environmental Waves#
The Shape FFT component is used to generate waves in Crest.
For advanced situations where a high level of control is required over the wave shape, the Shape Gerstner component can be used to add specific wave components. It can be especially useful for Trochoidal waves and shoreline waves. See the Shoreline Waves section for more information on the latter.
Wave Conditions#
The appearance and shape of the waves is determined by a Wave Spectrum. A default wave spectrum will be created if none is specified. To author wave conditions, click the New or Clone button next to the Spectrum field. The resulting spectrum can then be edited by expanding this field.
The spectrum can be freely edited in Edit mode, and is locked by default in Play mode to save evaluating the spectrum every frame (this optimisation can be disabled using the Spectrum Fixed At Runtime toggle). The spectrum has sliders for each wavelength to control contribution of different scales of waves. To control the contribution of 2m wavelengths, use the slider labelled ‘2’. Note that the wind speed may need to be increased on the Water Renderer component in order for large wavelengths to be visible.
There is also control over how aligned waves are to the wind direction. This is controlled via the Wind Turbulence control on the Shape FFT component.
Another key control is the Chop parameter which scales the horizontal displacement. Higher chop gives crisper wave crests but can result in self-intersections or ‘inversions’ if set too high, so it needs to be balanced.
To aid in tweaking the spectrum, we provide a standard empirical wave spectrum model from the literature, called the ‘Pierson-Moskowitz’ model. To apply this model to a spectrum, select it in the Empirical Spectra section of the spectrum editor which will lock the spectrum to this model. The model can be disabled afterwards which will unlock the spectrum power sliders for hand tweaking.
Tip
Notice how the empirical spectrum places the power slider handles along a line. This is typical of real world wave conditions which will have linear power spectrums on average. However actual conditions can vary significantly based on wind conditions, land masses, etc, and we encourage experimentation to obtain visually interesting wave conditions, or conditions that work best for gameplay.
The waves will be dampened/attenuated in shallow water if a Depth simulation is used (see Depth Simulation). The amount that waves are attenuated is configurable using the Attenuation In Shallows setting.
Together these controls give the flexibility to express the great variation one can observe in real world seascapes.
User Inputs#
Waves can be applied everywhere in the world, placed along or orthogonal to a spline, or injected via a custom shader. The Shape FFT/Gerstner components supports the Global Mode, Texture Mode, Spline Mode, Paint Mode and Renderer Mode.
Global#
This is the default mode and places waves globally. Global waves are additive and multiple global wave components can be used together. Furthermore, transition between wave conditions by interpolating between the Weight property of two Shape FFT/Gerstner components.
Renderer#
The following shaders are available under Crest/Inputs/Shape Waves if using the Renderer Mode:
Add From Geometry places waves from the spectrum into the world confined to the provided mesh.
Animated Waves#
The environmental waves are termed “Animated Waves” in Crest. The Animated Waves simulation is also the displacement target where any data for vertex displacement is stored.
User Inputs#
The Animated Waves Input component can write data to the simulation and supports the Renderer Mode.
If wanting to add waves, you should use the Shape FFT/Gerstner components as detailed above. This input is more for wave manipulation, manipulating displacement or custom waves via a custom shader.
For the Animated Waves Input’s Renderer Mode, the following shaders are provided under the shader category Crest/Inputs/Animated Waves:
Push Water Under Convex Hull pushes the water underneath the geometry. Can be used to define a volume of space which should stay ‘dry’.
Wave Particle is a ‘bump’ of water. Many bumps can be combined to make interesting effects such as wakes for boats or choppy water. Based loosely on http://www.cemyuksel.com/research/waveparticles/.
Under Crest/Inputs/All there is the following:
Scale By Factor scales the waves by a factor where zero is no waves and one leaves waves unchanged. Useful for reducing waves.
Advanced Settings#
The environmental waves are termed “Animated Waves” in the Crest system and can be configured under
. Properties have detailed tooltips.Dynamic Waves#
Overview#
Environmental/animated waves are ‘static’ in that they are not influenced by objects interacting with the water. ‘Dynamic’ waves are generated from a multi-resolution simulation that can take such interactions into account.
To turn on this feature, enable
. To configure the simulation, create or assign a Dynamic Wave Lod Settings asset to Settings.The dynamic wave simulation is added on top of the animated waves to give the final shape.
The dynamic wave simulation is not suitable for use further than approximately 10km from the origin. At this kind of distance the stability of the simulation can be compromised. Use Shifting Origin to avoid travelling far distances from the world origin.
Adding Interaction Forces#
Dynamic ripples from interacting objects can be generated by placing one or more spheres under the object to approximate the object’s shape. To do so, attach one or more Sphere Water Interaction components to children on the object and set the Radius parameter to roughly match the shape.
Non-spherical objects can be approximated with multiple spheres, for an example see the Spinner object in the Boat sample scene which is composed of multiple sphere interactions. The intensity of the interaction can be scaled using the Weight setting. For an example of usages in boats, see the provided prefabs with the Boat sample.
Simulation Settings#
The simulation can be configured with a Dynamic Wave Lod Settings asset.
The key settings that impact stability of the simulation are the Damping and Courant Number settings.
The Debug GUI overlay reports the number of simulation steps taken each frame.
User Inputs#
The Dynamic Waves Input component can write data to the simulation and supports the Renderer Mode.
The recommended approach to injecting forces into the dynamic wave simulation is to use the Sphere Water Interaction component as described above. This component will compute a robust interaction force between a sphere and the water, and multiple spheres can be composed to model non-spherical shapes.
However for when more control is required, custom forces can be injected directly into the simulation using the Renderer Mode. The following input shader is provided under Crest/Inputs/Dynamic Waves:
Dampen Circle dampens dynamic waves within a circle.
Shoreline Wave Simulation#
The shallow water simulation is a new, next-generation feature for Crest and is not required for shoreline waves.
Please see Shoreline Simulation.