InternalCreates a new MeshBatchImpl instance.
Optional ReadonlybinFree-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.
ReadonlygpuThe index of this batch in the GPUMemoryManager system.
ReadonlyhasWhether 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.
ReadonlyhasUVsWhether the geometries in this batch carry per-vertex UV coordinates.
Independent axis from hasNormals; same constancy guarantee.
ReadonlymipmapWhether 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.
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.
The total number of vertices in all meshes of this batch. This is used for various calculations and optimizations related to rendering.
Base primitive tileIndex for this batch.
Primitive type of the meshes in this batch.
Whether this batch supports Screen Space Ambient Occlusion (SSAO) rendering.
Whether this batch supports directional shadow-map rendering.
A unique identifier for sorting this batch in the renderer.
ReadonlytriplanarWhether 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.
A hash string representing this batch, used for quick comparisons.
Adds a mesh to the batch, updates the mesh counts, and allocates GPU memory for it.
The SceneMesh to add.
A handle to the added mesh in the batch's GPU memory.
Determines if a mesh can be added to this batch based on available GPU memory.
The SceneMesh to check.
A GPUMemoryCheckResult indicating whether the mesh can be added and any relevant details about memory usage.
Destroys this MeshBatchImpl instance.
Retrieves the parameters needed for a WebGL drawArrays call for a specific mesh in this batch.
The index of the mesh to retrieve parameters for.
An object containing the first and count parameters, or null if not found.
Retrieves the SceneMesh at the specified index in this batch, if it exists.
The index of the mesh to retrieve.
The SceneMesh at the specified index, or null if not found.
Checks if there are any meshes in this batch that should be rendered in the edge render pass for the given view.
The index of the view to check.
The render pass to check for edge rendering.
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.
The index of the view to check.
The render pass to check for (e.g., opaque, transparent).
True if there are meshes to render in the specified pass, false otherwise.
Removes a mesh from the batch, updates the mesh counts, and deallocates its GPU memory.
The handle of the mesh to remove.
Updates the per-view clippable flag for a mesh —
rewrites the corresponding clippable byte in the
MeshViewAttributeTexture so the FS clip loop honours
the new state on the next frame.
Sets a custom color per view for a mesh.
Sets per-view mesh culling state. Writes through to the GPU draw index (independent of visibility) so culled meshes are skipped at draw time, just like hidden ones.
Sets per-view mesh highlight state.
Sets the transformation matrix for a mesh.
Sets the mesh to be opaque for the specified view.
The index of the view.
The handle of the mesh.
The render flags for the mesh.
Sets per-view mesh pickable state.
Sets per-view mesh selected state.
Sets the tile tileIndex for a mesh.
Sets transparency per-view for the mesh.
Sets the visibility state of a mesh for a specific view.
The index of the view.
The handle of the mesh.
True to make the mesh visible, false to hide it.
Sets per-view mesh x-ray state.
A MeshBatchImpl manages a batch of SceneMeshes that use the same primitive type.