Time to release something that’s been gathering dust on my hard drive for a bit too long: I wrote a CUDA-accelerated voxelizer. It converts polygon meshes into annotated voxel grids. You can download source code and executables on Github.

Written in C++ / CUDA

Outputs data to .binvox file format (default) or a morton-ordered grid. More output formats (magicavoxel, minecraft schematic) are in development.

Requires a CUDA-compatible video card. Compute Capability 2.0 or higher (Nvidia Fermi or better).

cuda_voxelizer implements an optimized version of the method described in M. Schwarz and HP Seidel’s 2010 paper Fast Parallel Surface and Solid Voxelization on GPU’s. The morton-encoded table was based on my 2013 HPG paper Out-Of-Core construction of Sparse Voxel Octrees and the work in my libmorton library.

cuda_voxelizer is built with a focus on performance. Usage of the routine as a per-frame voxelization step for real-time applications is viable. More performance metrics are on the todo list, but on a GTX 1060 these are the voxelization timings for the Stanford Bunny Model (1,55 MB, 70k triangles), including GPU memory transfers.

Grid size Time 128^3 4.2 ms 256^3 6.2 ms 512^3 13.4 ms 1024^3 38.6 ms

More to come! I’m focusing on outputting to Minecraft schematics ASAP, to offer an alternative to Patrick Min’s excellent, but memory-limited binvox.

There is also still a lot of headroom for performance improvements.