A voxel-space terrain renderer in the style of the classic Comanche engine, built entirely by hand without any AI assistance. Source on GitHub: LinusRichter/voxel.

The renderer is written in Zig and compiled to WebAssembly. It raycasts a 1024x1024 height-map with a matching color-map every frame and paints the resulting pixels straight into a canvas, while the JavaScript side only handles image loading, keyboard input and the FPS counter. Terrain is sampled relative to the camera position, wrapped at the map borders and clipped with a per-column height buffer, so you can fly over the landscape endlessly with WASD.

The terrain is defined by these two maps: the height-map stores the elevation of every point, the color-map its ground texture.

Color map
Color map
Height map
Height map

Rendered live from these maps:

Voxel terrain render