Taos API Reference
    Preparing search index...

    Class OceanFeature

    Implements

    Index

    Constructors

    Properties

    name: string = OceanFeature.name

    Stable identifier used for lookup, signature hashing, and pass-name keying.

    enabled: boolean = true

    When false, the feature is skipped each frame. Toggling triggers a cached-graph invalidation.

    surfacePass: OceanPass | null = null
    inputsPass: OceanWaveInputsPass | null = null
    combinePass: OceanShapeCombinePass | null = null
    dynamicSimPass: OceanDynamicSimPass | null = null
    fftSimPass: OceanFftSimPass | null = null
    fftSim2Pass: OceanFftSimPass | null = null
    underwaterPass: OceanUnderwaterPass | null = null

    Methods

    • Enable shallow-water wave attenuation around a circular shoal (e.g. an island): waves shrink toward the shore where the water shallows. The water depth at world distance d from (centerX, centerZ) is taken as max(d − shoreRadius, 0) · depthSlope. Pass depthSlope <= 0 to disable. See OceanPass.setShoal.

      Parameters

      • centerX: number
      • centerZ: number
      • shoreRadius: number
      • depthSlope: number

      Returns void

    • Register a custom wave input — point ripples, future object-attached wakes, brush strokes, etc. The input's setup runs immediately and it joins the per-frame update + per-LOD draw loop.

      Parameters

      Returns void

    • Register a persistent dynamic-wave disturbance source (boat splat, dropped object, depth-charge, etc.). The disturbance is re-applied every frame at its current position, so updating the source's position from per-frame game code (e.g. a beforeFrame hook tracking a GameObject) is enough to drive a moving wake.

      Parameters

      Returns void

    • Wire a reflection-probe cube view into the surface fragment's reflection sample. Pass null to fall back to the configured sky panorama. The view must have dimension: 'cube' — slice a cube-array down to a single cube before passing it in.

      Parameters

      Returns void

    • CPU surface query. Returns the Gerstner-spectrum surface height + normal at world (x, z) at the current frame time. Useful for buoyancy / collision / camera-on-water effects. Does NOT include the dynamic-sim contribution (GPU-resident; not worth a readback for the typical "object is its own wake source" case).

      Parameters

      • x: number
      • z: number
      • Optionalout: Vec3

      Returns OceanSurfaceSample