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

    Class FluidSurfaceMaterial

    Shared mechanism for opaque/emissive-capable flowing liquid surfaces: noise-driven flow distortion, depth-fade edge blending, and an optional emissive glow. LavaMaterial and SlimeMaterial are thin presets on top of this -- see docs/adr/0013-unified-liquid-surface-material.md. Usable directly for a plain flowing liquid.

    Hierarchy (View Summary)

    Index
    _renderManifest: RenderManifest | undefined = undefined

    Cached render manifest to avoid frequent allocations.

    color: Color

    The base color of the fluid.

    cullMode: CullMode = CullMode.DEFAULT

    The culling mode for this material. Defaults to BACK.

    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.

    distortion: number

    The scale of the noise distortion.

    edgeColor: Color

    The color of the edge intersection.

    emissiveColor: Color

    Glow color for opaque/emissive presets (lava).

    emissiveStrength: number

    Multiplier on emissiveColor.

    flowSpeed: number

    The speed of the flow animation.

    noiseMap: Texture | undefined

    The noise texture.

    normalMap: Texture | undefined

    Optional normal map.

    time: number = 0.0

    The current time/frame for animation.

    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.

    viscosity: number

    The viscosity (controls wave properties).

    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().

    • 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