I would first like to commend the authors of Cubiquity for Unity3D. It is a nice extension that works well out of the box for my purposes. After testing the examples and reading through the documentation, my next step was to create a colored cube volume using some of the mentioned third party utilities in the manual.
Quote:
"You may wish to model your voxel geometry in an external application such as Magica Voxel, Voxel Shop, or Qubicle Constructor."
Voxel Shop is very nice, easy to use and free.
Magica Voxel editing is similar to Voxel Shop, but the file handling is clunky and confusing.
Qubicle Constructor costs $150 for commercial use, so I haven't had the opportunity to test it out.
The next part of the user manual talks about using ProcessVDB to convert the save files from above mentioned utilities so they can be used with Cubiquity's ColoredCubeVolumeData. However, there is no comprehensive guide to the commandline options available to ProcessVDB
If I type:
Code:
ProcessVDB.exe -help
I get this:
Code:
Please see the Cubiquity user manual for options and examples.
The reason I am bringing this up is because I am having a hardtime producing a file that can be used by Unity3D's Colored Cubes Volume game object. I started with VoxelShop because it was the easiest to use. The latest version of VoxelShop has 2 export options, Vox Game Format (*.vox) and VoxLap (*.vox), that seem to match the options for ProcessVDB. I created a simple colored cube 64x64x8 in size, exported in both formats and tried to use ProcessVDB to convert them into volume database for the ColoredCubeVolume. If I try to use the
-magicavoxel commandline option on the Vox Game Format file, I get this output:
Code:
>ProcessVDB -import -magicavoxel smallertest.vox -coloredcubes output.vdb
[10:32:27, INFO ]: Importing voxel database...
[10:32:27, INFO ]: Importing from Magica Voxel...
[10:32:27, INFO ]: Importing MagicaVoxel from 'smallertest.vox' and into 'output.vdb'
[Error] MV_VoxelModel :: magic number does not match
[10:32:27, ERROR]: Failed to load Magica Voxel file.
[10:32:27, ERROR]: Unhandled exception:
[10:32:27, ERROR]: Failed to load Magica Voxel file.
When I try to use the
-vxl commandline option on the Vox Game Format file, I get this output:
Code:
>ProcessVDB -import -vxl smallertest.vox -coloredcubes output.vdb
[10:36:49, INFO ]: Importing voxel database...
[10:36:49, INFO ]: Importing from VXL...
Importing vxl from 'smallertest.vox' and into 'output.vdb'[Info ]: Creating empty voxel database as 'output.vdb'
[Error ]: Attempted to write to a voxel which is outside of the volume
[Error ]: Caught 'invalid_argument' at C interface. Message reads: "Attempted to write to a voxel which is outside of the volume"
[10:36:49, ERROR]: Attempted to write to a voxel which is outside of the volume
[10:36:49, ERROR]: An error occured inside the Cubiquity library:
[10:36:49, ERROR]: Error code: 120 (CU_INVALID_ARGUMENT)
[10:36:49, ERROR]: Error message: Attempted to write to a voxel which is outside of the volume
I then attempted to use ProcessVDB on the VoxLap export using the
-vxl commandline option
Code:
>ProcessVDB -import -vxl smallertest2.vox -coloredcubes output.vdb
[10:41:38, INFO ]: Importing voxel database...
[10:41:38, INFO ]: Importing from VXL...
Importing vxl from 'smallertest2.vox' and into 'output.vdb'[Info ]: Creating empty voxel database as 'output.vdb'
[Error ]: Attempted to write to a voxel which is outside of the volume
[Error ]: Caught 'invalid_argument' at C interface. Message reads: "Attempted to write to a voxel which is outside of the volume"
[10:41:38, ERROR]: Attempted to write to a voxel which is outside of the volume
[10:41:38, ERROR]: An error occured inside the Cubiquity library:
[10:41:38, ERROR]: Error code: 120 (CU_INVALID_ARGUMENT)
[10:41:38, ERROR]: Error message: Attempted to write to a voxel which is outside of the volume
Unsure what I was doing wrong, I decided to move over to MagicaVoxel and attempt to convert one of the example files that came with MagicaVoxel. Using the castle.vox example found the vox folder of MagicaVoxel, I ran it through ProcessVDB
Code:
>ProcessVDB -import -magicavoxel castle.vox -coloredcubes output.vdb
[10:45:32, INFO ]: Importing voxel database...
[10:45:32, INFO ]: Deleted previous file called "output.vdb"
[10:45:32, INFO ]: Importing from Magica Voxel...
[10:45:32, INFO ]: Importing MagicaVoxel from 'castle.vox' and into 'output.vdb'
[Log] MV_VoxelModel :: Chunk : MAIN : 0 10552
[Log] MV_VoxelModel :: Chunk : SIZE : 12 0
[Log] MV_VoxelModel :: Chunk : XYZI : 10516 0
[Log] MV_VoxelModel :: Model : 21 21 21 : 2628
[Info ]: Creating empty voxel database as 'output.vdb'
[Info ]: Resizing compressed data buffer to 144307bytes. This should only happen once
[10:45:32, INFO ]: Exiting normally.
So far so good, I moved the output.vdb in the Assets\StreamingAssets\Cubiquity\VoxelDatabases folder, fired up Unity3D, loaded the EmptySceneWithLighting scene and added a new Colored Cubes Volume. Using the project explorer in unity, I right-clicked on the newly found output.vdb file and chose Create -> Colored Cubes Volume Data -> From Voxel Database... Then I selected the new file (output.vdb). A new file output.asset was created. Following the user manual I tried to have my Colored Cubes Volume use this new asset file.
Quote:
Return to edit mode, and again select the colored cubes volume, go to 'Settings' in the inspector, and click the small circle next to the 'Volume Data' field.
However, when I click the small circle, there is no option with the name 'output'. Therefore preventing me from being able to use my newly created volume data.
In conclusion, MagicaVoxel was the closest I got to creating a usable Volume database, but I can't seem to find away to select the generated database using unity. I was hoping someone could fill me in on what I am missing. Any help would be greatly appreciated.