API

Class DitheredTileFadeMaterialPlugin

Applies an opaque, screen-space dithered fade for tile LOD meshes that share a Standard or PBR material.

The plugin keeps depth writing and the material's alpha mode unchanged. It affects the material color and integrated prepass outputs, but not standalone depth, shadow, picking, outline, or custom passes. Tile renderers using those passes must provide equivalent pass-specific coverage or exclude fading tiles from them.

Per-mesh bounds are runtime state. Material cloning and serialization do not copy them; use copyToMaterial to copy the enabled state to a cloned material and then configure bounds for the cloned tile meshes.

Hierarchy (View Summary)

Index
doNotSerialize: boolean = false

Specifies if the material plugin should be serialized, true to skip serialization

markAllDefinesAsDirty: () => void

Helper function to mark defines as being dirty.

name: string

Defines the name of the plugin

priority: number = 500

Defines the priority of the plugin. Lower numbers run first.

registerForExtraEvents: boolean = false

Indicates that this plugin should be notified for the extra events (HasRenderTargetTextures / FillRenderTargetTextures / HardBindForSubMesh)

resolveIncludes: boolean = false

Indicates that any #include directive in the plugin code must be replaced by the corresponding code.

Name: "DitheredTileFade"

The name used to register the plugin on a material.

  • Removes one thin instance's explicit bounds so it inherits the source mesh's bounds.

    Parameters

    • mesh: Mesh

      The source mesh containing the thin instance.

    • index: number

      The thin instance index.

    • refresh: boolean = true

      Whether to immediately upload the updated attribute buffer.

    Returns void

  • Sets both normalized Bayer interval bounds for a mesh.

    Parameters

    • mesh: DitheredTileFadeMesh

      The tile mesh or hardware instance whose draw calls use the bounds.

    • lowerBound: number

      The inclusive lower bound in the range [0, 1].

    • upperBound: number

      The exclusive upper bound in the range [0, 1].

    Returns void

    Bounds are independent. A lower bound greater than or equal to the upper bound intentionally produces an empty interval.

  • Sets normalized Bayer interval bounds for one thin instance.

    Parameters

    • mesh: Mesh

      The source mesh containing the thin instance.

    • index: number

      The thin instance index.

    • lowerBound: number

      The inclusive lower bound in the range [0, 1].

    • upperBound: number

      The exclusive upper bound in the range [0, 1].

    • refresh: boolean = true

      Whether to immediately upload the updated attribute buffer.

    Returns void

  • Sets normalized Bayer interval bounds for all thin instances from packed lower/upper pairs.

    Parameters

    • mesh: Mesh

      The source mesh containing the thin instances.

    • bounds: Float32Array

      Packed lower/upper pairs, with two values per thin instance.

    Returns void