Taos API Reference
    Preparing search index...

    Interface OceanFeatureOptions

    interface OceanFeatureOptions {
        skyTexture?: Texture;
        lod?: Partial<OceanLodConfig>;
        sun?: () => { direction: Vec3; color: Vec3; intensity: number } | null;
        dynamicWaves?: OceanDynWavesOptions;
        fftSim?: OceanFftSimOptions;
        foamSim?: OceanFoamSimOptions;
        depthCache?: OceanDepthCacheOptions;
        attenuationInShallows?: number;
        receiveShadows?: boolean;
        shadowStrength?: number;
        aerial?: { volumeMaxDist?: number; maxOpacity?: number };
        seafloorY?: number;
        dropDetailHeightBasedOnWaves?: number;
        fftFoamVariance?: boolean;
        underwater?: OceanUnderwaterOptions;
        chunkSubdivisions?: number;
        skirtMultiplier?: number;
        waves?: OceanWaveSpec[];
        look?: Partial<OceanLookSettings>;
    }

    Hierarchy (View Summary)

    Index

    Properties

    skyTexture?: Texture

    Sky panorama sampled for the surface reflection when no reflection probe is wired in. Optional — when omitted, a 1×1 dummy panorama is bound and the host is expected to call setReflectionProbeView with a real cube so the shader actually has something to reflect.

    lod?: Partial<OceanLodConfig>

    Per-LOD math. Defaults to 7 LODs, baseScale 16 m, 256 texels, min 2 texels per wave — gives a 2 km outer extent with the spectrum spanning ~0.5..64 m wavelengths (matches defaultOceanWaves).

    sun?: () => { direction: Vec3; color: Vec3; intensity: number } | null

    Override how the feature picks the sun. Defaults to the scene's first DirectionalLight.

    dynamicWaves?: OceanDynWavesOptions

    Persistent per-LOD dynamic-wave sim (wakes, splashes, interaction ripples) — world-anchored, folded into the displacement cascade by ShapeCombine, and feeding the foam sim via the combined Jacobian. Always created; pass options to tune. Drive it with addDynamicSource.

    Cascaded FFT wave spectrum (16 octave tiles, Pierson–Moskowitz + directional spreading) folded into the LOD cascade by wavelength — no visible tiling. Pass an options object to enable.

    foamSim?: OceanFoamSimOptions

    Persistent per-LOD foam sim (fade + Jacobian-pinch spawn + shoreline). Always created; pass options to tune.

    depthCache?: OceanDepthCacheOptions

    Seabed depth cache — bakes the scene's shadow-caster meshes top-down into a height texture once at startup. Drives per-band shallow-water wave attenuation, shoreline foam and the shallow scatter colour from REAL geometry. Omit (or size <= 0) for deep-water-everywhere.

    attenuationInShallows?: number

    Shallow-water wave attenuation strength in [0, 1] — how completely waves die as the depth-cache water depth → 0. Default 0.95 (Crest's default).

    receiveShadows?: boolean

    Receive the scene's directional cascaded shadows on the water (soft term darkens scatter/SSS, hard term gates sun specular, caustics and foam sun-diffuse). Default true — active whenever a shadow feature runs in cascade mode.

    shadowStrength?: number

    How strongly the soft shadow darkens the scatter/SSS in [0, 1]. Default 0.8.

    aerial?: { volumeMaxDist?: number; maxOpacity?: number }

    Aerial-perspective params the froxel volume was marched with — must match the deferred feature's setAerialAtmosphere values. Defaults to the Earth values, matching a bare DeferredLightingFeature({ enableAerial: true }).

    seafloorY?: number

    Analytical seafloor Y (world units). When set, the surface fragment uses this to derive a deep-water depth fog at pixels where the rendered scene is the sky. Default −25 m.

    dropDetailHeightBasedOnWaves?: number

    How much the estimated max vertical wave displacement inflates the viewer height driving the altitude clipmap zoom — big seas drop detail earlier (Crest's _dropDetailHeightBasedOnWaves). Default 0.2.

    fftFoamVariance?: boolean

    Include the FFT slices in the cumulative foam variance. Crest's FFT path writes ZERO variance (its FFTCompute outputs w = 0; only the Gerstner shape fills the heuristic), so its FFT-driven scenes spawn foam purely from Jacobian pinching — set false to match. Our default (true) extends the heuristic to FFT content so coarse LODs still foam for detail they can't resolve.

    underwater?: OceanUnderwaterOptions

    Underwater curtain. Pass an options object to enable; the pass tints HDR with absorption when the camera dips below the ocean rest plane.

    chunkSubdivisions?: number

    Tessellation density per LOD chunk. Default 64 — ≈2 displacement texels per quad at the 256-texel cascade, Crest's geometry/data ratio (its _geometryDownSampleFactor 2).

    skirtMultiplier?: number

    Horizon-skirt stretch: the outermost ring's outer-edge vertices are pushed out by this factor so a single band of long flat triangles covers from the last ring to the far plane (Crest's FatXOuter patches × _extentsSizeMultiplier). Default 100 (~200 km at the default 2 km extent). Set ≤ 1 to disable (the ocean then visibly ends at the cascade's outer extent).

    waves?: OceanWaveSpec[]

    Initial wave spectrum.

    Initial surface look.