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

@dvt3d/splat-mesh

v1.1.1

Published

A lightweight, high-performance 3D Gaussian Splatting renderer for Three.js. This implementation uses:

Downloads

255

Readme

Splat Mesh

A lightweight, high-performance 3D Gaussian Splatting renderer for Three.js. This implementation uses:

  • GPU texture packing
  • Instanced rendering
  • View-dependent sorting in WebWorker
  • Optional frustum-aware sorting
  • Designed for large-scale splat datasets (100K–1M+ splats).

Introduction

SplatMesh is a custom Three.js Mesh implementation that renders Gaussian splats using:

  • DataTexture for storing splat attributes
  • InstancedBufferGeometry for drawing
  • WebWorker for per-frame view-space sorting

The renderer supports dynamic camera movement and maintains correct blending order by sorting splats every frame.

Principle Overview

Data Storage

Each splat is stored in two GPU textures:

| Texture | Format | Content | |-----------------------|----------|-------------------------| | centerAndScaleTexture | RGBA32F | center.xyz + scale | | covAndColorTexture | RGBA32UI | rotation + packed color |

Texture size:


const width = maxTextureSize
const height = ceil(vertexCount / width)

Rendering Pipeline

Input buffer / geometry
        ↓
Worker: process splats
        ↓
Upload packed textures to GPU
        ↓
Per frame:
   compute modelView matrix
   worker sorts splats
   update splatIndex buffer
        ↓
Instanced rendering

Sorting is view-dependent to ensure correct blending.

Usage

const worker = new SplatWorker('***/wasm_splat.worker.min.js')
const splatMesh = new SplatMesh()
splatMesh.attachWorker(worker)
splatMesh.setVertexCount(data.numSplats)
await splatMesh.setDataFromBuffer(data.buffer)
scene.add(splatMesh)

Why the Worker Is Injected

The worker is injected externally to separate rendering logic from CPU-intensive computation. SplatMesh focuses purely on GPU resources and drawing, while the Worker handles heavy tasks such as splat processing, view-dependent sorting, and bounds computation. This design allows multiple meshes to share a single Worker (and WASM instance), reduces memory and thread overhead, improves lifecycle control, and follows a clean dependency injection architecture. In short, the mesh renders, the worker computes — keeping the system modular, efficient, and scalable.

Examples

Live examples demonstrating different input formats:

  • PLY Example: examples/ply.html
  • SOG Example: examples/sog.html
  • SPLAT Example: examples/splat.html
  • SPZ Example : examples/spz.html

You can use the 3dgs-loader library to load 3D Gaussian Splatting data in formats such as .ply, .splat, .spz, or .sog. It provides a unified and browser-friendly API that parses and decodes the data into a standardized { numSplats, buffer } structure, which can be passed directly to SplatMesh. The loader is available via CDN (e.g. https://cdn.jsdelivr.net/npm/[email protected]/+esm) and is recommended for simplifying data loading while keeping rendering and parsing responsibilities cleanly separated.

SplatMesh API

Constructor

const mesh = new SplatMesh()

Properties

  • {Number} vertexCount : Number of splats, Must be set before loading data.
  • {Number} threshold : Sorting threshold value.
  • {SplatWoker} worker : Attached sorting worker.
  • {Array} bounds : Bounding box (after computeBounds()).
  • {Boolean} useFrustumCulled : Enable frustum planes for worker-side culling.

Methods

  • detachWorker(worker):SplatMesh : Attach a Worker instance.
mesh.attachWorker(worker)
  • detachWorker():SplatMesh : Detach current worker.
mesh.detachWorker()
  • setVertexCount(count):SplatMesh : Allocate textures and instance attributes, Must be called before loading splat data.
mesh.setVertexCount(1000)
  • setDataFromBuffer(buffer):Promise<SplatMesh> : Load splat data from ArrayBuffer.
await mesh.setDataFromBuffer(buffer)
  • setDataFromGeometry(geometry):Promise<SplatMesh> : Load splats from Three.js geometry.
await mesh.setDataFromGeometry(geometry)
  • setDataFromSpz(spzData):Promise<SplatMesh> : Load splats from SPZ data structure.
await mesh.setDataFromSpz(spzData)
  • computeBounds():Promise<SplatMesh> : Compute bounding box via worker.
await mesh.computeBounds()
  • dispose() : Release GPU resources and unregister worker data.
mesh.dispose()