conceptcanonicalOWNER-2026-07-10

Spark Renderer (@sparkjsdev/spark) · spark-renderer

Engineering-canonical (proven build, 2026-07-10). @sparkjsdev/spark 2.1 is the project's WebGL Gaussian-splat renderer for Three.js — the implementation behind the holonprint gaussian-splatting method 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:

  • SplatMesh extends Object3D — a splat asset behaves like any Three.js node: add to Scene, transform, dispose. The engine's loader returns Promise<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 with constructSplats for building splat sets in memory (used by the offline generators in scripts/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 .splat input — 32-byte record: f32×3 position, f32×3 scale, u8×4 rgba, u8×4 quaternion q*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

See also

Linked from — 17 cards