UNPKG

@playcanvas/splat-transform

Version:

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

21 lines (20 loc) 1.06 kB
/** * WGSL source for the project compute. Reads raw splat fields from the * per-slot input buffer, evaluates SH for view-dependent color, computes * 2D inverse covariance + screen-space 3σ radius, and writes a packed * projection record per gaussian. Invalid splats (behind near, degenerate * covariance, outside group AABB) are written with `radius = 0` so the * rasterizer can early-out on the first vec4 load. * * Projection-mode variation (pinhole vs equirect) is handled at WGSL * preprocessor time via `#ifdef PROJECTION_EQUIRECT` blocks that pull * in the projection-specific chunks (screen mapping + Jacobian + tile * AABB). The per-render `MAX_COVERAGE_PER_SPLAT` cap is similarly * embedded by the tile-AABB chunk via JS-template substitution at * construction time (see `sharedCincludes` in the rasterizer ctor). * * @param coeffsPerChannel - Per-channel SH coefficient count (0/3/8/15). * @returns WGSL source for the project compute shader. */ declare const projectWgsl: (coeffsPerChannel: number) => string; export { projectWgsl };