Sparkjs logo

Sparkjs

Community
shi3z
sparkjs

Build 3D Gaussian Splat applications using the SparkJS library (@sparkjsdev/spark). This skill should be used when users want to create, modify, or debug web-based 3D Gaussian splatting scenes with Three.js integration, including loading splat files, procedural splat generation, splat editing with SDF shapes, Level-of-Detail streaming, custom Dyno shaders, and performance optimization.

Overview

Publishershi3z
Repositorysparkjs-skill
Skill namesparkjs
Stars
38
Forks
2
Bundled files
2
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by shi3z on GitHub. Read the source before you install it.

Installation

Install the Sparkjs AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/shi3z/sparkjs-skill/tree/master
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/shi3z/sparkjs-skill.git \
  .claude/skills/sparkjs
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Sparkjs in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Sparkjs on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Sparkjs is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

SparkJS - 3D Gaussian Splat Rendering Library

SparkJS is a JavaScript library for rendering and manipulating 3D Gaussian splats in web browsers. It integrates with Three.js to provide high-performance visualization of splat-based 3D models.

  • Documentation: https://sparkjs.dev/docs/
  • Current version: 2.0.0
  • CDN: https://sparkjs.dev/releases/spark/2.0.0/spark.module.js
  • npm: @sparkjsdev/spark

When to Use

Use this skill when:

  • Creating a new 3D Gaussian splatting web application
  • Loading and displaying .ply, .spz, .splat, .ksplat, .sog, .rad splat files
  • Generating procedural splats (grids, spheres, text, images, particles)
  • Editing splats with SDF shapes (lighting, deletion, deformation)
  • Implementing Level-of-Detail (LoD) for large splat scenes
  • Writing custom Dyno shader graphs for GPU computation
  • Optimizing splat rendering performance
  • Adding camera/navigation controls (FPS, pointer, gamepad)

Quick Start Template

Use this as a starting point for any SparkJS project:

html
<style> body { margin: 0; } </style>
<script type="importmap">
  {
    "imports": {
      "three": "https://cdnjs.cloudflare.com/ajax/libs/three.js/0.180.0/three.module.js",
      "@sparkjsdev/spark": "https://sparkjs.dev/releases/spark/2.0.0/spark.module.js"
    }
  }
</script>
<script type="module">
  import * as THREE from "three";
  import { SparkRenderer, SplatMesh } from "@sparkjsdev/spark";

  const scene = new THREE.Scene();
  const camera = new THREE.PerspectiveCamera(60, innerWidth / innerHeight, 0.01, 1000);
  const renderer = new THREE.WebGLRenderer();
  renderer.setSize(innerWidth, innerHeight);
  document.body.appendChild(renderer.domElement);

  const spark = new SparkRenderer({ renderer });
  scene.add(spark);

  const splat = new SplatMesh({ url: "https://sparkjs.dev/assets/splats/butterfly.spz" });
  splat.quaternion.set(1, 0, 0, 0);
  splat.position.set(0, 0, -3);
  scene.add(splat);

  renderer.setAnimationLoop(function animate(time) {
    renderer.render(scene, camera);
  });
</script>

Core Architecture

SparkRenderer

The main renderer, added to the Three.js scene. Required for all splat rendering.

javascript
const spark = new SparkRenderer({
  renderer,                    // THREE.WebGLRenderer (required)
  maxStdDev: Math.sqrt(8),     // Gaussian render extent
  sortRadial: true,            // true=distance, false=Z-depth
  enableLod: true,             // Level-of-Detail
  lodSplatScale: 1.0,          // LoD detail multiplier
  pagedExtSplats: false,       // Extended encoding for paged splats
  enable2DGS: false,           // 2D Gaussian splatting
});
scene.add(spark);

Key methods:

  • dispose() - Free resources
  • update({ scene, camera }) - Manual splat update (awaitable)
  • render(scene, camera) - Render to canvas
  • renderTarget({ scene, camera }) - Render to offline target
  • readTarget() - Read target as Uint8Array RGBA
  • renderEnvMap({ scene, worldCenter }) - Render environment map

SplatMesh

Represents a splat model. Subclass of THREE.Object3D.

javascript
const splat = new SplatMesh({
  url: "./model.spz",          // Load from URL
  // OR
  packedSplats: myPackedSplats, // From PackedSplats instance
  // OR
  constructSplats: (splats) => { /* procedural */ },

  maxSplats: 100000,           // Reserve capacity
  extSplats: false,            // Float32 precision
  lod: true,                   // Generate LoD
  paged: true,                 // Streaming from .rad

  onProgress: (e) => {},       // Download progress
  onLoad: (mesh) => {},        // Init complete
  onFrame: ({ mesh, time, deltaTime }) => {}, // Per-frame
});
scene.add(splat);

Key properties:

  • position, quaternion, rotation, scale - Transform (uniform scale only)
  • recolor: THREE.Color - Tint multiplier
  • opacity: number - Global opacity (0-1)
  • maxSh: number - Spherical Harmonics level (0-3)
  • initialized: Promise<SplatMesh> - Await initialization
  • numSplats: number - Current splat count

Key methods:

  • pushSplat(center, scales, quaternion, opacity, color) - Add a splat
  • forEachSplat(callback) - Iterate all splats (read-only)
  • getBoundingBox(centersOnly) - Get bounding box
  • raycast(raycaster, intersects) - Three.js raycasting
  • dispose() - Free resources

