[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-107943":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":13,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":22,"topics":23,"createdAt":9,"pushedAt":24,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":15,"starSnapshotCount":15,"syncStatus":16,"lastSyncTime":28,"discoverSource":29},107943,"radix","sparkjsdev\u002Fradix","sparkjsdev","An advanced WebGPU 3D Gaussian Splatting renderer for THREE.js",null,"TypeScript",68,11,1,3,0,2,15,45.74,"MIT License",false,"main",true,[],"2026-11-03 15:33:14","2026-11-23 10:28:52","# @sparkjsdev\u002Fradix\n\nRadix draws 3D Gaussian splats with three.js r186's `WebGPURenderer`, on WebGPU or its WebGL2 backend. Splats live in typed-array tables that are the same on the CPU and the GPU. The package has two entry points:\n\n- `@sparkjsdev\u002Fradix`: everything, including rendering, GPU arrays, WebGPU compute, workers and camera controls. `three` is a peer dependency.\n- `@sparkjsdev\u002Fradix\u002Fcore`: the CPU layer alone: tables, codecs, file formats (PLY, compressed PLY, SPZ, RAD, RDX) and sort keys. It imports nothing, so it runs in workers and in Node without three or a DOM.\n\nBuilt by [World Labs](https:\u002F\u002Fwww.worldlabs.ai).\n\n## Getting Started\n\n### Copy Code\n\nCopy the following code into an `index.html` file and serve it over http(s). It draws a butterfly on WebGPU, or on the WebGL2 backend where WebGPU is missing.\n\n```html\n\u003Cstyle> body {margin: 0;} \u003C\u002Fstyle>\n\u003Cscript type=\"importmap\">\n  {\n    \"imports\": {\n      \"three\": \"https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002Fthree@0.186.0\u002Fbuild\u002Fthree.webgpu.js\",\n      \"three\u002Fwebgpu\": \"https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002Fthree@0.186.0\u002Fbuild\u002Fthree.webgpu.js\",\n      \"three\u002Ftsl\": \"https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002Fthree@0.186.0\u002Fbuild\u002Fthree.tsl.js\",\n      \"three\u002Faddons\u002F\": \"https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002Fthree@0.186.0\u002Fexamples\u002Fjsm\u002F\",\n      \"@sparkjsdev\u002Fradix\": \"https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002F@sparkjsdev\u002Fradix@0.0.1\u002Fdist\u002Fradix.module.js\"\n    }\n  }\n\u003C\u002Fscript>\n\u003Cscript type=\"module\">\n  import * as THREE from \"three\";\n  import { GpuArrays, SplatCollection, SplatRenderer, createRenderer, loadSplats } from \"@sparkjsdev\u002Fradix\";\n\n  const scene = new THREE.Scene();\n  const camera = new THREE.PerspectiveCamera(60, window.innerWidth \u002F window.innerHeight, 0.01, 1000);\n  const renderer = await createRenderer();\n  renderer.setSize(window.innerWidth, window.innerHeight);\n  document.body.appendChild(renderer.domElement);\n\n  const splatURL = \"https:\u002F\u002Fstorage.googleapis.com\u002Fforge-dev-public\u002Fasundqui\u002Fradix\u002F261009\u002Frdx\u002Fbutterfly-ai.rdx\";\n  const data = await loadSplats(splatURL);\n  const butterfly = new THREE.Object3D();\n  butterfly.rotation.x = Math.PI;\n  butterfly.position.set(0, 0, -3);\n  scene.add(butterfly);\n\n  const collection = new SplatCollection([\n    SplatCollection.arrays(GpuArrays.fromData(renderer, data), { matrixWorld: butterfly.matrixWorld }),\n  ]);\n  scene.add(new SplatRenderer({ renderer, collection }));\n\n  renderer.setAnimationLoop(function animate(time) {\n    renderer.render(scene, camera);\n    butterfly.rotation.y += 0.01;\n  });\n\u003C\u002Fscript>\n```\n\n### CDN\n\n```html\n\u003Cscript type=\"importmap\">\n  {\n    \"imports\": {\n      \"three\": \"https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002Fthree@0.186.0\u002Fbuild\u002Fthree.webgpu.js\",\n      \"three\u002Fwebgpu\": \"https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002Fthree@0.186.0\u002Fbuild\u002Fthree.webgpu.js\",\n      \"three\u002Ftsl\": \"https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002Fthree@0.186.0\u002Fbuild\u002Fthree.tsl.js\",\n      \"three\u002Faddons\u002F\": \"https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002Fthree@0.186.0\u002Fexamples\u002Fjsm\u002F\",\n      \"@sparkjsdev\u002Fradix\": \"https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002F@sparkjsdev\u002Fradix@0.0.1\u002Fdist\u002Fradix.module.js\"\n    }\n  }\n\u003C\u002Fscript>\n```\n\nRadix imports `three`, `three\u002Fwebgpu` and `three\u002Ftsl`, so the map names all three. The workers' code is inlined into the bundle, so there is no separate worker file to serve.\n\n### NPM\n\n```sh\nnpm install three@0.186 @sparkjsdev\u002Fradix\n```\n\nFrom a local checkout instead (npm builds `dist\u002F` on install through the `prepare` script):\n\n```sh\ncd radix && npm install          # also builds dist\u002F\ncd ..\u002Fmy-app && npm install three@0.186 ..\u002Fradix\n```\n\nTypeScript apps need TypeScript 5.7 or newer, and the WebGPU types: TypeScript 6's DOM types include them, older versions need `@webgpu\u002Ftypes`.\n\n## Use\n\n```ts\nimport * as THREE from \"three\";\nimport { CameraControls, GpuArrays, SplatCollection, SplatRenderer, createRenderer, loadSplats } from \"@sparkjsdev\u002Fradix\";\n\nconst renderer = await createRenderer(); \u002F\u002F WebGPU, or the WebGL2 backend where WebGPU is missing\nrenderer.setSize(innerWidth, innerHeight);\ndocument.body.append(renderer.domElement);\n\nconst scene = new THREE.Scene();\nconst camera = new THREE.PerspectiveCamera(60, innerWidth \u002F innerHeight, 0.01, 1000);\ncamera.position.set(0, 0.5, 3);\nconst controls = new CameraControls({ canvas: renderer.domElement, object: camera, settings: { mode: \"orbit\" } });\n\nconst data = await loadSplats(\"scene.spz\"); \u002F\u002F decoded on a worker\nconst model = new THREE.Object3D();\nmodel.rotation.x = Math.PI; \u002F\u002F most captures are stored y down\nscene.add(model);\nconst collection = new SplatCollection([SplatCollection.arrays(GpuArrays.fromData(renderer, data), { matrixWorld: model.matrixWorld })]);\nscene.add(new SplatRenderer({ renderer, collection }));\n\nrenderer.setAnimationLoop(() => {\n  controls.update();\n  renderer.render(scene, camera);\n});\n```\n\nThe CPU layer, in Node or a worker:\n\n```ts\nimport { readFileSync, writeFileSync } from \"node:fs\";\nimport { SplatFiles } from \"@sparkjsdev\u002Fradix\u002Fcore\";\n\nconst { splats } = await SplatFiles.decode(new Uint8Array(readFileSync(\"scene.ply\")), { name: \"scene.ply\" });\nconsole.log(`${splats.count} splats`);\nwriteFileSync(\"scene.spz\", await SplatFiles.encode(splats, \"spz\"));\n```\n\nThe bundles leave `three`, `three\u002Fwebgpu` and `three\u002Ftsl` to your bundler, or to an import map on a page without one. The workers' code is inlined into the bundle, so there is no separate worker file to serve.\n\n## Develop\n\nDevelopment needs Node 22.15 or newer (the core checks compare against Node's zstd).\n\n```sh\nnpm install\nnpm run build      # dist\u002F, the example pages (build\u002Fexamples\u002F), the test pages (build\u002Ftest\u002F) and docs\u002Fref\u002F\nnpm run build:site # optional: the static site in build\u002Fsite\u002F (also runs npm run build)\nnpm run serve      # http-server on the repo root, port 8000\n```\n\nThen open:\n\n- `http:\u002F\u002Flocalhost:8000\u002Fbuild\u002Fsite\u002F`: the place to start, after `npm run build:site`. It's a landing page that links to the examples, the docs and the highlighted sources, all copied into one folder that can be put on any static host.\n- `http:\u002F\u002Flocalhost:8000\u002Fbuild\u002Fexamples\u002Findex.html`: the example pages (a splat viewer, short scenes, WebXR, an SPZ reader and writer, MPM water, the fx node editor, fractals, LCC and SOG viewers, Doom and Quake) and the ports of the SparkJS 2.3.1 examples.\n- `http:\u002F\u002Flocalhost:8000\u002Fdocs\u002Findex.html`: the docs (guide, API reference, recipes, and the comparison with SparkJS).\n- `http:\u002F\u002Flocalhost:8000\u002Fbuild\u002Ftest\u002Fgpu\u002Findex.html`: the GPU checks (`?gpu=webgpu-gl` for the WebGL2 backend).\n\nThe pages load their splat files from Google Cloud Storage and sparkjs.dev, so they need a network connection. They run on WebGPU, or on the WebGL2 backend with `?gpu=webgpu-gl`.\n\n| Command | What it does |\n|---|---|\n| `npm run build:watch` | rebuild the library, the example pages and `docs\u002Fref\u002F` as files change |\n| `npm run typecheck` \u002F `npm run lint` | types of the library, core, examples and tests; then ESLint |\n| `npm run check:core` | the core checks in Node |\n| `npm run check:docs` | write `docs\u002Fref\u002F`, and check every link and that every export is documented |\n| `npm run docs` | regenerate `docs\u002Fref\u002F` after editing a docs `.md` page |\n| `npm run check:test` | the GPU test page on both backends in headless Chrome (needs `npm run serve`) |\n| `npm run check:examples` | every example page on both backends in headless Chrome (needs `npm run serve`) |\n| `npm run bench` \u002F `npm run bench:core` | the GPU benchmark page over the hosted samples \u002F core benchmarks in Node |\n| `npm run build:site` \u002F `npm run serve:site` | a static site of the examples, docs and highlighted sources in `build\u002Fsite\u002F`, served on port 8002 |\n\n## Layout\n\n- `src\u002F`: the library. Its layers (`core\u002F`, `gpu\u002F`, `wgpu\u002F`, `worker\u002F`, `render\u002F`, `controls\u002F`) import downwards only, and ESLint enforces that.\n- `docs\u002F`: Markdown pages, the generated `ref\u002F` HTML, and the HTML guide.\n- `examples\u002F`: the example pages as TypeScript; the build strips their types file by file.\n- `test\u002F`: the GPU test page and the benchmark page.\n- `scripts\u002F`: builds, checks and benchmarks.\n\n`AGENTS.md` describes the design, the conventions and every example in depth.\n\n## License\n\nMIT\n","Radix 是一个基于 WebGPU 的高性能 3D 高斯点绘制（Gaussian Splatting）渲染器，专为 THREE.js 设计。它支持 WebGPU 原生加速与 WebGL2 回退，采用 CPU\u002FGPU 共享的 typed-array 数据结构实现高效内存复用；提供完整渲染管线（含相机控制、Worker 支持）及轻量核心模块（支持 Node.js 与 Worker 环境下的点云解码与格式解析，兼容 PLY、SPZ、RAD、RDX 等格式）。适用于 Web 端实时三维场景可视化，如神经辐射场（NeRF）导出结果展示、大规模点云交互浏览与 AR\u002FVR 内容快速加载。","2026-11-24 04:33:01","CREATED_QUERY"]