Small World Engine API Reference - v0.78.00
    Preparing search index...

    Class LiquidWaveMaterialAbstract

    Shared mechanism for wave-displaced, refractive liquid surfaces: Gerstner-wave vertex displacement, screen-space refraction, Beer-Lambert depth absorption, and Worley-noise shoreline/intersection foam. OpenWaterMaterial (realistic PBR look) and StylizedWaterMaterial (toon look) are thin presets on top of this -- see docs/adr/0013-unified-liquid-surface-material.md.

    The uniform layout this packs into (StandardWebGPULayout) has zero spare float slots left after wave1/2/3 + foam params, which is why the opaque/emissive liquid family (lava, slime) is built on FluidSurfaceMaterial instead -- that layout still has headroom.

    Hierarchy (View Summary)

    Index
    _renderManifest: RenderManifest | undefined = undefined

    Cached render manifest to avoid frequent allocations.

    color: Color

    The base color of the material.

    cullMode: CullMode = CullMode.DEFAULT

    The culling mode for this material. Defaults to BACK.

    deepWaterColor: Color
    depthTest: boolean = true

    Whether the material performs depth testing. Defaults to true.

    depthWrite: boolean = true

    Whether the material writes to the depth buffer. Defaults to true.

    edgeColor: Color
    edgeSoftness: number
    foamColor: Color
    foamCutoff: number
    foamDistance: number
    foamNoiseScale: number
    foamNoiseSpeed: number
    refractionStrength: number
    speed: number
    time: number = 0.0
    transparent: boolean = false

    Whether the material is transparent. Defaults to false.

    type: string

    The type of the material.

    uuid: string = ...

    The unique identifier of the material.

    waterAbsorption: [number, number, number]
    wave1: [number, number, number, number]
    wave2: [number, number, number, number]
    wave3: [number, number, number, number]
    inspector: Record<string, InspectorField> = ...

    Fields common to every material, merged with a concrete subclass's own inspector map (e.g. StandardMaterial's metallic/roughness) via collectInspectorSchema().

    • Vertex/fragment source per backend -- the only part that differs between presets.

      Returns {
          glsl100?: { fs: string; vs: string };
          glsl300?: { fs: string; vs: string };
          wgsl?: string;
      }

    • Helper to synchronize texture offset and repeat from a given texture.

      Parameters

      • tex:
            | { offset: { x: number; y: number }; repeat: { x: number; y: number } }
            | undefined

      Returns void

    • Returns an independent copy of this material (own uuid, own color/other value-type fields) -- geometry-adjacent references like texture maps stay shared, since texture data is immutable. Used by Object3D.clone() (Maker's Duplicate command) so a duplicated object's material edits don't leak back onto the original.

      Returns AbstractMaterial