UNPKG

@playcanvas/splat-transform

Version:

Library and CLI tool for 3D Gaussian splat format conversion and transformation

24 lines (23 loc) 1.12 kB
/** * Binned rasterize shader. Each workgroup handles one tile and only walks * the splats that have been pre-binned into it (tile-bin pre-pass on CPU * or GPU). Replaces the "walk all splats per pixel" loop in a non-binned * rasterizer with "walk this tile's slice", which is the asymptotic * fix for performance at high splat counts. * * The slice is stored in two buffers: * - `tileOffsets[T + 1]` — exclusive prefix sum: tile T's slice is * `tileData[tileOffsets[T] .. tileOffsets[T + 1])`. * - `tileData[]` — splat indices, grouped by tile, depth-sorted within * each tile (the orchestrator's CPU pre-sort + stable per-splat * binning produces this layout for free). * * Projection-mode variation: `PROJECTION_EQUIRECT` wraps the per-pixel * `dx = px - splat.x` into `[-W/2, W/2]` so a tile on the opposite side * of the ±π longitude seam evaluates against the splat's nearer copy. * Without the flag the raw delta is used. * * @returns WGSL source for the binned-rasterize compute shader. */ declare const rasterizeBinnedWgsl: () => string; export { rasterizeBinnedWgsl };