API

Class WaterMaterial

Hierarchy (View Summary)

Index
  • Constructor

    Parameters

    • name: string
    • Optionalscene: any
    • renderTargetSize: Vector2 = ...
    • forceGLSL: boolean = false

      Use the GLSL code generation for the shader (even on WebGPU). Default is false

    Returns WaterMaterial

bumpHeight: number = 0.4

Defines the bump height related to the bump map.

colorBlendFactor: number = 0.2

Defines the blend factor related to the water color.

colorBlendFactor2: number = 0.2

Defines the blend factor related to the water color (reflection, far).

diffuseColor: any = ...
disableClipPlane: boolean = false

Sets or gets whether or not automatic clipping should be enabled or not. Setting to true will save performances and will avoid calculating useless pixels in the pixel shader of the water material.

renderTargetSize: Vector2 = ...
specularColor: any = ...
specularPower: number = 64
waterColor: Color3 = ...

Defines the water color blended with the refraction (near).

waterColor2: Color3 = ...

Defines the water color blended with the reflection (far).

waveCount: number = 20

Defines the number of times waves are repeated. This is typically used to adjust waves count according to the ground's size where the material is applied on.

waveHeight: number = 0.4

Defines the height of the waves.

waveLength: number = 0.1

Defines the maximum length of a wave.

waveSpeed: number = 1.0

Defines the waves speed.

windDirection: Vector2 = ...

Defines the direction of the wind in the plane (X, Z).

windForce: number = 6

Defines the wind force.

bumpAffectsReflection: boolean
bumpSuperimpose: boolean
bumpTexture: BaseTexture
disableLighting: boolean
fresnelSeparate: boolean
maxSimultaneousLights: number
useWorldCoordinatesForWaveDeformation: boolean
  • Parameters

    • mesh: AbstractMesh
    • subMesh: SubMesh
    • OptionaluseInstances: boolean

    Returns boolean