Cubiquity for UE4 - Voxel Terrain Plugin

Hi all,

I’m Matt from Volumes of Fun, a hobbyist software studio based in Europe. We’re probably best known for the open-source C++ voxel management library, PolyVox which is available for commercial use by all for free.

On top of PolyVox, we also develop and sell Cubiquity, a 3D engine integration layer. So far, most of our work has been focused on Cubiquity for Unity 3D but we’ve been fans of Unreal Engine for a long time (since the first game) and so we are now actively working towards getting Cubiquity for UE4 off the ground. For the Unity3D version we provide a completely free version for non-commercial use and a $200 license for use in commercial products. I imagine we will have similar terms for the UE4 version but this is not set in stone yet.

The UE4 plugin is still in early development but can already import Cubiquity VDB files, render smooth terrain with blended tri-planar texturing and create correct physics meshes. Here’s a few screenshots of what’s running at the moment:
Terrain as it appears in the editor
The wireframe generated by Cubiquity
Showing it in game mode with a 3rd-person actor

Next, I’m planning on getting live editing of the terrain working (both in edit mode and play mode) which will all be exposed through blueprints.

By the first release we plan to have feature parity with the Unity3D version and so Cubiquity will provide:

  • Support for both smooth terrain and **colored cubes **type environments (video examples from Unity3D).
  • Support for multiple volumes which can exist in transform hierarchies.
  • Unique material blending algorithm on smooth terrain.
  • Direct voxel access for implementing procedural generation.

Update September 2014

Update January 2015

First demonstration of large coloured cubes data being loaded into Cubiquity. Voxel data from Ki11aWi11.
A view showing a chunk of the map from the top of one of the buildings.
Raining down destruction on the ground below.
Everything in the map can be destroyed and interacts properly with the physics engine.

Update February 2015

If you want to follow our progress, I will be posting updates in this thread as well as at our usual places:

If anyone has any questions, I’d be happy to answer them.

Looks awesome. I’ve been a big fan of voxel terrain since about 2003, and although you can achieve somewhat similar effects using static meshes these days, you can’t beat how intuitive voxel editing can be.

Would be interesting to see that example with texture blending (based on an alpha) and tesselation - I think that could avoid the typical problem of ‘smoothness’. Does the plugin import a completed mesh ingame, or does it have dynamic LOD?

Yeah, we’ve been working with voxels for a long time. The earliest parts of PolyVox date back to around 2006. I agree that editing voxel terrain can be nicely intuitive as I think we show in this video. We’ve got some interesting plans for the future for using Dual Contouring with some custom tweaks to get the best compromise between smooth and sharp features.

The plugin breaks the volume down into chunks in an octree and creates a mesh for each chunk. Cubiquity includes the ability to load dynamic LOD versions of octree nodes as shown in this video using Gameplay3D. LOD isn’t working yet in UE4 but it’s on the list.

So got a few questions about Cubiquity as well as a few suggestions.

Questions -

  1. Does Cubiquity allow for infinite terrain?
  2. What are the file size of individual .VDB files?
  3. What platforms are supported with this plugin so far?
  4. Is Cubiquity network ready?
  5. Are the block and smooth terrain going to be toggle able via a bool or will it be a shader option?

Suggestions -

  1. Can we import real world terrain data (Heightmap) into Cubiquity for making real life game worlds? If not would this be possible?
  2. Would it be possible to hook this up to the World Browser Tools? This would allow us to arrange out voxel terrain to fit our worlds needs as well as layout.
  3. Support Biome Generation at runtime both via blueprint and C++.
  4. Support AI navigation with cubiquity.
  5. Support network replication via blueprint and C++.
  6. Support for Optional Destruction of terrain at runtime.

Thank you for your time,

  • HeadClot

Please let us know when you need testers. You are one of only 3 people I follow on twitter. And Cubiquity in UE4 was exactly what I was hoping for.

  1. At present, no. There’s support in PolyVox for infinite terrain but it is not yet exposed to Cubiquity. This is because different engines support this sort of thing in different ways. This is something we may look into in the future but I’d have to defer to David for any more idea about priority.
  2. The VDB for the volume shown in the screenshots above is ~300kb. The VDB file is essentially a SQLite database containing the information so there is some generic compression going on there as well. The VDB for an equal-sized cubic terrain volume is about 10% of that size.
  3. At present Cubiquity for UE4 is only being tested on Windows since the UE4 Linux support is only basic at present. Cubiquity itself works on Windows, OS X and Linux and the UE4 plugin will follow this once it starts to get stable.
  4. Cubiquity itself has no built-in network support. However, within UE4, it should be simple enough to integrate it with the standard network replication to work as expected for a multiplayer-type game.
  5. The blocky and smooth terrain meshes are created by different function calls and the geometry is distinct. We have some interesting long-term plans for combining the two modes using a Dual Contouring variant which would allow per voxel sharpness to be set to have the two styles in one volumes.
  1. Absolutely. This is relatively trivial to support. There’s no in-editor tooling for this yet in UE4 though. The only slight complication would be texturing; usually with heightmaps you have a set of texture masks for the surface material but with voxel terrain you need to set the material in the bulk if you want any destructibility.
  2. I haven’t really looked into WorldBrowser much yet but I think it would definitely be in our plans. It’s exactly this sort of engine integration which we’re aiming for with Cubiquity. We want to make sure people’s workflows with traditional terrain can carry across to Cubiquity.
  3. This is a layer above what we’re currently planning with Cubiquity. For the first release at least we will be providing only simple authoring/importing tools. However, since users will have full access to the underlying volume data, anyone could write their own in the meantime.
  4. In PolyVox we have an implementation of A* through a volume with customisable logic. It’s not exposed in Cubiquity yet though. Once it is, we would want to make sure it’s integrated well with the expected UE4 tools. Otherwise, since Cubiquity creates standard Unreal meshes, and ‘magic’ path-finding tools which automatically locate flat surfaces would work anyway. In the medium term we would recommend using an existing solution for this.
  5. Certainly planning on this. It will be waiting until we have feature parity with the Unity3D version though.
  6. This is going to be one of the next things I get working. PolyVox and Cubiquity have excellent support for this as shown in this video.

