About PolyVox Voxel Terrain

PolyVox is the core technology which lies behind our games. It is a fast, lightweight C++ library for the storage and processing of volumetric (voxel-based) environments. It has applications in both games and medical/scientific visualisation, and is released under the terms of the zlib license.

Images are from applications created by PolyVox users. From left to right: PolyClient, PRJZ, 3DS Max Voxel Terrain Editor.

Images are from applications created by PolyVox users. From left to right: PolyClient, PRJZ, 3DS Max Voxel Terrain Editor.

PolyVox is a relatively low-level library, and you will need experience in C++ and computer graphics/shaders to use it effectively. It is designed to be easily integrated into existing applications and is independent of your chosen graphics API. Some of the features which PolyVox provides are:

  • Volume Storage
    • Several volume implementations are provided,each with different performance, capacity, and feature tradeoffs.
    • All volumes are templatised on the underlying type, allowing you to define your own voxels.
    • Fast read/write access to the voxel data.
    • Pluggable compression for voxel data in memory (default implementations based on miniz and RLE).
    • Able to page data into and out of memory in order to support very large volumes.
  • Surface extraction
    • Generates a triangle mesh from the input volume data which can then be used for rendering.
      • Supports Minecraft style terrain where each voxel is represented by a cube.
      • Supports smooth terrain via the Marching Cubes algorithm.
    • Limited support for Level of Detail meshes for smooth terrain (Minecraft terrain does not need this).
  • Image processing filters
    • Resample the volume to a different size. Includes trilinear interpolation of density values.
    • Blur the volume in three dimensions. Implemented via a Summed Area Table for large kernel sizes.
    • More image processing in the future (morphological operations, thresholding)
  • Navigation
    • Pathfinding through a volume using a 3D implementation of the A* algorithm.
    • Raycasting functions to determine which voxels lie along a given direction.
  • Ambient occlusion calculation
    • Generate an ambient occlusion volume which can be uploaded to the GPU and sampled during rendering.
    • Per-vertex ambient occlusion coming soon for Minecraft style terrain.
  • Architecture
    • Written in standard C++.
    • Released under the liberal zlib license.
    • Cross platform.
    • No dependencies beyond standard library (though Boost required if you don’t have C++11)
    • Some work on bindings to other languages.
    • Graphics API independent.

Images are from applications created by PolyVox users. From left to right: [w]tech, Thermite3D, Forever War.

Images are from applications created by PolyVox users. From left to right: [w]tech, Thermite3D, Forever War.

The PolyVox source code is hosted on BitBucket. Be aware that it is under active development  and things do get broken from time to time. You may want to use one of our stable snapshots instead, as these are created every few months when the source code is in a good state. More information and installation instructions are available on the download page.

You can also get a good idea of PolyVox’s capabilities by looking a the list of projects using it. Most of these are created by members or our community and are not directly associated with us, but they do give a good indication of what can be achieved. If you have another project which you would like added to this page then please let us know.

Documentation is provided in several forms:

  • An article published in Game Engine Gems and available on Google books gives a good overview of the principles behind voxel terrain.
  • The API documentation lists the main classes and functions which make up the PolyVox library.
  • The user manual and examples in the source distribution are used to illustrate basic usage.
  • Our Wiki contains code snippets which you might find useful when using PolyVox. Please feel free to update this.

For more information please see the documentation page.

Images are from applications created by PolyVox users. From left to right: Thermite3D, Dental Surgery Simulator, Apophis 2036.

Images are from applications created by PolyVox users. From left to right: Thermite3D, Dental Surgery Simulator, Apophis 2036.

One thought on “About PolyVox Voxel Terrain

  1. Pingback: Welcome to Volumes Of Fun | Volumes Of Fun