Back to API Reference
Class

UniTextWorldBatcher

sealed

Invisible singleton that batches UniTextWorld components into combined meshes while honoring Unity's sorting model (SortingLayer, OrderInLayer, SortingGroup) so batched text interleaves correctly with SpriteRenderer and other renderers.

Remarks

Two-level hierarchy: BatchGroup is a logical grouping by BatchKey = (materialInstanceId, sortingLayerID, sortingOrder, sortingGroupID). Conceptually "one draw call worth of text". BatchShard is a physical mesh. A group holds one shard normally; when a group grows past WorldBatcherShardTargetVertexCount vertices, new shards are added so that structural rebuilds of one shard do not touch unrelated components. Dirty classification: Structural — vertex count changed, entry added/removed, sorting/material changed. Triggers a full rebuild of the affected shard (not the whole group). Positional — transform moved. Writes Position+Normal only, for exactly this entry's slice of the shard's vertex buffer. Attributive — text rebuild without vertex count change (colors/UVs only). Writes the affected attribute streams for this entry's slice. Vertex buffer layout — fixed four streams: Stream 0: Position (float3) + Normal (float3) = 24 bytes/vertex Stream 1: Color (UNorm8×4) = 4 bytes/vertex Stream 2: UV0 (float4) = 16 bytes/vertex Stream 3: UV1 + UV2 + UV3 (float4×3) = 48 bytes/vertex Separate streams let partial updates write only the affected attribute without rewriting unrelated data.