Will do. As son as I’ve got the base functionality working and have packaged it up as a proper plugin, I’ll advertise on this thread for some initial testing.

Are there plans for in-editor creation/sculpting?
Or will it be a separated voxel editor from which you can only import your finished meshes?

We have plans to have full sculpting + texturing support inside the editor. You can see what we have in Unity3D in this video. Alongside this we have support for importing volumes from external editing tools (such as MagicaVoxel as seen in the docs) and it’s very simple to extend this to cover new tools too.

Sweet! Looking forward to the first release :smiley:

One thing that would be really awesome is if you could take the mesh extracted from the voxel data and bake it into a static mesh along with UVs. That would allow you to use it as a level design tool ala BSP, but with the awesome quality and organic shapes that the smooth voxels give you.

Looking great so far guys! Really looking forward to it because i will definitely use this plugin, if not for personal hobby projects… then for sure something more serious. What does the general roadmap look like for coming close to feature parity? I don’t like release dates what so ever (cause i know what it entails) but what would be a safe guess? 1-2 months or close to 6-9? (just gauging time frame :slight_smile: )

Thanks guys!

OMG yes please :smiley: :smiley:
You could even use it as a perfect sketching tool then.
Build the voxel thingie you need in that exact position.
Bake it into a mesh and export it.
Use your favourite 3D app to add details and custom textures.
Import the new mesh fitting perfectly.

Hell yeah. That would be fantastic. :smiley:

This would be technically possible and could make sense for very static terrains. The problem with UVs is that voxel terrains are difficult to unwrap to a 2-dimensional map. Instead of this, Cubiquity uses tri-planar texturing which is much more robust for our needs. Of course, you could still do the texturing yourself using the Cubiquity example.

Since implementing this feature would take time away from getting the primary features working, it would have to be something we defer until the future but do remind us of it and if there’s enough demand, things might be moved around in priority.

It’s very difficult to say. I would estimate, based on the timings for the Unity3D version, that it will be several months until I have a testable beta version working and perhaps 6-9 months after that until a first release. Of course, it could easily end up being longer than that as all the development work is done in our spare time.

I will be making updates here though so it should all become clearer as we get closer to the time.


Over the last few days I’ve been reworking the internals of the plugin to make it fit better with the UE4 way of doing things in order to try to bring it out of the prototype stage. As of today, I’ve got live-updating of the mesh based on the volume data meaning that you can edit the volume live in-game and have it immediately visible.

The interface to this is clunky at the moment but I’m designing it to be easily usable with Blueprints or C++.
Extruded terrain created live in-game

My next plans are to get the interface to this working more nicely, implement voxel painting and then work on tidying up the code in order to try to get a preview release out to you all.

I wrote a Polyvox plugin for UE4 awhile back for fun that I have been playing around with. However it is really nice to see you guys pull your excellent work with cubiquity into this engine. Looking forward to seeing it completed, and will love to see what your shader implementation looks like as I’m still not happy with how complicated I ended up making mine :stuck_out_tongue:

I think triplanar materials would still be fine in that case. The idea is more to get something that will let us make simple organic shapes and stuff (vs. BSP’s very rigid shapes) during the level block-out process, so they don’t actually need to have really good UVs or anything, and even just having a triplanar material there would be perfectly acceptable.

Anyway, I figured it would be low priority, but I’m happy you guys are considering it :slight_smile: I think such a feature would put the kit’s usefulness ahead quite a bit for UE4 devs, since there isn’t currently a way to block out organic shapes like that, without just having an artist on team to do standard static meshes.

Yes, I remember you from the PolyVox forums. I’m definitely having fun playing with UE4 and the integration with Cubiquity is going really well.

The shader implementation is very simple at the moment and not at all efficient (basically 4-way blended tri-planar based on vertex colours) since it’s all implemented in the Blueprint editor. I’m looking into how to do ‘proper’ shaders in UE4 so that I can make the whole thing a lot more efficient. In the meantime it works, but it’s not there yet.

For this use case, you probably wouldn’t even need to do ‘mesh exporting’. Cubiquity is able to be used simply to edit (in the editor) and render the extracted smooth mesh. You could use the standard Cubiquity system to create a volume (as many as you need theoretically) and carve/paint each one individually. Within UE4, it should be possible to add functionality to convert a Cubiquity mesh into a static mesh.

After the first preview release I’ll be starting an issue tracker/TODO list so remind me to put it on there.