Voxolith — WebGPU voxel engine

Examples

Small, self-contained pages showing the @voxolith/renderer API. Each one is a single main.ts.

  1. hello-vox — load a .vox, build the occupancy grid, render with an auto-rotating camera
  2. orbit — procedural terrain, drag to orbit, wheel to zoom, floor plane
  3. minecraft-region — drop a Minecraft .mca region and walk through it first-person
  4. world — a generated valley: terrain and a river with animated water, a village and a forest that fade into each other, a lamp to carry and a day/night toggle
  5. valley — the same valley at 20, 50 or 100 voxels per metre, down to a rat's-eye scale: refined models drawn as instances, the ground streamed in chunks, real-size rats at 1 cm; ?vpm=, ?variants=, ?rats=, ?radius= (metres)
  6. creature — rigged, animated rats from the creature generator: tap one to wound it (fur opens onto flesh and bone), tap again to take a limb off
  7. rigged — the same rats baked on the CPU (left) and posed on the GPU from one rest model (right), side by side; ?vpm=100 for finer rats
  8. nightwood — stand in a forest clearing at night at 50 voxels per metre (20 on a phone): moonlight, a cottage with lit windows through the trees, fireflies drifting between the trunks; look around, fog keeps every ray within 30 m
  9. swarm — hundreds of animated rats sharing a pose cache and a budgeted crowd stamper; hover or tap to scatter them, ?count= for more, with a live cost overlay
  10. instances — scenery and a crowd drawn by reference: six tree models placed at any heading, rats gliding and turning smoothly, nothing written into the world as they move; ?stamp stamps the trees instead, for comparison
  11. temporal — shadows and AO accumulated over frames, measured: a cottage at night under the moon, trees and two lamps, a one-tap temporal off/on with fps and GPU time side by side, rotate to see a moving view's cost; ?temporal=1, ?renderScale=
  12. bench — the renderer benchmark: one fixed, deterministic scene (a dense wood, stamped boulders, a cottage with lit windows, a pond, shadowed and unshadowed lamps, fog, circling stones and GPU-posed rats) seen from four fixed views; ?vpm=, ?view=0..3, ?renderScale=, ?quality=, ?anim=1

Needs a WebGPU browser and a secure context. Source: github.com/voxolith/examples.