create_spectral_waves
This computes a spectral wave simulation on a 2D grid and outputs it in a 2D wave object that may be used to displace geometry or as inputs to other simulations, like foam. The extent of the 2D simulation is defined by the bounds properties. Outside these bounds it seamlessly repeats if periodic
is enabled.
Inputs
Global Properties
periodic
Repeats the wave pattern in space. This lets you use a smaller patch to deform a larger mesh plane, but the repetition of the tile may be noticeable.
space_scale
Linear scaling factor of the patch in each of the X and Z directions. Values between 0 and 1.0 shrink the result, and values above 1.0 expand it. If the waves move too quickly or slowly after scaling, you can adjust gravity
.
speed_scale
Scale the overall speed of the simulation. A value of 1.0 is the correct speed for the patch size, units in meters (ignoring the Maya units settings) and given a gravity of 9.8.
frequency_spectra_type
Select from a variety of published spectra for frequency and direction. Note that the available models are based on measurements made under different conditions, and not every combination is suitable for any given situation. You may need to adjust wave_height
, space_scale
, and other attributes depending on the spectra types.
All frequency models are affected by wind_speed
short_scale_cutoff
and long_scale_cutoff
, however Pierson, Krylov and Curve do not use fetch
.
Pierson-Moskowitz
: The Pierson-Moskowitz spectrum is a simple model with a uniform continuum of frequencies, simulating fully developed open seas, where the waves have been influenced by the wind for a long time.Jonswap
: This is a Pierson-Moskowitz spectrum that additionally takes into account the fetch or the distance over which the wind blows. This allows it to be used for sea states that are not fully developed.Modified-Jonswap
: This has a modified spectrum that tends to have stronger high frequency waves than Jonswap for rougher seas.Krylov
: The Krylov spectrum is a model developed to describe wave spectra under storm conditions, taking into account the changing wind speed. At larger wind speeds large waves dominate, and it may tend to be smooth at small frequencies.Davidan
: This is similar to Krylov, but with a different power distribution that can result in more large scale swells.TMA
: The TMA (Texel-Marsen-Alrose) spectrum creates realistic results over a wide range of ocean depth, fetch and windspeed values. It is the most general purpose of the models.Multipeak
: This model combines a few dominant spectra to model a more complex, less fully uniform ocean state.Curve
: This scales the wave amplitude based on the wave frequency. Short wavelengths are near zero and longer wavelengths on the right. The useful range left to right is generally between 0 and 2, but very large swells are beyond that range. A horizontal line would create a uniform distribution similar to Pierson under strong wind.
frequency_spectra
This allows one to create a custom wave frequency distribution when frequency_spectra_type
is set to Curve.
Small waves are on represented on the left with longer waves to the right.
directional_spectra_type
This controls the magnitude of waves based on the angle with the wind direction. All models except for Curve and Pierson are additionally affected by wind speed and fetch.
Pierson
: This is a simple uniform distribution where waves tend to move in all directions, not following the wind direction.Jonswap
: This distribution is more focused around wind direction than Pierson, and is additionally affected by windspeed and fetch.Mitsuyasu
: This model becomes more directional in different frequencies based on factors like windspeed and fetch. Lower fetch tends to result in more directionality.Krylov
: The Krylov model is designed for storm conditions. It tends to be fairly omni directional and emphasizes large scale waves.Vonmises
: A specialized distribution that is strongly affected by wind speed and tends to work better with shallow non-stormy seas. It is moderately directional.Hyperbolic
: This tends to be strongly focused in the wind directionDoublePeak
: This distribution has a couple of dominant directions relative to the wind direction for more complex ocean conditions.Curve
: This scales the wave amplitude based on angle with the wind direction. The curve range 0-1 maps to an angle of 0-180 degrees with the wind direction. A horizontal line would be equal waves in all directions.
directional_spectra
This allows one to create a custom wave directional distribution when the directional_spectra_type
is set to Curve. Waves moving in the wind direction are at zero and moving in the opposite direction are at 1.0.
seed
The value used to initialize the pseudo-random number generator. Change this value to generate different results with the same overall characteristics.
resolution_x
The X resolution of the simulation. Higher provides finer detail but are slower to compute and use more memory. It should be a power of 2, such as 128, 256, 512, 1024.
resolution_z
The Z resolution of the simulation. Higher provides finer detail but is slower to compute and uses more memory. It should be a power of 2, such as 128, 256, 512, 1024.
velocity_method
The method used to calculate the velocity of the waves.
Analytical
: Computes the instantaneous velocity of the waves from the analytical formulation.FiniteDifference
: Computes the velocity over the time-step using a forward finite difference method. Guarantees that points remain on the surface when advected using forward Euler.
Simulation
gravity
The acceleration due to gravity. The default of 9.8 represents the strength of gravity at the earth's surface in m/s². Smaller values produce higher waves that move more slowly, and larger values produce lower waves that move more quickly. You can adjust this value to change the scale.
ocean_depth
The water depth used to calculate wave motion. Waves tend to be longer, taller, and slower in shallow water.
wave_height
An artificial multiplier for the wave height. Use values between 0.0 and 1.0 to decrease the wave height, and values above 1 to increase it.
use_horizontal_displacement
Displaces the mesh's vertices horizontally as well as vertically. This results in waves with sharper, less rounded shapes. It enables wave_peaking.
wave_peaking
When use_horizontal_displacement
is enabled this controls the amount of horizontal displacement relative to wave_height
, which results in peaked waves. Adjust this value to avoid self-intersections in the output mesh. Values over 1.0 tend to result in self intersections. Normal water waves are trochoidal shapes where higher waves are more peaked.
capillary_size
The maximum wavelength in centimeters of capillary waves (smaller, faster ripples that are propagated by surface tension and can sometimes be seen on top of the larger waves that are propagated by gravity). Capillary waves are typically visible only at small scales and high resolution, so in many cases you can leave this at 0.0 to avoid unnecessary computation.
drift_velocity_in_xz
Modifies the wave motion so that it behaves as if the water was moving with the specified velocity. This allows you to make waves on top of flowing water, like on a river or current.
short_scale_cutoff
The minimum wavelength to include in the computation.
long_scale_cutoff
The maximum wavelength to include in the computation.
Wind
wind_speed
The speed of the wind that generates the waves. A light breeze might be around 2 m/s, and a hurricane as much as 30 m/s or higher (but note that such a high wind speed requires a very large patch in order to include the longest and tallest waves).
wind_direction
The direction of the wind that generates the waves. 0 is the –X direction. 90 is the –Z direction. 180 is the +X direction. 270 is the +Z direction.
wind_fetch_distance
The distance in kilometers over which the wind has been applied to the water surface. Over small distances, waves tend to be shorter, lower, and slower. Above a threshold distance (which depends on wind speed, ocean depth, and other factors), the waves are fully developed and their overall characteristics do not change significantly.
Bounds
The bounds determines the dimension in X and Z of the water surface to compute. The simulation is confined to this region but if periodic is enabled then the output wave will seamlessly wrap outside this region.
bounds_method
This determines how the bounds are defined for the simulation.
Min_Max
: Bounds are determined by the propertiesmin_bound
andmax_bounds
Size_Center
: Bounds are determined by the propertiessize
andcenter
From_Geometry
: Bounds are determined by geometry connected intobounds_geometry
min_bound
Minimum extent in X and Z for the simulation. (when bounds_method
is Min_Max
)
max_bound
Maximum extent in X and Z for the simulation. (when bounds_method
is Min_Max
)
size
Overall size of the simulation in X and Z (when bounds_method
is Size_Center
)
center
The center position in X and Z of the simulation bounds (when bounds_method
is Size_Center
)
bounds_geometry
When bounds_method
is set to From_Geometry
the bounds are determined by the xz bounds of an object connected to bounds_geometry
.
Connect a geometry (point-based object). This can be any point object or mesh.
Multi FFT Simulation
One can generate multiple wave simulations with different rotations and sizes so that when sampled an infinite ocean is created without repeating artifacts. Also each additional simulation has a different random seed.
enable_multi_FFT
If enabled then there will be more than one wave simulation computed. Otherwise the out_wave array will just have one element.
simulation_count
This is the number of simulations to compute. The size of the out_wave array is determined by this.
rotate_step
Each additional simulation will be rotated by this step value.
size_step
Each additional simulation will be larger by this value. Negative values will make it smaller. The bounds are larger, but the frequencies and scaling are at the same scale.
Output Options
output_slope
If this is enabled the output wave will have a slope geo property, which is the XZ slope of the wave (without wave peaking).
output_velocity
If this is enabled the output wave will have a velocity geo property, which is the the XYZ velocity at the surface.
Outputs
out_wave
This is an array of wave data in a 2D image format. One may connect it to nodes like wave_displace to displace a geometry. Properties on it, such as displacement
, displacement_derivatives
, slope
and velocity
may be sampled from it for arrays of 3D points using sample_wave_property
.