threejs-worldgen
    Preparing search index...

    Interface WaterPreset

    A water preset: water material parameters plus the matching FluidSurface look.

    interface WaterPreset {
        material: WaterParams;
        surface: {
            absorption?: [number, number, number];
            edge?: number;
            foam?: number;
            foamColor?: string;
            foamDensity?: number;
            foamSpeed?: [number, number];
            ior?: number;
            iterations?: number;
            mist?: number;
            mistSize?: number;
            radius?: number;
            refraction?: number;
            resolution?: number;
            roughness?: number;
            scatterColor?: string;
            shutter?: number;
            sky?: [string, string, string];
            smoothing?: number;
            spray?: [number, number];
            streaks?: number;
            tagRadius?: number;
            turbidity?: number;
        };
    }
    Index
    material: WaterParams

    For MPMSolver's materials.water.

    surface: {
        absorption?: [number, number, number];
        edge?: number;
        foam?: number;
        foamColor?: string;
        foamDensity?: number;
        foamSpeed?: [number, number];
        ior?: number;
        iterations?: number;
        mist?: number;
        mistSize?: number;
        radius?: number;
        refraction?: number;
        resolution?: number;
        roughness?: number;
        scatterColor?: string;
        shutter?: number;
        sky?: [string, string, string];
        smoothing?: number;
        spray?: [number, number];
        streaks?: number;
        tagRadius?: number;
        turbidity?: number;
    }

    For new FluidSurface(mpm, preset.surface).

    Type Declaration

    • Optionalabsorption?: [number, number, number]

      Beer–Lambert absorption of the water, per metre (linear RGB): pure water loses red first.

    • Optionaledge?: number

      Water thickness (m) over which the rim of the water fades in (anti-aliased edges; a thin film is still a reflecting surface).

    • Optionalfoam?: number

      Most whitewater coverage, 0…1.

    • OptionalfoamColor?: string

      Colour of whitewater (aerated, fast or broken water), #rrggbb.

    • OptionalfoamDensity?: number

      How opaque aerated water gets per metre of thickness (whitewater is translucent where thin).

    • OptionalfoamSpeed?: [number, number]

      Speeds (m/s) over which water turns to whitewater: none below the first, all above the second.

    • Optionalior?: number

      Index of refraction (sets the Fresnel reflectance; 1.333 for water).

    • Optionaliterations?: number

      Smoothing passes (each a horizontal and a vertical blur), 0…4.

    • Optionalmist?: number

      Opacity of one spray particle's mist.

    • OptionalmistSize?: number

      Width of a spray particle's mist, in particle spacings.

    • Optionalradius?: number

      Particle sphere radius, in particle spacings (Δx/2). About 1 makes neighbours overlap into one surface.

    • Optionalrefraction?: number

      How far the background shifts through the surface, per metre of water thickness (screen fraction).

    • Optionalresolution?: number

      Resolution of the offscreen passes relative to the drawing buffer (0.25…1).

    • Optionalroughness?: number

      Microfacet roughness of the sun highlight (0.02 glassy … 0.3 rippled).

    • OptionalscatterColor?: string

      Colour of the in-scattered light (silt, algae), #rrggbb.

    • Optionalshutter?: number

      Exposure time of the mist's motion blur, seconds (streak length = speed × shutter).

    • Optionalsky?: [string, string, string]

      Reflected sky when no envMap: zenith, horizon and ground colours, #rrggbb (scaled by the lighting's ambient).

    • Optionalsmoothing?: number

      Depth smoothing radius, in particle radii (world space; the bilateral filter keeps silhouettes).

    • Optionalspray?: [number, number]

      Spray: water where the solver's grid is nearly empty (a node mass of a full cell of 1000 kg/m³ = 1) is drawn as soft mist, not as surface; all mist below the first value, all surface above the second (needs a source with a grid).

    • Optionalstreaks?: number

      Contrast of the flow-aligned streaks in falling whitewater, 0…1.

    • OptionaltagRadius?: number

      Radius multiplier of tagged particles (buffers.state.z ≠ 0, e.g. rain splashes): small drops, not blobs.

    • Optionalturbidity?: number

      In-scattering by suspended matter, per metre: 0 is glass-clear, tens is opaque mud within centimetres.