Import
WaterMesh is an addon, and must be imported explicitly, see Installation#Addons.
import { WaterMesh } from 'three/addons/objects/WaterMesh.js';
Constructor
new WaterMesh( geometry : BufferGeometry, options : WaterMesh~Options )
Constructs a new water mesh.
| geometry |
The water mesh's geometry. |
| options |
The configuration options. |
Properties
.alpha : UniformNode.<float>
The alpha value.
Default is 1.
.distortionScale : UniformNode.<float>
The distortion scale.
Default is 20.
.isWaterMesh : boolean (readonly)
This flag can be used for type testing.
Default is true.
.resolutionScale : number
The effect's resolution scale.
Default is 0.5.
.size : UniformNode.<float>
The size value.
Default is 1.
.sunColor : UniformNode.<color>
The sun color.
Default is 0xffffff.
.sunDirection : UniformNode.<vec3>
The sun direction.
Default is (0.70707,0.70707,0.0).
.waterColor : UniformNode.<color>
The water color.
Default is 0x7f7f7f.
.waterNormals : TextureNode
The water's normal map.
Type Definitions
.Options
Constructor options of WaterMesh.
|
resolutionScale
number |
The resolution scale. Default is |
|
waterNormals
Texture |
The water's normal map. Default is |
|
alpha
number |
The alpha value. Default is |
|
size
number |
The size value. Default is |
|
sunColor
number | Color | string |
The sun color. Default is |
|
sunDirection
Vector3 |
The sun direction. Default is |
|
waterColor
number | Color | string |
The water color. Default is |
|
distortionScale
number |
The distortion scale. Default is |