@playcanvas/splat-transform
Version:
Library and CLI tool for 3D Gaussian splat format conversion and transformation
27 lines (26 loc) • 1.19 kB
TypeScript
/**
* Tile-bin emit-pairs shader. For each projected splat, emits
* `coverage[i]` (tile, splat) pairs into two parallel buffers,
* starting at `emitOffset[i]`:
*
* tileKeys [emitOffset[i] + j] = tileIdx
* splatValues[emitOffset[i] + j] = splatIdx (= i)
*
* The orchestrator sizes maxCoveragePerSplat to cover a sub-frame's
* entire tile area, so a splat's `coverage[i]` always equals its full
* bbox-in-group tile count — no truncation, no seams. The walk emits
* row-major over the bbox-in-group. A subsequent key+value radix sort
* groups pairs by tile; within each tile, the splatIdx-as-value sort
* preserves the chunk's depth order (splatIdx is monotonic in depth
* from the CPU pre-sort).
*
* Projection-mode variation: `PROJECTION_EQUIRECT` swaps in the
* tile-walk-equirect chunk, which walks the un-clamped X range and
* applies a modular wrap so a splat near the ±π longitude seam emits
* tile keys on both sides of the image. Without the flag the
* tile-walk-pinhole chunk walks the clamped bbox directly.
*
* @returns WGSL source for the emit-pairs compute shader.
*/
declare const tileBinEmitPairsWgsl: () => string;
export { tileBinEmitPairsWgsl };