OceanWaves Class |
Namespace: DigitalRune.Graphics
The OceanWaves type exposes the following members.
Name | Description | |
---|---|---|
OceanWaves |
Initializes a new instance of the OceanWaves class.
|
Name | Description | |
---|---|---|
Dispose |
Releases all resources used by an instance of the WaterWaves class.
(Inherited from WaterWaves.) | |
Dispose(Boolean) |
Releases the unmanaged resources used by an instance of the OceanWaves class
and optionally releases the managed resources.
(Overrides WaterWavesDispose(Boolean).) | |
Equals | (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetDisplacement |
Gets the surface displacement caused by the water waves.
| |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
Choppiness |
Gets or sets the choppiness factor which scales the horizontal displacement.
| |
CpuSize |
Gets or sets the simulation size for CPU queries using GetDisplacement(Single, Single, Vector3F, Vector3F).
| |
Directionality |
Gets or sets the directionality of the waves.
| |
DisplacementMap |
Gets (or sets) the displacement map.
(Inherited from WaterWaves.) | |
EnableCpuQueries |
Gets or sets a value indicating whether CPU queries using GetDisplacement(Single, Single, Vector3F, Vector3F) are
enabled.
| |
Gravity |
Gets or sets the gravity.
| |
HeightScale |
Gets or sets the height scale factor.
| |
IsTiling |
Gets (or sets) a value indicating whether the displacement map can be tiled seamlessly
across the water surface.
(Inherited from WaterWaves.) | |
NormalMap |
Gets (or sets) the normal map (using standard encoding, see remarks).
(Inherited from WaterWaves.) | |
Seed |
Gets or sets the seed of the random number generator.
| |
SmallWaveSuppression |
Gets or sets the small wave suppression.
| |
TextureSize |
Gets or sets the size of the displacement/normal map in texels.
| |
TileCenter |
Gets (or sets) the center of the first tile in world space.
(Inherited from WaterWaves.) | |
TileSize |
Gets or sets the size of a single tile (one texture repetition) in world space.
| |
Wind |
Gets or sets the wind velocity.
|
This class uses Fast Fourier Transformation (FFT) on the GPU to compute waves from many (several thousand) sine waves. The input wave spectrum is defined by a statistical spectrum of ocean waves. The TextureSize defines the number of waves which are computed. If TextureSize is 256, then the 256 x 256 waves are evaluated! The resulting wave textures tile seamlessly.
This class only stores the settings and final textures. The WaterWavesRenderer must be used to generated the textures at runtime. WaterWavesRenderer is a scene node renderer which handles WaterNodes. If a WaterNode references OceanWaves, the renderer creates the displacement/normal map textures and stores them in the DisplacementMap and NormalMap properties.
CPU Queries:
EnableCpuQueries can be set to to also perform a CPU FFT
on the CPU. The size of the CPU FFT is defined by CpuSize. CpuSize
is usually a lot smaller than TextureSize (e.g. 16). The CPU simulation is only
an approximation of the exact simulation on the GPU.