The Voxel Sculptor — Minecraft Creative With Real Greedy Meshing
Build with cubes. 16-color palette. Place, break, fly. Greedy meshing makes a wall one quad instead of 64. Save your build as a URL hash.
What this is
A Minecraft-Creative-style voxel sculptor. Procedural starting terrain (Perlin heightmap with grass/dirt/stone strata, water pools). 16-color palette in a hotbar (grass, dirt, stone, wood, leaves, sand, water, white wool, red, orange, yellow, green, cyan, purple, black). WASD walk, space jump, shift sprint, mouse look. F to fly mode (space climbs, ctrl descends). Left-click breaks the targeted block, right- click places adjacent to the hit face. 1-9 keys select hotbar slots. TAB opens inventory grid. The world is stored as a 3D Uint8 array, divided into 16×16×64 chunks. Mikola Lysenko greedy meshing per-chunk produces one quad per visible region. T fast-forwards day/night. Save Build encodes the world as RLE+base64 in the URL hash for sharing.
Why this is mind-blowing
Minecraft has shipped on every platform with a chip in it. The rendering trick that makes it possible — greedy meshing — is here in 944 lines from one paragraph. Watch a wall slam together as one quad. That's the magic.
Single-file Minecraft-Creative-style voxel sculptor in three.js. Chunk-
based voxel world stored as 3D Uint8 array. Greedy meshing — only render
visible block faces. Left-click breaks, right-click places. F to fly.
16-color hotbar. Procedural Perlin terrain. Save build as base64 URL hash.
Paste this into Claude, Cursor, or Copilot. Change one thing that matters to you.
What I learned shipping it
- Mikola Lysenko's greedy meshing is the canonical algorithm: per-axis 2D mask sweep, expand width while same-ID, expand height row-by-row, emit one quad. Watch a wall slam together as one quad instead of 64.
- Per-chunk passes (16x16x64) for opaque vs water means transparency only emits at water/air interfaces. No overdraw, no z-fighting.
- Direction-baked vertex shading (top brightest, bottom darkest) replaces ambient occlusion at near-zero cost. Cheap is the right answer.