A MeshBatch represents a collection of meshes that share the same rendering properties and can be rendered together in a single draw call using a DrawTechnique.

interface MeshBatch {
    gpuMemoryBatchIndex: number;
    numIndices: number;
    numVertices: number;
    primBaseIndex: number;
    primitive: number;
    saoSupported: boolean;
    getDrawArraysParamsForMesh(
        meshIndex: number,
    ): { count: number; first: number };
    getMeshAtIndex(meshIndex: number): SceneMesh;
    hasMeshesInRenderPass(viewIndex: number, renderPass: number): boolean;
}

Implemented by

Properties

gpuMemoryBatchIndex: number

The index of this batch's memory in the GPUMemoryManager system. This indexes the GPUMemoryEditor.dataTextures.batches array. Before drawing this batch, the renderer will bind the corresponding data textures from that array, which contain the mesh data needed for rendering.

numIndices: number

The total number of indices in all meshes of this batch. This is used with WebGL draw calls to determine how many indices to draw 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 base index 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.

Methods