Unity integration – finally some progress!

We’ve been talking about Unity integration for months, but today I can finally prove that we’re working on it 🙂 The screenshot below shows a simple terrain loaded by Cubiquity, with the data then passed through the plugin interface and rendered by Unity:

Unity3D Cubiquity integration

I had never worked with Unity before attempting this so there has been a lot to learn. I knew that Unity used .NET for scripting and that ‘C++ support’ was only available in the Pro version, but I had assumed that once you had this you could write your games in C++ using Unity as a library. But as anyone who has actually used it knows, that’s not how it works at all.

The way it works instead is that C++ code can be complied to plugins which can then be loaded at runtime. One limitation here is that you have to provide a C API (or at least avoid name-mangling issues) whereas Cubiquity is written in nice templatised C++. So some time has had to be spent creating a C interface to this. Actually there are other options such as C++/CLR, but the C API seemed like it would have the most value in other scenarios.

On the plus side, it turns out that loading plugins does actually work in the free version of Unity (with limitations) so those users will still be able to try out the system when we produce a test version.

Anyway, it’s very much a proof of concept at the moment but it does look like it’s going to work. I can see now that it will take a little longer than we originally thought but I still hope we’ll have a lot more to show off in the coming months.

Share
This entry was posted in Uncategorized and tagged , by David Williams. Bookmark the permalink.

About David Williams

David is a post-doctorate researcher at the University of Groningen, The Netherlands, where he is investigating GPU computing. Prior to this he worked in the games industry and wrote graphics/engine code for a number of PC/PS3/XBox titles. As well as making games he occasionally enjoys playing them, and also sometimes gets outside to do some photography.

3 thoughts on “Unity integration – finally some progress!

  1. Awesome! I’ve got a voxel-based game idea that I was planning on making in Unity soon. I’ve rolled my own voxel mesh generation in Unity before, but I’m sure polyvox would do this better than I ever could achieve on my own. I will watch this space =)

  2. By the way, as both an experienced C++ programmers and Unity developer, I’d be interested in contributing to the Unity integration side of things if this is in the git repo?

    • Thanks Joe, but actually the source code isn’t public. We intend to sell Cubiquity as a plugin which links PolyVox to Unity3D, and so it’s all in a private repository.

Leave a Reply to David Williams Cancel reply

Your email address will not be published.