$ show playcanvas/supersplat-viewer
This repository is the @playcanvas/supersplat-viewer npm package, an embeddable 3D Gaussian splatting viewer built on the PlayCanvas engine. It bootstraps a full web application around a PlayCanvas AppBase: createViewer(options) mounts a canvas and UI, loads .gsplat/.ply content plus optional skybox and voxel/mesh collision assets, and returns a ViewerHandle for capture, seeking, camera control, XR, and teardown. The default rendering path is the engine's sorted gsplat renderer; an opt-in WebGPU stochastic renderer provides unsorted splat projection, temporal anti-aliasing, occlusion culling, and depth-based picking. The repo is an application, not a data/research pipeline, though it contains research-grade rendering experiments and a dedicated benchmark harness.
The LLM identified 5 files worth highlighting for reuse:
A Proxy-based observable wrapper that turns plain nested state objects into event-emitting stores: mutating a property fires 'key:changed' events and supports targeted subscriptions. It is used to expose ViewerState to UI and logic without a framework. Self-contained and portable to any TypeScript/JavaScript project.
Composable runtime validation primitives (assertObject, assertNumber, etc.) that accumulate path-aware error messages while validating nested settings structures. Used as the backbone of settings validation and authoring-limit checks; easily extracted as a general validation toolkit.
Generic cubic spline interpolation used by the animation track system to generate smooth camera paths. Pure math utility with no engine coupling, so it can be reused for any spline-based animation or path generation.
Builds a complete HTML document string for embedding the viewer, injecting bundled CSS/JS and serialized settings. This makes the viewer usable from server-rendered pages and is a self-contained helper for programmatic HTML generation.
A capsule-based walk controller that combines spring-damper acceleration with collision queries (mesh/voxel) and iterative push-out, using preallocated scratch objects to avoid per-frame allocations. Shows a reusable pattern for collision-aware first-person movement.