Taos API Reference
    Preparing search index...

    Class TerrainTileset

    Index

    Constructors

    Properties

    maxSSE: number = DEFAULT_MAX_SSE

    Target screen-space error in pixels for THIS terrain — CesiumJS's maximumScreenSpaceError. Lower = sharper / more tiles. Per-instance so terrain tunes independently of any 3D Tiles tileset rendered alongside it.

    balanceLod: boolean = true

    Enforce a restricted ("2:1 balanced") quadtree: no rendered tile may sit beside a neighbor more than maxLevelDifference levels finer. Without this, two edge-adjacent tiles pick their LOD independently from screen-space error and can end up several levels apart, so the fine tile's high-resolution edge hangs off the coarse neighbor's low-resolution one — the abrupt seam the skirts then paper over with a tall vertical curtain. Capping the jump to one level shrinks that gap to a single level's geometric error (a gentle step a thin skirt hides). On by default; turn off to compare. The same restricted-quadtree rule CDLOD and geometry clipmaps rely on.

    maxLevelDifference: number = 1

    Max LOD-level difference permitted between edge-adjacent rendered tiles when balanceLod is on. 1 = the classic 2:1 rule.

    skirtScale: number = 1

    Multiplies the per-tile skirt depth baked by buildTerrainContent — the vertical curtain that hides residual LOD-seam cracks. Higher sinks it deeper (covers stubborn gaps at the cost of a visible sliver at grazing angles); 0 removes skirts to expose the raw cracks. Baked into the mesh, so a change only affects tiles built afterwards — call clearCache to rebuild the resident ones.

    upsample: boolean = true

    Fill missing child quadrants at a data-availability boundary by upsampling the parent mesh (CesiumJS's upsampleQuantizedTerrainMesh), instead of refining into only the available children and tearing a hole in the rest. The fills carry no new detail — they're the parent surface clipped to the quadrant at finer tessellation — but they keep the quadtree hole-free and LOD-balanced where high-res data abuts a coarsely-covered region. On by default; turn off to expose the raw availability holes. See upsampleQuantizedMesh.

    workerBake: boolean = true

    Bake terrain geometry (the per-vertex geodetic→ECEF→world transform + skirts) on a Worker pool instead of inline on the render thread, so streaming tiles don't hitch the frame (the jank that reads as LOD pop). Falls back to inline baking automatically if the worker can't start (see TerrainBakePool). On by default; turn off to bake inline (e.g. to compare or to debug).

    preloadMargin: number = 0

    Preload ring (world meters): after selecting the visible tiles each frame, warm the content of selection leaves within this distance of the frustum (just off-screen) at a deprioritized urgency, so panning doesn't reveal unloaded terrain. 0 = off (no warm pass, the default — never changes existing behavior). Set per frame, ideally scaled to camera altitude. Mirrors Tileset3D.preloadMargin.

    stats: TerrainStats = ...

    Accessors

    • get imageryAttribution(): string | null

      Attribution for the active imagery drape, or null when draping is off.

      Returns string | null

    • get maxAvailableLevel(): number

      Deepest level the layer.json available ranges (+ any merged metadata-extension availability) say tiles exist — the hard cap on refinement, independent of SSE. Exposed so the sample can show "are we capped by availability or by pixel error?".

      Returns number

    Methods

    • Drops all built tiles so they re-stream and rebuild — used when a bake-time parameter changes (skirtScale). The cached tight bounds / height ranges / availability are kept (they don't depend on the rebuilt geometry).

      Returns void

    • Ellipsoid-relative terrain height (meters) at (lon, lat) in radians, sampled from the currently-rendered tiles, or null when none cover the point yet (so a caller can fall back / wait for terrain to stream in). When tiles overlap, the deepest (highest-LOD, most accurate) covering tile wins. Cheap enough to call per building tile per frame — each tile's lookup is grid-bucketed (~O(1)).

      Parameters

      • lonRad: number
      • latRad: number

      Returns number | null

    • Whether (lon, lat) in radians is water (ocean / inland water), from the watermask extension of the currently-rendered tiles — the deepest (highest LOD) covering tile that actually carries a mask wins. Returns null when no rendered tile covers the point or none carried a mask (the provider didn't send one), so a caller can distinguish "land" from "unknown".

      Parameters

      • lonRad: number
      • latRad: number

      Returns boolean | null