Skip to content

About

Pixel-art Gaussian splat dioramas in your browser: SDF shapes, splats on their surfaces, a pixel pass. WebGL2, one file, plus a Claude Code skill to make more.

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

patch. pixel splats. pixel-art gaussian splat dioramas, live in your browser.



Five small floating dioramas turning one after another: a treasure chest with teeth between two torches, a fox sitting by a campfire, a split geode full of pink crystals, a lighthouse sweeping two beams over a night sea, and koi circling a pond.

open the demo · how it works · make your own · the skill · publish it on patch

Five small worlds, each a few dozen SDF shapes in plain JavaScript, covered in 35,000 to 50,000 Gaussian splats and drawn through a pixel-art pass: one palette per scene, two-colour dithering, dark outlines. They render live in WebGL2, from one HTML file with no dependencies. Drag a scene to turn it, and press P to see the splats without the pixel pass.

The idea is @JungleSilicon's: make SDFs, place Gaussian splats along their surfaces, then run a pixel-art post-process. This repo is our own take on that recipe, written from scratch, with a skill to make more.

how it works.

The campfire diorama as plain clay: the ground disc, pine trees, a teepee, a log and a sitting fox. 1 · sdf shapes.
Each scene is a few dozen signed distance functions: ellipsoids, boxes, cones, tapered capsules, smooth unions, noise.
the fox is 14 shapes
The same scene as a cloud of small coloured points. 2 · splats on the surface.
An octree walks each shape's distance field and drops a splat about every 2 px, oriented along the surface.
35,656 splats in this one
The same scene as soft Gaussian splats: a glowing campfire, the fox lit orange, embers rising. 3 · gaussian splats.
Each splat is a flat 3D Gaussian, lit, shadowed and blended back to front every frame.
what you see with the pixel pass off
The same scene as crisp pixel art in a limited green and orange palette. 4 · the pixel pass.
About 216 px tall, a hand-made palette, two-colour dithering, outlines on depth edges.
384 x 216, scaled up with hard edges
  • Splats from distance fields. For each shape, an octree skips space the distance field says is empty and, in each surface cell, steps a point onto the surface along the gradient. Splats buried inside another shape are dropped. Ambient occlusion comes from the distance field too.
  • Splatting. Each splat has two radii in the surface and a thin third, projected to a 2D ellipse every frame (the EWA Jacobian), counting-sorted back to front on the CPU and blended. Light is per splat: a key light with a shadow map drawn from the splats themselves, sky and ground fill, up to four point lights, rim and specular.
  • The pixel pass. The scene renders at about 216 px tall and scales up with hard edges. An opaque depth pass of the same splats gives the outlines. Each pixel maps to the scene's palette in OKLab: the nearest colour and the one that best brackets it, dithered on a 4x4 Bayer grid. Surfaces only get flat colour or a 50% checker.
  • Motion. Groups move with rigid poses and four procedural deforms (sway, water, swim, breathe). Particles do flames, embers, smoke, fireflies, rain and light beams.
  • One file. index.html is all of it. Each scene builds in a web worker in about half a second.

make your own.

git clone https://github.com/patch-gg/pixel-splats && cd pixel-splats
python3 -m http.server 8000        # then open http://localhost:8000

Drag to turn a scene, scroll to zoom, double-click to reset. The arrow keys change scene, P turns the pixel pass off and on, and space pauses. #campfire, #koi-pond and so on open one scene.

A scene is one block in index.html: its shapes and materials, palette, lights, camera and animation. skills/pixel-splats/REFERENCE.md has the whole API. Copy the closest scene, change it, and look at it:

node tools/shot.mjs campfire --angles 3              # three views at 4x, in out/shots/
node tools/shot.mjs mimic --crop 150,40,90,70        # a close look at part of the frame
node tools/shot.mjs geode --mode clay --size 768x432 --scale 1   # the shapes alone
node tools/film.mjs lighthouse --seconds 8           # an MP4 at 1920x1080 (or --out out/lighthouse.gif)

The demo on Patch is this page with Patch's controls around it: node tools/block.mjs builds that release into dist/ (the controls are in recipe.json), and pch publish sends it.

The tools need Node 22 or later and Chrome (set CHROME if it isn't found; under WSL they use Windows Chrome so the graphics card does the work). film.mjs needs ffmpeg. --plan cuts several shots together.

the skill.

The pixel-splats skill teaches Claude Code to make new dioramas the way these were made: model, render from three angles, look, fix the worst thing, repeat. Install it as a plugin:

/plugin marketplace add patch-gg/pixel-splats
/plugin install pixel-splats@pixel-splats

or copy skills/pixel-splats into ~/.claude/skills/. Then ask for what you want:

  • "Make a diorama of a witch's hut in a swamp, with fireflies and a bubbling cauldron."
  • "Give the mimic a purple palette and make it chomp faster."
  • "Film the koi pond as a 6 second loop for my README."

publish it on patch.

Made a browser game with these? Put it on Patch, where people play and remix browser games and mods. Install pch, Patch's command line, then restart your coding agent and ask it to publish the game: the install gives every agent on your PC Patch's tools. Or run it yourself:

npm i -g @patchgg/cli      # or: curl -fsSL https://patch.gg/install.sh | sh
pch login
pch init                   # in your game's folder; it says what's next
pch publish

Publishing needs Patch Desktop open on a Windows PC: it plays your game once to test it before it goes live. The quickstart has the rest.

licence.

Apache-2.0, see LICENSE. The Patch name, mark, wordmark and Patch Pixel belong to Patch and aren't covered by it. The page loads Silkscreen (SIL Open Font License) from Google Fonts.

Made by Patch (@patch_gg).


patch.gg. Mashups, mods and browser games.

About

Pixel-art Gaussian splat dioramas in your browser: SDF shapes, splats on their surfaces, a pixel pass. WebGL2, one file, plus a Claude Code skill to make more.

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages