Taos API Reference
    Preparing search index...

    Class GeometryFeature

    Deferred geometry pass for material-bearing meshes. Reads frame.opaque and writes the GBuffer into frame.gbuffer. When frame.gbuffer is already set (e.g. by a preceding voxel or marching-cubes feature) this feature loads it and overdraws — letting a deferred scene mix voxel terrain with regular mesh objects.

    Implements

    Index

    Constructors

    Properties

    name: string = GeometryFeature.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.

    pass: GeometryPass | null = null

    Accessors

    • get prevHiZ(): | {
          texture: GPUTexture;
          width: number;
          height: number;
          mipCount: number;
          viewProj: Mat4;
      }
      | null

      The previous frame's Hi-Z pyramid + the view-projection its depth was rendered with, for other cull paths (terrain patch culling) to share. Null until the first pyramid build, after a resize, or with occlusion culling off. Valid only when the current frame size still matches.

      Returns
          | {
              texture: GPUTexture;
              width: number;
              height: number;
              mipCount: number;
              viewProj: Mat4;
          }
          | null

    Methods

    • Register an ADDITIVE source of instanced batches, merged with the constructor's instancedBatches option every frame. Lets independent systems (terrain foliage, prop scatterers) contribute instanced geometry without owning the feature's configuration. Returns an unregister fn.

      Parameters

      Returns () => void

    • Toggle GPU occlusion culling at runtime. Disabling falls back to plain drawIndexed next frame; re-enabling rebuilds the pyramid before it culls again (one warm-up frame).

      Parameters

      • enabled: boolean

      Returns void