Demos

8 scenes, each drawn in your browser as you read this. 7 of them generate every polygon when the page opens, with no model and no image of any kind. Showroom loads one, which is the other half of what the engine does. The figures under the frame are that frame's own, read from the renderer. A game a coding agent built from one prompt plays on a page of its own.

Drag the scene to turn it, or scroll to zoom.

Voxel sandbox

A block world generated from a seed, streamed as you walk it, and played rather than watched: break a block, place one, swim, and watch a day pass. It is a port of the Voxel Sandbox demo from Babylon Lite, kept module for module so the two can be read beside each other, and the interesting part is where the work ended up. That one carries its look in two materials it wrote by hand, 351 lines of shader between them. This one writes no shader at all. Ambient occlusion, block light, the fog ramp, cutout foliage and translucent water are all the standard material, reached by handing it the right vertex data and the right render mode.

Watch the corners where blocks meet, and the underside of a canopy. That shading is ambient occlusion baked into the vertex colour by the mesher, which the standard material multiplies into the atlas texel, so it costs one float a vertex rather than a pass. Then read the figures under the frame: at the spawn, 115 of 169 chunks in memory are rejected before a draw call is issued, because each chunk is a scene node with bounds and the traversal throws out a whole one on a single sphere test. Walk in a straight line and watch that number move as the world streams past you.

  • visitVisibleWalks the chunk tree and rejects what the frustum cannot see, one sphere test per chunk rather than one per block.
  • MeshDataThe mesher writes positions, normals, vertex colour, emissive and UVs directly. Ambient occlusion and block light are vertex colour, not a shader.
  • drawSkyThe gradient dome, the sun, the moon with its phase and the night stars, from one struct the day-night clock fills.
  • drawTranslucentMeshWater and glass, blended, and the hotbar tiles drawn unlit so they stay the colour the atlas holds.
  • ParticlePoolBreak debris and splashes, integrated with drag and gravity by the engine rather than by the scene.
  • loadModuleFalling blocks and mob behaviour are DriftScript modules. What a mob wants is in the script; what a block is stays in the host.

This scene is a port of the Voxel Sandbox demo from Babylon Lite, by the Babylon.js team and the Babylon Lite contributors, which is licensed under Apache 2.0. The design was ported and the code was not: none of their source is in this repository, bundled, or served from this page. It was read as a reference and every module here is written against this engine’s public API. The original is at github.com/BabylonJS/Babylon-Lite.

The block textures are the Kenney Voxel Pack by Kenney Vleugels, released into the public domain under CC0 1.0. The twenty seven tiles this scene uses are downloaded from kenney.nl when this site is built, pinned to one release and checked against its hash, so nothing here is a stale copy of somebody else’s art. Kenney’s licence is served beside them at /voxelpack/License.txt. CC0 asks for no attribution; this credit is here anyway, because a reader should not have to work out where the pixels came from.

DriftEngine and Drift Technologies are not affiliated with, endorsed by or partnered with Mojang Studios, Microsoft, or the Babylon.js project. Minecraft is a trademark of Mojang Studios. The genre is what this scene demonstrates, and those names appear only to say truthfully what it is a sandbox of and whose demo it was ported from.

Get in touch

Join the Discord Ask questions, share what you are building, and talk with other developers.

info@driftengine.dev