npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@driftengine/splats

v4.4.0

Published

Gaussian splat captures: readers, an off-frame sort, and a pass that composes into the scene

Readme

@driftengine/splats

Gaussian splat captures: the readers, view-dependent colour, an off-frame sort, and a pass that composes into the scene.

Cost: 16.6 KB gzipped on top of core. Measured by scripts/size-gate.test.mjs, which fails if it drifts more than 3% — the number is derived from the same floors that gate asserts, so a README quoting a stale one is a red suite rather than a thing somebody notices.

What it is

A photographed place, drawn as several hundred thousand oriented ellipsoids. readSplatPly takes the format the capture tools emit; packSplats writes the packed record .drft carries as SPLT. createSplatPass composes them into a scene that also contains ordinary meshes.

The sort is the whole problem

Splats are transparent, so they draw back to front, and the order changes whenever the camera does. Sorting hundreds of thousands of them inside a frame is what makes a naive implementation stutter.

So the sort is off-frame and the pass draws whatever order it last received — a frame is never blocked on one. SplatSortFn is the seam: supply your own, on a worker or wherever you like, and it is handed a SplatSortScratch it reuses rather than an array it allocates. The cost is that a fast camera move draws a slightly stale order for a frame or two, which reads as a soft settle rather than as a stall. What would make that wrong is a capture small enough to sort inline, where the seam is overhead.

Colour that changes with the view

A capture from a training run stores its colour as a spherical-harmonic expansion: the constant term is the colour from every angle, and the bands above it are how that colour changes as you move past the surface. The l=1 band is read and the rest is not, which is a decision with numbers behind it rather than a partial implementation.

Nine coefficients, transposed out of the file's channel-major order and packed into one extra texel a splat — nine 8-bit values and a per-splat scale in the fourth word. That is 48 bytes a record against 32, and the vertex stage runs six times a splat, so it is 288 bytes a splat a frame against 192. At the mobile budget of 400,000 splats: 115 MB a frame against 77.

Degree 2 is three extra texels and degree 3 is six, which at the same budget is 192 MB and 307 MB a frame — against a mid-range phone already moving 389 MB a frame of attachment traffic. So the sharp specular bands are declined, and the broad directional lobe that makes glass and a wet floor read as themselves is the one that ships.

A capture without harmonics pays nothing: it is eight words a splat and two texels exactly as before, and the shader's gate is a uniform, so it performs no third fetch. The width travels in the SPLT block's own header, which the format designed for this.

Streaming

The SPLT record is blocked and coarse-ordered, so a reader can draw the first block before the rest arrives. Measured on a 332 KB capture: the first of sixteen blocks is 662 splats in 24 KB, and it draws the whole room rather than a corner of it.

Part of DriftEngine. See docs/ARCHITECTURE.md for how the packages divide, and why some features are compiled into core on demand instead.