Taos API Reference
    Preparing search index...

    Function sampleGerstnerSurface

    • Evaluate the Gerstner-spectrum surface height + normal at world (x, z) at time t. Mirrors the per-wave evalGerstner from the WGSL helpers, summed across the spectrum.

      Parameters

      • x: number

        world X.

      • z: number

        world Z.

      • t: number

        time, in seconds (matches the value the renderer passes via ocean.time).

      • waves: readonly OceanWaveSpec[]

        spectrum (same array the renderer uses; un-routed by LOD).

      • oceanLevel: number

        rest-plane Y (matches OceanLookSettings.oceanLevel).

      • Optionalout: Vec3

        optional out-param for the normal to avoid allocation when called every frame.

      Returns OceanSurfaceSample