import { Group } from 'three'; import { Materials, StyledTreeIndexSets } from '../../../rendering'; import { ParsedGeometry } from '../../../sector-parser'; import { TreeIndexToSectorsMap } from '../utilities/TreeIndexToSectorsMap'; import { DrawCallBatchingManager } from './DrawCallBatchingManager'; /** * The objective of this class is to batch together instances * of the same type from different sectors. * This is done to reduce the number of draw calls that have to be issued during rendering. * Essentially this works by allocating n (numberOfInstanceBatches) buffers for each unique instanced type * and continually filling / ejecting data from those buffers when new sectors are added / removed. */ export declare class MultiBufferBatchingManager implements DrawCallBatchingManager { private readonly treeIndexToSectorsMap; private readonly initialBufferSize; private readonly numberOfInstanceBatches; private readonly _sectorBatches; private readonly _instanceBatches; private readonly _materials; private readonly _batchGroup; private readonly _styledTreeIndexSets; constructor(batchGroup: Group, materials: Materials, styleTreeIndexSets: StyledTreeIndexSets, treeIndexToSectorsMap: TreeIndexToSectorsMap, initialBufferSize?: number, numberOfInstanceBatches?: number); batchGeometries(geometryBatchingQueue: ParsedGeometry[], sectorId: number): void; removeSectorBatches(sectorId: number): void; dispose(): void; private removeTreeIndicesFromMeshUserData; private processGeometries; private batchInstanceAttributes; private addTreeIndicesToMeshUserData; private updateTreeIndexToSectorsMap; private reallocateBufferGeometry; private updateInstanceAttributes; private extendUpdateRange; private getBatchBufferToFill; private getOrCreateInstanceBatch; private createBatchBuffer; private createInstanceMesh; private createDefragmentedBufferGeometry; private getTreeIndexAttribute; private createSectorBatch; }