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.
- Real-time polygonization based on the TransVoxel algorithm
- Level of detail
- Dynamic Material support
- Dynamic manipulation
- Voxel grid compression
- Scalable implementation
- Pluggable grid generation
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.
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.
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.