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

voxeltracer

v1.2.0

Published

MagicaVoxel path tracer for the web (WebGL2). Framework-agnostic library + demo app.

Downloads

324

Readme

VoxelTracer

MagicaVoxel path tracer for the web. Renders .vox files with a progressive monte-carlo path tracer on WebGL2 — voxel data lives in an R8UI 3D texture atlas walked by a DDA kernel, with diffuse/metal/glass/emissive materials and soft shadows. Framework-agnostic library plus a React demo app.

Demo: https://sprited-ai.github.io/voxeltracer — press ` (backtick) for the debug panel.

Two merged .vox files (mini store + monu9) path-traced side by side

64 instanced mini stores (one model, 64 scene-graph references)

Usage

Script tag (UMD)

<div id="app" style="width: 100%; height: 100%"></div>
<script src="voxeltracer.umd.cjs"></script>
<script>
  const tracer = voxeltracer.createVoxelTracer({
    container: document.getElementById('app'),
    src: 'model.vox',
  });
</script>

npm (ESM)

npm install voxeltracer
import { createVoxelTracer } from 'voxeltracer';

const tracer = createVoxelTracer({
  container: document.getElementById('app')!,
  src: 'model.vox',                 // URL or File
  maxSteps: 1000,                   // accumulation budget
  onRendered: () => console.log('converged'),
});

await tracer.load(otherFile);       // swap scenes
const jpeg = await tracer.captureAsBlob();
tracer.dispose();

The tracer creates its own canvas inside container, wires orbit controls and resize handling, and runs its own render loop.

Backends: the path tracer runs as a WebGPU compute shader when available and automatically downgrades to a WebGL2 fragment pipeline otherwise (backend: 'auto' | 'webgpu' | 'webgl2'). Both backends are verified pixel-equivalent by the golden tests; WebGPU is 15–70% faster depending on the scene. WebGL2 is the floor (universal in browsers since 2021).

Development

npm install
npm run dev        # demo app at http://localhost:5173
npm test           # vitest (parser, packers, texture layout)
npm run build      # demo app -> build/
npm run build:lib  # library -> dist/ (ESM + UMD + d.ts)
node scripts/generate-vox.mjs   # regenerate stress-test .vox files
node scripts/golden-test.mjs    # pixel-compare both backends vs goldens (needs dev server)
node scripts/perf-test.mjs      # backend throughput comparison

Sample files live in public/vox/ — including generated stress scenes (generated/: a 256³ sphere, a 16-model 100M-cell terrain, a 100-model scene) and CC0 models from mikelovesrobots/mmmm (web/).

Architecture notes

  • src/core/createVoxelTracer.ts — public entry; canvas + controls + loop wiring
  • src/Renderer/VoxelRenderer.ts — three.js WebGL2 pass: half-float ping-pong accumulation, trace + display passes
  • src/Renderer/shaders/pathTracer.frag — GLSL ES 3.00 kernel (DDA voxel raymarch, dynamic shape count, PCG RNG)
  • src/Data/ — MagicaVoxel chunk parser (.vox versions with and without scene graphs), 3D atlas packer, material/palette arrays
  • docs/webgl2-upgrade.md — the WebGL1→WebGL2 migration assessment this rewrite followed, including a WebGPU appendix

License

MIT