A MeshBatchImpl manages a batch of SceneMeshes that use the same primitive type.

Implements

Constructors

  • Creates a new MeshBatchImpl instance.

    Parameters

    • batchParams: {
          bin?: string;
          gpuMemoryBatchIndex: number;
          gpuMemoryManager: GPUMemoryManager;
          hasNormals: boolean;
          hasUVs: boolean;
          mipmap: boolean;
          primitive: number;
          renderContext: RenderContext;
          triplanar: boolean;
      }

    Returns MeshBatchImpl

Properties

bin?: string

Free-form bin identifier shared by every mesh in this batch. MeshManager hashes meshes into batches by this value so a batch is always bin-homogeneous; undefined means the implicit "default" bin. The renderer reads this to schedule a separate overlay pass with the depth buffer cleared.

gpuMemoryBatchIndex: number

The index of this batch in the GPUMemoryManager system.

hasNormals: boolean

Whether the geometries in this batch carry per-vertex normals.

Set at construction from the first mesh that lands in the batch and never mutates afterward — MeshManager prevents geometries with a different hasNormals value from joining.

hasUVs: boolean

Whether the geometries in this batch carry per-vertex UV coordinates.

Independent axis from hasNormals; same constancy guarantee.

mipmap: boolean

Whether this batch's atlases carry mip pyramids and sample trilinearly. Derived from the meshes' materials at batch- construction time — true when any bound texture opted into mipmaps via SceneTextureParams.mipmap. Same constancy guarantee as the other axes.

numIndices: number

The total number of indices in all meshes of this batch. This is used with WebGL render calls to determine how many indices to render when drawing this batch.

numVertices: number

The total number of vertices in all meshes of this batch. This is used for various calculations and optimizations related to rendering.

primBaseIndex: number

Base primitive tileIndex for this batch.

primitive: number

Primitive type of the meshes in this batch.

saoSupported: boolean

Whether this batch supports Screen Space Ambient Occlusion (SSAO) rendering.

shadowsSupported: boolean

Whether this batch supports directional shadow-map rendering.

sortId: string

A unique identifier for sorting this batch in the renderer.

triplanar: boolean

Whether the renderer should sample this batch's textures via the triplanar world-space fallback rather than the usual UV-attribute path.

Set when the batch's meshes share the property (material has any texture) && (geometry has no UVs) — typical of BIM, sweeps, and lofted curve geometry that loaders produce without UV data. Mutually exclusive with hasUVs by definition; the triplanar shader variant ignores the vertex UV attribute and derives sample coordinates from world position.

Same constancy guarantee as the other axes — never mutates after construction; MeshManager prevents incompatible meshes from joining.

Accessors

Methods

  • Checks if there are any meshes in this batch that should be rendered in the edge render pass for the given view.

    Parameters

    • viewIndex: number

      The index of the view to check.

    • renderPass: number

      The render pass to check for edge rendering.

    Returns boolean

    True if there are meshes to render in the edge render pass, false otherwise.

  • Checks if there are any meshes in this batch that should be rendered in the specified render pass for the given view.

    Parameters

    • viewIndex: number

      The index of the view to check.

    • renderPass: number

      The render pass to check for (e.g., opaque, transparent).

    Returns boolean

    True if there are meshes to render in the specified pass, false otherwise.