{"_id":"@bitruvius/turbo-spz","_rev":"19-6d33f0866afebab5d581ffcc6e972bae","name":"@bitruvius/turbo-spz","dist-tags":{"latest":"0.3.3"},"versions":{"0.3.0":{"name":"@bitruvius/turbo-spz","version":"0.3.0","keywords":["bitruvius","geospatial","webgl2","spz","gaussian-splatting","3dgs","wasm","decoder"],"license":"SEE LICENSE IN LICENSE","_id":"@bitruvius/turbo-spz@0.3.0","maintainers":[{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},{"name":"danrhedges","email":"danrhedges@gmail.com"}],"homepage":"https://dev.bitruvius.com/sdks/js/","bugs":{"url":"https://github.com/bitruvius/support"},"dist":{"shasum":"02e51d28e777a18abcae06d317dcabe35e2a14f7","tarball":"https://registry.npmjs.org/@bitruvius/turbo-spz/-/turbo-spz-0.3.0.tgz","fileCount":17,"integrity":"sha512-P0yK0XkjG4Hup5iX6uXa4RKzIVgeneD3m1Y17SS0qNkXe72xmK792fHy8/1uN36OFvO/6wVDx8f8WkFyDGS/6g==","signatures":[{"sig":"MEUCIGSW6o1aXAoj4IuPnBufGJj+Tl7L8GMWmHGK8qW/45mrAiEA1fF0z49YyYN/qxOA//kNuzrBgmvHUMDK0mS51m2Eh5Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":246313},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"02e51d28e777a18abcae06d317dcabe35e2a14f7","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./wasm/*":"./wasm/*","./package.json":"./package.json"},"scripts":{"test":"bun test","build":"bun build ./src/index.ts ./src/gltf-decode-worker.ts --outdir dist --format esm --target browser --minify --external '@bitruvius/*' --define __dirname='\"\"' --define __filename='\"\"' && tsc --emitDeclarationOnly"},"_npmUser":{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},"_integrity":"sha512-P0yK0XkjG4Hup5iX6uXa4RKzIVgeneD3m1Y17SS0qNkXe72xmK792fHy8/1uN36OFvO/6wVDx8f8WkFyDGS/6g==","_npmVersion":"10.8.3","description":"TurboSPZ: fast SPZ Gaussian-splat decoder (reads SPZ v1 to v4) for the browser, pure-Rust wasm","directories":{},"sideEffects":["./src/index.ts"],"_nodeVersion":"24.3.0","dependencies":{"@bitruvius/tiles3d":"^0.3.0","@bitruvius/geo-core":"^0.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/turbo-spz_0.3.0_1785722157619_0.15874352374139522","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@bitruvius/turbo-spz","version":"0.3.1","keywords":["bitruvius","geospatial","webgl2","spz","gaussian-splatting","3dgs","wasm","decoder"],"license":"SEE LICENSE IN LICENSE","_id":"@bitruvius/turbo-spz@0.3.1","maintainers":[{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},{"name":"danrhedges","email":"danrhedges@gmail.com"}],"homepage":"https://dev.bitruvius.com/sdks/js/","bugs":{"url":"https://github.com/bitruvius/support"},"dist":{"shasum":"11f4e573081eaf69cfcfb6db281b0d6b508f6d1d","tarball":"https://registry.npmjs.org/@bitruvius/turbo-spz/-/turbo-spz-0.3.1.tgz","fileCount":17,"integrity":"sha512-dleX+A7gSuWGK4cdWwDdLdqbO3LQPeB/1IrmPE4LrxmLgqJGfm9zZ6riNT5MJwTsP5r2RvGvi09BehKbEi5r0A==","signatures":[{"sig":"MEYCIQC9YfXOotTL8q0ix8pFBElWOjYg8HvPfyy74akuVmI0ewIhAPK2o3olnkJMNsrERNRNKqACVrpVCscMXkaMLdcx10Rk","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":246478},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"11f4e573081eaf69cfcfb6db281b0d6b508f6d1d","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./wasm/*":"./wasm/*","./package.json":"./package.json"},"scripts":{"test":"bun test","build":"bun build ./src/index.ts ./src/gltf-decode-worker.ts --outdir dist --format esm --target browser --minify --external '@bitruvius/*' --define __dirname='\"\"' --define __filename='\"\"' && tsc --emitDeclarationOnly"},"_npmUser":{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},"_integrity":"sha512-dleX+A7gSuWGK4cdWwDdLdqbO3LQPeB/1IrmPE4LrxmLgqJGfm9zZ6riNT5MJwTsP5r2RvGvi09BehKbEi5r0A==","_npmVersion":"10.8.3","description":"TurboSPZ: fast SPZ Gaussian-splat decoder (reads SPZ v1 to v4) for the browser, pure-Rust wasm","directories":{},"sideEffects":["./src/index.ts"],"_nodeVersion":"24.3.0","dependencies":{"@bitruvius/tiles3d":"^0.3.1","@bitruvius/geo-core":"^0.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/turbo-spz_0.3.1_1785725519795_0.2202638117249549","host":"s3://npm-registry-packages-npm-production"}},"0.3.2":{"name":"@bitruvius/turbo-spz","version":"0.3.2","keywords":["bitruvius","geospatial","webgl2","spz","gaussian-splatting","3dgs","wasm","decoder"],"license":"SEE LICENSE IN LICENSE","_id":"@bitruvius/turbo-spz@0.3.2","maintainers":[{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},{"name":"danrhedges","email":"danrhedges@gmail.com"}],"homepage":"https://dev.bitruvius.com/sdks/js/","bugs":{"url":"https://github.com/bitruvius/support"},"dist":{"shasum":"eae4b6d75e85b70ed0742fc32739c2a82d1b5ea9","tarball":"https://registry.npmjs.org/@bitruvius/turbo-spz/-/turbo-spz-0.3.2.tgz","fileCount":17,"integrity":"sha512-6JeQ44fI5DcKRgYTMDY2QwqpmLTi32K0X3xOYnxVeNjIJKnE+psITmq5/30oXMEBxfg3eurRBlhNWxtV9PH98Q==","signatures":[{"sig":"MEYCIQDl4QxnEf6YPeABU++6xQAZPBLR1HPUHdUc+JyRwKdDywIhAMEbCse7vRdVkRoSjHTeWY2+Z4DHS0ORqOSBj2D2cb6r","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":246478},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"eae4b6d75e85b70ed0742fc32739c2a82d1b5ea9","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./wasm/*":"./wasm/*","./package.json":"./package.json"},"scripts":{"test":"bun test","build":"bun build ./src/index.ts ./src/gltf-decode-worker.ts --outdir dist --format esm --target browser --minify --external '@bitruvius/*' --define __dirname='\"\"' --define __filename='\"\"' && tsc --emitDeclarationOnly"},"_npmUser":{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},"_integrity":"sha512-6JeQ44fI5DcKRgYTMDY2QwqpmLTi32K0X3xOYnxVeNjIJKnE+psITmq5/30oXMEBxfg3eurRBlhNWxtV9PH98Q==","_npmVersion":"10.8.3","description":"TurboSPZ: fast SPZ Gaussian-splat decoder (reads SPZ v1 to v4) for the browser, pure-Rust wasm","directories":{},"sideEffects":["./src/index.ts"],"_nodeVersion":"24.3.0","dependencies":{"@bitruvius/tiles3d":"^0.3.2","@bitruvius/geo-core":"^0.3.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/turbo-spz_0.3.2_1785952487800_0.2858103717522025","host":"s3://npm-registry-packages-npm-production"}},"0.3.3":{"_id":"@bitruvius/turbo-spz@0.3.3","bugs":{"url":"https://github.com/bitruvius/support"},"dist":{"shasum":"14c824980aca469a95a86b0b05a72ba055cb0f41","tarball":"https://registry.npmjs.org/@bitruvius/turbo-spz/-/turbo-spz-0.3.3.tgz","fileCount":17,"integrity":"sha512-+q3MR3Hpi6V/jnnmutP4imaZc7NCoJfzNxD+CAF931x4bzEsHw26k06jB+7j1SX1OzBF22/9OceyUqjWac0DeA==","signatures":[{"sig":"MEQCICEse5dqoM62AsnGjJfVMtzMztoAHiZK6vq/a7RUIMMdAiAb1SKXKlVdfPIzKdhCLAiMj98u7tjKRfmktFghWS75kw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDTqv8vT6M6sQ3CEBRzHeoG+L5l0h33nT+wkD9IdHA5YwIhAOtqnMltP3ot7X8n4NS6k5Tw3y6q346hWKHGtwyZ4Qqb"}],"unpackedSize":250100},"main":"./dist/index.js","name":"@bitruvius/turbo-spz","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"14c824980aca469a95a86b0b05a72ba055cb0f41","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./wasm/*":"./wasm/*","./package.json":"./package.json"},"license":"SEE LICENSE IN LICENSE","scripts":{"test":"bun test","build":"bun build ./src/index.ts ./src/gltf-decode-worker.ts --outdir dist --format esm --target browser --minify --external '@bitruvius/*' --define __dirname='\"\"' --define __filename='\"\"' && tsc --emitDeclarationOnly"},"version":"0.3.3","_npmUser":{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},"homepage":"https://dev.bitruvius.com/sdks/js/","keywords":["bitruvius","geospatial","webgl2","spz","gaussian-splatting","3dgs","wasm","decoder"],"_integrity":"sha512-+q3MR3Hpi6V/jnnmutP4imaZc7NCoJfzNxD+CAF931x4bzEsHw26k06jB+7j1SX1OzBF22/9OceyUqjWac0DeA==","_npmVersion":"10.8.3","description":"TurboSPZ: fast SPZ Gaussian-splat decoder (reads SPZ v1 to v4) for the browser, pure-Rust wasm","directories":{},"maintainers":[{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},{"name":"danrhedges","email":"danrhedges@gmail.com"}],"sideEffects":["./src/index.ts"],"_nodeVersion":"24.3.0","dependencies":{"@bitruvius/tiles3d":"^0.3.3","@bitruvius/geo-core":"^0.3.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/turbo-spz_0.3.3_1790300002225_0.8396946975874036"}}},"time":{"created":"2026-08-03T01:55:57.369Z","modified":"2026-09-25T01:33:22.509Z","0.2.0-alpha.0":"2026-06-12T04:20:00.838Z","0.2.0-alpha.1":"2026-06-12T13:08:25.760Z","0.2.0-alpha.2":"2026-06-12T14:55:04.766Z","0.2.0-alpha.3":"2026-06-17T04:39:38.133Z","0.2.0-alpha.4":"2026-06-18T01:20:38.049Z","0.3.0":"2026-08-03T01:55:57.763Z","0.3.1":"2026-08-03T02:51:59.952Z","0.3.2":"2026-08-05T17:54:47.929Z","0.3.3":"2026-09-25T01:33:22.335Z"},"bugs":{"url":"https://github.com/bitruvius/support"},"license":"SEE LICENSE IN LICENSE","homepage":"https://dev.bitruvius.com/sdks/js/","keywords":["bitruvius","geospatial","webgl2","spz","gaussian-splatting","3dgs","wasm","decoder"],"description":"TurboSPZ: fast SPZ Gaussian-splat decoder (reads SPZ v1 to v4) for the browser, pure-Rust wasm","maintainers":[{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},{"name":"danrhedges","email":"danrhedges@gmail.com"}],"readme":"<p align=\"center\">\n  <a href=\"https://bitruvius.com\"><img src=\"https://cdn.bitruvius.com/brand/bitruvius-logo.png\" width=\"360\" alt=\"Bitruvius\"></a>\n</p>\n\n# @bitruvius/turbo-spz\n\n**SPZ Gaussian splats, decoded in the browser faster than libspz.**\n\nSPZ is the open compression format Niantic published for 3D Gaussian splats.\nTurboSPZ is an independent pure-Rust decoder for it, compiled to WebAssembly\nwith SIMD128. It reads every SPZ version libspz reads: v1, v2, v3 and v4, with\nthe legacy gzip framing detected from the magic bytes rather than configured by\nyou.\n\n> **Turbocharged by [Bitruvius TurboSPZ](https://bitruvius.com/turbo-spz).**\n\n## Faster than libspz in the browser\n\nBrowser decode throughput, turbospz-wasm against Niantic libspz, both compiled to\nWASM SIMD128, decoding the same file per version.\n\n| SPZ version | Format | turbospz-wasm | libspz | Speedup |\n|---|---|---|---|---|\n| v2 | gzip (legacy) | 1078 MiB/s | 595 MiB/s | 1.81× faster |\n| v3 | gzip (legacy) | 1007 MiB/s | 568 MiB/s | 1.77× faster |\n| v4 | zstd (current) | 1078 MiB/s | 847 MiB/s | 1.27× faster |\n\nSH degree 3, scene-averaged over hornedlizard (786K splats) and racoonfamily\n(933K splats). Higher is faster.\n\n**One codebase, one answer.** AVX2, NEON, WASM SIMD128 and a scalar fallback all\nproduce byte-identical output. This package ships the WASM SIMD128 path, so a\ncapture decoded in a phone browser matches the same file decoded by the native\nTurboSPZ tools on a workstation.\n\n**Memory-safe by construction.** Pure Rust, zero `unsafe` in the consumer\nlibraries, and no emscripten anywhere in the build.\n\n## Use it\n\n```ts\nimport { SpzDecoder } from '@bitruvius/turbo-spz';\n\nconst bytes = new Uint8Array(await (await fetch('scene.spz')).arrayBuffer());\nconst cloud = await new SpzDecoder().decode(bytes);\n// cloud.numPoints, cloud.shDegree, then flat Float32Arrays:\n// positions (3N), scales (3N), rotations (4N), alphas (N), colors (3N), sh\n```\n\nReuse one decoder across many files. The wasm is a lazily initialized singleton,\nso only the first decode on the page pays the init cost.\n\nThe arrays arrive as the container stores them, not as your shader wants them.\nThree conversions stand between decode and a correct render:\n\n```ts\nscale = Math.exp(logScale);              // scales ship as logs\ncolor = 0.5 + 0.28209479177387814 * dc;  // SH degree-0 DC to straight colour\nalpha = 1 / (1 + Math.exp(-a));          // alphas are opacity logits\n```\n\nOpacity is the one that bites. Get it wrong and the scene renders uniformly\nnear-opaque or near-invisible, with no error to tell you why.\n\n## Splat tilesets\n\n`SpzGltfSplatDecoder` and `WorkerSpzGltfSplatDecoder` decode whole 3D Tiles\nGaussian-splat tiles (`KHR_gaussian_splatting`), which is how Esri and Cesium\nsplat tilesets stream. The worker variant fans tiles out to a pool so the\nentropy decode never blocks your render thread. You rarely wire it up yourself:\na splat layer in `@bitruvius/sdk-maplibre` uses it by default.\n\n```ts\nimport { Tiles3DSplatLayer } from '@bitruvius/sdk-maplibre';\n\nmap.addLayer(new Tiles3DSplatLayer({ id: 'splats', url: tilesetUrl }));\n```\n\n`SpzContainerDecoder` adapts a standalone `.spz` file to the SDK's streaming\ndecoder contract, so a raw capture renders through the same pipeline as any\nother Bitruvius container.\n\n## Install\n\n```sh\nnpm i @bitruvius/turbo-spz\n```\n\nA self-contained ESM bundle is published on the Bitruvius CDN if you would\nrather skip the bundler entirely. In production, pin an exact version, add\n`integrity=` from the release manifest, and allow `script-src 'wasm-unsafe-eval'`\nin your CSP.\n\n**This package decodes. It does not encode.** There is no encoder in the\npackage and none inside the `.wasm`. The decoder is free: anyone who needs to\nread SPZ data can pull it and ship it inside their application, under\nLICENSE. The TurboSPZ encoder is licensed separately: see\n[bitruvius.com/turbo-spz](https://bitruvius.com/turbo-spz) for its benchmarks\nand licensing terms.\n\n## Learn more\n\n- **[Live examples](https://dev.bitruvius.com/bitruvius-sdk-js/examples/)**: SPZ decode and full EWA splat rendering, running, with source\n- **[Documentation](https://dev.bitruvius.com/sdks/js/)**: guides and the full API reference\n- **[Support](https://github.com/bitruvius/support)**: questions and issues\n- **[TurboSPZ on bitruvius.com](https://bitruvius.com/turbo-spz)**: benchmarks and format details\n\n## Trademarks\n\nNiantic and SPZ are trademarks of Niantic, Inc. Esri and ArcGIS are\ntrademarks of Environmental Systems Research Institute, Inc. Cesium and 3D Tiles\nare trademarks of Cesium GS, Inc. Khronos and glTF are trademarks of The Khronos\nGroup Inc. MapLibre is a trademark of the MapLibre organization. All other marks\nare the property of their respective owners.\n\nThese names are used solely to describe the data formats this software\ninteroperates with. Bitruvius is not affiliated with, sponsored by, or endorsed\nby any of them, and no such relationship is implied.\n\nTurboSPZ is an independent implementation of the openly published SPZ format,\ndeveloped by Bitruvius and verified against Niantic's `libspz` reference, which\nNiantic releases under the MIT license. It is neither produced nor endorsed by\nNiantic, and compatibility claims describe interoperability with the format as\nverified by our test suites, not any form of certification.\n\n## License\n\nProprietary. The full terms ship as `LICENSE` inside this package, and are readable\nbefore installing at [cdn.bitruvius.com/legal/sdk-license-v1.txt](https://cdn.bitruvius.com/legal/sdk-license-v1.txt).\n\n© Bitruvius, Inc.\n","readmeFilename":"README.md"}