# stackLods

Function

Source: https://github.com/playcanvas/splat-transform/blob/b6424a5b3b929695fbaafe738a995adb1240d675/src/lib/ops/stack-lods.ts#L22

```ts
stackLods(sources: ChunkSource[]): ChunkSource
```

Stack N single-LOD sources into one structural multi-LOD source: output LOD
`i` is `sources[i]`. `read` dispatches by `request.lod` to the matching source
(read at its own LOD 0). `numGaussians` is LOD 0's count; `lodCounts[i]` is
`sources[i]`'s gaussian count.

This is how per-detail-level inputs become one structural scene for the LOD
writer — multi-PLY `--tag-lod` tags (one source per tagged level) or a DataTable
split by its `lod` column — replacing the old per-gaussian lod tag array. LOD
is a structural axis here; no source carries a per-gaussian LOD tag.

All inputs must share layout (chunk size, SH bands, layers, extras, transform)
and be single-LOD; the stacked metadata is inherited from `sources[0]`.

**Parameters**

- `sources` ([`ChunkSource`](https://api.playcanvas.com/splat-transform/interfaces/ChunkSource.md)`[]`): The per-LOD single-LOD sources, in output-LOD order.

**Returns** [`ChunkSource`](https://api.playcanvas.com/splat-transform/interfaces/ChunkSource.md): A multi-LOD source dispatching by LOD to the inputs.
