WaterFlow Class |
Namespace: DigitalRune.Graphics
The WaterFlow type exposes the following members.
Name | Description | |
---|---|---|
Dispose |
Releases all resources used by an instance of the WaterFlow class.
| |
Dispose(Boolean) |
Releases the unmanaged resources used by an instance of the WaterFlow class
and optionally releases the managed resources.
| |
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.) | |
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 | |
---|---|---|
BaseVelocity |
Gets or sets the uniform, constant velocity applied to the whole water surface.
| |
CycleDuration |
Gets or sets the cycle duration in seconds of a normal map layer.
| |
FlowMap |
Gets or sets the texture which defines the flow direction and speed.
| |
FlowMapSpeed |
Gets or sets the scale factor for flow-map-based flow.
| |
MaxSpeed |
Gets or sets the maximal speed limit.
| |
MinStrength |
Gets or sets the minimum strength of the normal maps.
| |
NoiseMapScale |
Gets or sets the world space scale of the noise map.
| |
NoiseMapStrength |
Gets or sets the noise strength.
| |
SurfaceSlopeSpeed |
Gets or sets the scale factor for surface-slope-based flow.
|
This class can be used to make the water of a WaterNode flow in user-defined directions and with user-defined speed.
Defining Flow:
Water flow is defined by three influences:
Speed and Normal Strength Limits:
Flow speed from all three influences (base velocity, surface slope and flow map) is summed up
and clamped to MaxSpeed. The intensity of normal maps should be reduced if the
water moves faster. The normal map strength have full strength when the flow speed is
zero. The normal map strength is reduced to MinStrength when the flow speed
reaches its maximum (MaxSpeed).
Reference frame:
The BaseVelocity is relative to the local space of the WaterNode.
The FlowMap is also relative to the WaterNode; it is aligned with
the local axes of the node. It fills the local AABB, and the map is always projected top-down.
Rendering Flow:
Water flow is created by scrolling the normal maps of the water into the flow direction. If
two points on the water surface have a different flow direction or flow speed, then this
creates distortion. To hide the distortions, two layers of normal maps are alternated:
One normal map layer fades in, is scrolled and before it gets too distorted it fades out. At
the same time a second normal map layer is added but with a half cycle offset.
CycleDuration defines the cycle period. The normal map cycling can cause pulsing
artifacts. Noise can be used to hide this artifact, by giving each point on the water surface
a different cycle offset. NoiseMapScale defines the scale of the applied noise
texture in x and z direction. NoiseMapStrength defines how much noise is applied
to each pixel (= how much a cycle can be offset). The noise map itself is always generated
automatically.
Limitations: Currently, the WaterRenderer does not render WaterFlow when the WaterNode also uses WaterWaves.