Voxel Space (2017)

294 points · 62 comments on HN · read original →

Explanation and web demo of the Voxel Space rendering technique used in 1992's Comanche, with algorithm implementation details.

Voxel Space is a 2.5D terrain rendering technique that powered Comanche (1992), considered three years ahead of its time. The engine uses paired 1024x1024 height and color maps to represent terrain. The core algorithm renders vertical lines by iterating from back to front (or front to back with a y-buffer), determining map coordinates at each screen column, applying perspective projection, and retrieving height and color values. The basic algorithm requires only a few dozen lines of code. Performance optimizations include rendering front-to-back with a y-buffer to eliminate overdraw, level-of-detail by increasing step size for distant terrain, and camera rotation via coordinate transformation. Color maps contain pre-baked shading and shadows, eliminating runtime lighting computation. The technique cannot represent overhangs or complex geometry like buildings.

What HN community is saying

The author clarified that the painter's algorithm approach is integral, not just a pedagogical step, though front-to-back rendering with y-buffer is the actual optimization. A technical dispute emerged over terminology: commenters argued the height map is not true voxel geometry since it lacks overhangs and gaps, storing only the topmost column value. One commenter noted pre-baked shadows in color maps create a 3D bevel effect. Someone mentioned porting the technique to AGS Engine and making a game with it. Camera limitations were discussed: the original could tilt but not roll without auxiliary frame buffer transforms, a constraint that shaped game design at the time.