Voxels Library


Voxels is a C++ library for manipulating and polygonizing (transforming into triangles) voxel grids in real-time applications. It can be used to implement volume rendering. It is geared for large meshes like terrains.


The library is open source under the 3-clause BSD license.


http://github.com/stoyannk/voxels – Open source version of the library and detailed documentation

http://github.com/stoyannk/volumerendering –  Open source sample application for Voxels (binary releases available too)

Pre-built sample available here.

Major Features

  • Real-time polygonization based on the TransVoxel algorithm
  • Level of detail
  • Dynamic Material support
  • Dynamic manipulation
  • Voxel grid compression
  • Scalable implementation
  • Pluggable grid generation
A hand-sculpted surface started as a ball. Voxels supports multiple materials and normal mapping

A hand-sculpted surface started as a ball. Voxels supports multiple materials and normal mapping

Voxels advantages

Voxel-based surfaces allow for more freedom than usual polygon-based ones. The major advantages of such a representation can be summarized as follows:

  • Freedom of form – You can create virtually any surface configuration. Gives much more possibilities than heightmaps for terrains
    for instance. With usual heightmaps you can’t have caves or overhangs as part of the terrain mesh.
  • Destructibility/constructibility – The voxel surface can be trivially modified in real-time allowing easy sculpting. Allow users to create their worlds or destroy them.
  • Procedural generation – Procedural surfaces can easily be created, which diminishes greatly the content creation effort and possibly the memory footprint of the whole application


Voxels implements two important aspects related to volume rendering. The surface to render is represented by a voxel grid – a 3D grid of elements with properties for each that approximate it.
It also implements a polygonization algorithm that creates triangles from the voxel grid. Those triangles are usually what gets sent to the graphics adapter and rendered to the client.

Procedural world with two materials

Procedural world with two materials

Documentation and Samples

Detailed documentation and API reference are available in the library’s page on github – http://github.com/stoyannk/voxels. A detailed sample complete with surface generation, manipulation, and multi-material rendering is available here: http://github.com/stoyannk/volumerendering.


Voxels is open source under the permissive 3-clause BSD license.

Procedurally generated world

Procedurally generated world


Feedback is really important for me and for the future development of the library. Please if you use Voxels, find any bug or need a feature – write to me at stoyannk [at] gmail [dot] com or drop me a line on twitter @stoyannk.

10 thoughts on “Voxels Library

    • The library only handles the voxel grid and the polygonization – it generates triangles from a voxel representations of the surface.
      The surface itself can be generated via analytical functions – simplex noise for instance. There is an API that allows the user to create surfaces in this way and that’s what’s used in the videos. The textures are not procedural but normal ones (pre-generated) that I found on the Internet. You can mix many textures (materials) and with the proper shader for triplanar projection it’ll apply the “cliff” one on parts that are mostly vertical and the “grass” ones to part that are mostly flat. Of course you can have many types of materials as in the videos there is ice, sand etc.

    • Hi Christopher, there is no info on the unlimited version as licensing is not finalized yet. However please drop me an e-mail at stoyannk AT gmail DOT com and we can discuss what you need.

  1. Hi, what do you recommend is the best way to use sharp edges (for blocky type shapes) alongside the smoothed edges?

    • The different levels of the grid are compressed independently and split into blocks with a a fast RLE-style compression. This allows me to keep the grid in compressed form and un-compress a block on the fly when it’s are needed.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s