Spark Renderer (@sparkjsdev/spark) · spark-renderer
Engineering-canonical (proven build, 2026-07-10).
@sparkjsdev/spark2.1 is the project's WebGL Gaussian-splat renderer for Three.js — the implementation behind the holonprintgaussian-splattingmethod on the Royal Orbit spatial-site. [src: HOS-Instance/packages/engine/src/engine/contracts.ts:6]
Content
Spark renders gaussian-splatting scenes inside a standard Three.js scene graph. Facts proven in our build:
SplatMeshextendsObject3D— a splat asset behaves like any Three.js node: add toScene, transform, dispose. The engine's loader returnsPromise<SplatMesh>per manifest asset id [src: HOS-Instance/packages/engine/src/engine/contracts.ts:102-105].SplatMesh({ fileBytes })— "Spark's SplatMesh({ fileBytes }) decodes this format natively when the file/URL ends in.splat. Loader passes{ fileBytes }from a fetched ArrayBuffer for byte-true progress." [src: HOS-Instance/packages/engine/src/engine/contracts.ts:160-163]PackedSplats.pushSplat— programmatic splat construction: push records (position, scale, rgba, quaternion) into a packed buffer; pairs withconstructSplatsfor building splat sets in memory (used by the offline generators inscripts/gen-splats/).onFrame/worldModifiers— per-frame hooks and world-space modifier pipeline for animating splat fields (drift, waves, sparks) without rebuilding buffers — how slice behavior loops touch the splat world.- Standard
.splatinput — 32-byte record: f32×3 position, f32×3 scale, u8×4 rgba, u8×4 quaternionq*128+128[src: HOS-Instance/packages/engine/src/engine/contracts.ts:154-164].
The engine keeps Spark behind the ChapterContext contract (loadAsset/disposeAsset, quality tier, reducedMotion) so scenes never import Spark directly except for the SplatMesh type [src: HOS-Instance/packages/engine/src/engine/contracts.ts:99-108].
Name discipline: do not confuse with the dwork Spark (the output a loop emits that triggers the next loop). This card is the rendering library only; the work-hierarchy Spark lives in work-units.
Composition
- uses: cb-threejs (host scene graph), cb-vite (bundling),
.splatassets from gen-splats - used-by: gaussian-splatting (implementation), holonprint (print runtime), spatial-site, cb-spark (cookbook), bm-002-splat-budget (budget enforcement)
See also
- cb-spark — the how-to cookbook
- src-royalorbit — the proven deployment