Click or drag to resize
DigitalRuneOceanWaves Class
Represents ocean waves computed using Fast Fourier Transformation and a statistical wave spectrum.
Inheritance Hierarchy

Namespace: DigitalRune.Graphics
Assembly: DigitalRune.Graphics (in DigitalRune.Graphics.dll) Version: 1.2.0.0 (1.2.1.14562)
Syntax
public class OceanWaves : WaterWaves

The OceanWaves type exposes the following members.

Constructors
  NameDescription
Public methodOceanWaves
Initializes a new instance of the OceanWaves class.
Top
Methods
  NameDescription
Public methodDispose
Releases all resources used by an instance of the WaterWaves class.
(Inherited from WaterWaves.)
Protected methodDispose(Boolean)
Releases the unmanaged resources used by an instance of the OceanWaves class and optionally releases the managed resources.
(Overrides WaterWavesDispose(Boolean).)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetDisplacement
Gets the surface displacement caused by the water waves.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyChoppiness
Gets or sets the choppiness factor which scales the horizontal displacement.
Public propertyCpuSize
Public propertyDirectionality
Gets or sets the directionality of the waves.
Public propertyDisplacementMap
Gets (or sets) the displacement map.
(Inherited from WaterWaves.)
Public propertyEnableCpuQueries
Public propertyGravity
Gets or sets the gravity.
Public propertyHeightScale
Gets or sets the height scale factor.
Public propertyIsTiling
Gets (or sets) a value indicating whether the displacement map can be tiled seamlessly across the water surface.
(Inherited from WaterWaves.)
Public propertyNormalMap
Gets (or sets) the normal map (using standard encoding, see remarks).
(Inherited from WaterWaves.)
Public propertySeed
Gets or sets the seed of the random number generator.
Public propertySmallWaveSuppression
Gets or sets the small wave suppression.
Public propertyTextureSize
Gets or sets the size of the displacement/normal map in texels.
Public propertyTileCenter
Gets (or sets) the center of the first tile in world space.
(Inherited from WaterWaves.)
Public propertyTileSize
Gets or sets the size of a single tile (one texture repetition) in world space.
Public propertyWind
Gets or sets the wind velocity.
Top
Remarks

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.

See Also