punkratio
Voxel mesher · Rust · WebGPU

Perfectly sealed voxel surfaces, in microseconds.

Punkratio turns voxels into the smallest crack-free triangle meshes possible, in a small fraction of a frame.

  • minimal triangles
  • watertight
  • 16-bit materials
  • high performance
Fig. 1The same staircase, two ways
Voxels in
264 voxel faces
Triangles out
30 triangles
Faces toward the camera onlyIllustrative
What sets the mesh apart

Where a typical greedy mesher gives something up, Punkratio doesn't

Minimal and sealed

Naive meshing spends two triangles on every voxel face: 24 for this frame. A greedy mesher cuts that to 8, but only by leaving four t-junctions, and those open as cracks.

Close them and the greedy mesh grows to 12. Punkratio stays at 8 with no t-junctions, the minimum for a sealed surface.

THE SAME SQUARE FRAME OF 12 VOXEL FACES One quad per voxel 24 triangles sealed, but wasteful Greedy quads 8 triangles 4 t-junctions: cracks Punkratio 8 triangles no t-junctions: sealed
A WALL ACROSS TWO CHUNKS Greedy, per chunk t-junction: pinhole Punkratio seam vertex shared

No cracks between chunks

Meshing each chunk on its own leaves t-junctions on the seams, and those show up as pinholes. Punkratio's chunks agree on every seam vertex.

204 µs 32³ gyroid chunk of a 16,667 µs frame Measured on a MacBook Pro M4

Fast on the hard shapes

The demo's gyroid labyrinth, shown here for one repeat of the pattern, folds through every voxel. Punkratio meshes the whole 32³ chunk in about 0.2 ms.

Spec sheet

Time to mesh one 32³ chunk

Criterion results on a MacBook Pro M4, native build, one thread. The checkerboard is the worst case: every other voxel is solid.

Terrain37.1 µs
Sphere68.6 µs
Layered terrain92.4 µs
Ortho labyrinth193.4 µs
Gyroid204.2 µs
Checkerboard479.6 µs
Live demo

See every triangle

The mesher itself, running in your browser. It needs a browser with WebGPU.

  • Enternext shape
  • Tabshow the triangles
  • 1fly over a world made as you arrive
  • 2rain on a puddle
  • Jin the flight, swap in a mesher that leaves t-junctions
  • Lin the flight, a seam test that shows every crack

Loading demo…

About

A personal project, shown as a portfolio piece

Punkratio is a voxel mesher written in Rust by Aldo Stracquadanio. This page is a playground for it and a sample of the work.

Get in touch

Questions, ideas or a chat about voxels are welcome.

Contact details are on their way.