PackedSplats

Efficient 16-byte-per-splat data structure.

javascript
const packed = new PackedSplats({
  url: "./model.ply",
  // OR
  construct: (splats) => {
    splats.pushSplat(center, scales, quat, opacity, color);
  },
  maxSplats: 1000,
});

Methods: getSplat(i), setSplat(i, ...), pushSplat(...), forEachSplat(cb), getTexture(), dispose()

ExtSplats

32-byte-per-splat format with float32 center coordinates for large scenes.

javascript
const ext = new ExtSplats({ url: "./large-scene.ply", extSplats: true });

Splat Editing (SDF)

Apply real-time edits using Signed Distance Field shapes:

javascript
import { SplatEdit, SplatEditSdf, SplatEditSdfType, SplatEditRgbaBlendMode } from "@sparkjsdev/spark";

const edit = new SplatEdit({
  rgbaBlendMode: SplatEditRgbaBlendMode.MULTIPLY,
  sdfSmooth: 0.1,
  softEdge: 0.05,
  sdfs: [
    new SplatEditSdf({
      type: SplatEditSdfType.SPHERE,
      radius: 0.5,
      opacity: 0.0,       // Delete splats in sphere
      color: new THREE.Color(1, 1, 1),
    })
  ]
});
edit.position.set(0, 1, 0);
splatMesh.add(edit);       // Attach as child

SDF shape types: ALL, PLANE, SPHERE, BOX, ELLIPSOID, CYLINDER, CAPSULE, INFINITE_CONE Blend modes: MULTIPLY, SET_RGB, ADD_RGBA

Procedural Splats

Built-in constructors for common patterns:

javascript
import { constructGrid, constructAxes, constructSpherePoints, textSplats, imageSplats } from "@sparkjsdev/spark";
  • constructGrid({ ... }) - Regular grid lattice
  • constructAxes({ scale }) - XYZ axis visualization
  • constructSpherePoints({ maxDepth }) - Sphere subdivision
  • textSplats({ text, font, size, color }) - Text to splats
  • imageSplats({ url, subsample }) - Image to splats
  • generators.staticBox(...) - Random particles in volume
  • generators.snowBox(...) / DEFAULT_SNOW / DEFAULT_RAIN - Particle effects

Controls

javascript
import { SparkControls } from "@sparkjsdev/spark";

const controls = new SparkControls({
  canvas: renderer.domElement,
  moveSpeed: 1.0,
  rotateSpeed: 2.0,
});

// In animation loop:
controls.update(deltaTime, { position: camera.position, quaternion: camera.quaternion });

Level-of-Detail (LoD)

Runtime LoD

javascript
const splat = new SplatMesh({ url: "./model.spz", lod: true });

Pre-built LoD (recommended)

bash
npm run build-lod -- model.ply --quality
javascript
const splat = new SplatMesh({ url: "./model-lod.rad", paged: true });

Tuning

  • SparkRenderer.lodSplatCount - Target budget (platform-dependent)
  • SparkRenderer.lodSplatScale - Budget multiplier
  • SplatMesh.lodScale - Per-object detail factor

Performance Tips

  • Set antialias: false on THREE.WebGLRenderer
  • For VR: use maxStdDev: Math.sqrt(5)
  • Splat budgets: Quest 3 ~1M, phones ~1-3M, desktop ~1-20M
  • Use LoD and foveation for large scenes
  • Evaluate devicePixelRatio vs. performance tradeoff

Dyno Shader System

For custom GPU computation, refer to references/dyno-api.md for the full Dyno stdlib (117+ functions). Basic pattern:

javascript
import { dyno } from "@sparkjsdev/spark";

const myGenerator = dyno.dynoBlock(
  { index: "int" },
  { gsplat: "Gsplat" },
  ({ index }) => {
    let gsplat = dyno.readPackedSplat(packedSplats.dyno, index);
    gsplat = dyno.combineGsplat({ gsplat, opacity: 1.0 });
    return { gsplat };
  }
);

Key Imports

javascript
import {
  SparkRenderer,
  SplatMesh,
  PackedSplats,
  ExtSplats,
  SplatEdit,
  SplatEditSdf,
  SplatEditSdfType,
  SplatEditRgbaBlendMode,
  SparkControls,
  dyno,
  utils,
  constructGrid,
  constructAxes,
  constructSpherePoints,
  textSplats,
  imageSplats,
  generators,
} from "@sparkjsdev/spark";

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Sparkjs AI skill do?

Build 3D Gaussian Splat applications using the SparkJS library (@sparkjsdev/spark). This skill should be used when users want to create, modify, or debug web-based 3D Gaussian splatting scenes with Three.js integration, including loading splat files, procedural splat generation, splat editing with SDF shapes, Level-of-Detail streaming, custom Dyno shaders, and performance optimization.

Why use Sparkjs on TypingMind?

Because you install it once and use it with any model. Sparkjs is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Sparkjs in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/shi3z/sparkjs-skill/tree/master. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Sparkjs?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Sparkjs?

As many as you like. As long as a model supports skills, you can use Sparkjs with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Sparkjs AI skill free?

It is published on GitHub by shi3z. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