Voxels: Rasterizer 1.2

Eventually I submitted a new version of my Voxel conversion tool for Unity to be published on the Asset Store. The previous version had been taken off without warning in the summer of 2019 due to missing updates for newer Unity versions and modified guidelines for the usage of the logo. That second point is also the reason the package has been renamed.

Quickly after the store removal I started to make sure my rasterizer was still working with the latest version of the application. And that was the case but only for the standard pipeline unfortunately. At that time the Lightweight and the High Definition Render Pipeline had been introduced and the rasterizer did not read meaningful data from the results of the utilized camera. Because a major advantage of my solution was the ability to collect colors from source assets similar to how they are being rendered at runtime I wanted the support the new options, too.

I started to debug things, which was not easy because the APIs of those pipelines were not deeply documented. So I had to do research by trail-and-error, which took a lot of my spare time. And both scriptable pipelines required different approaches for manipulating the camera to get the results my tool needed. Hundreds of hours, which mainly happened on vacation and around Christmas, passed until a satisfying outcome loomed. In between there were months I couldn’t do anything because my job demanded my complete focus.

Voxelized HDRP standard scene
Comparison between the new HDRP standard scene and its voxelized outdoor room

After operating suitably another issue, which some customers experienced in their workflow, still remained. Despite indenting the mesh creator script only as an example people are using it heavily to create assets for their projects. And whenever they wanted to build a prefab of a generated voxel model data got lost. So, I enhanced the component to be able to create mesh, material and texture files and a prefab containing them.

At last I had to polish the sum into a releasable product by refactoring the source code, updating the artwork and the documentation. Finally, that whole process took about one and a half year. But as long as no such huge changes in the rendering routines of Unity will emerge once more in the near future updates of “Voxels: Rasterizer” should become more frequent again.

FutureTrade for free

On Christmas Eve of 2020 my father passed away and beside the grief I walked down the memory lane. This led to an intention, which I already wanted to realize multiple holidays ago.

My first commercially available computer game, which had been released in 2000, is not being sold for a long time anymore because the original publisher had been shut down. Some years ago I tried to start the DOS game in Windows 7 or 8 but there was an issue with the mouse handling when using DOSBox as emulator. The cursor stuck at the upper edge of the screen. I wanted to fix the problem and installed the original development environment in a virtual machine. But all in all it claimed too much time so the everyday life took my attention away.

After last Christmas I made another attempt by looking into the possibility to install the original mouse driver. Research brought me to DOSBox-X, which is a derivation of the original emulator and has got more options. Utilizing that application it was possible to get correct mouse control.

After playing the game for a while I decided to re-release the game but this time for free. I figured out a way to publish a package, which should make it easy to start the game without the need to download multiple archives and adapt a configuration to match the file paths on the target PC. You can get it here. But be warned: There is only a German version, because the product was never released outside of Germany, Austria and Switzerland.

I did not stop there and also made the source code publicly available. It is mainly written in Turbo Pascal, has got few commentaries and is a mix of English and German descriptors but there are also some interesting things like working with interrupts, 16 bit address space or 2,5D terrain rendering in Assembler using less than 256 colors. Maybe it could be a place of discovery for digital archaeologists. Have fun!

And I want to dedicate that repository to my father, who like my mother supported my passion, which turned into profession and so enabled this game to exist.

Voxels for Unity: Version 1.1

An update for my Unity plug-in has just been released at the Asset Store. It took me much more time to get a collection of new features and useful enhancements, which are worth to be published, than I had originally planned. Here are the key ones:

Voxels for Unity 1.1

  • Adaption to Unity 5.6 and 2017
  • Better results using PBR (physical based rendering) and HDR (high dynamic range)
  • Two fully working file exporter examples added: PLY (common point cloud format) and VOX (MagicaVoxel editor format)
  • Rasterizer enhanced by supersampling and multithreading options
  • API enhancement: Callback parameter to inform the executing script about the creation of new game objects
  • API extension: New class to decrease number of resulting materials in a processor to given amount
  • Multi-textured terrain included into the example scene
  • Bug fixes for minor issues

If you are interested in acquiring the extension to convert common Unity assets into Voxel objects or files, you can use the following link:

But if you have already purchased it or want to have a look into the manual before, here is the updated version:


 

Voxels for Unity: Release at the Asset Store

In fall the tool had been rejected by an administrator of the Unity Asset Store because they perceived it as a complete tool, which cannot compete with existing packages. Generated objects with high color variation had too many draw calls and the complete conversion process was taking too much time. After explaining that my extension focuses on the scanning step, that this step is done in a unique way by using the GPU so it would add a matchless feature to the store and that the generator scripts are only examples to show the ability to use it in existing or own frameworks, the administrator advised me to adopt the description, to change the title and maybe to include more examples. I really modified the statement and added a subtitle to underline the main function of the extension. But before I did a lot of work to improve some of the points, which had been criticized.

A mesh and a tree from the Asset Store had been converted to voxel objects. Half of a combined object had been voxelized and is displayed using a sphere for every cell.

First I tried to implement multi-threading and I could really accelerate the rasterizing by 100% for more complex tasks. Unfortunately sometimes there are errors in the result objects and I did not find the reason up to now. So I removed the option from the inspector but it is still available using an undocumented API command.
Next I included an iterator to access only filled cells and I changed the mesh processor script to utilize it. That way I improved the building time for voxel meshes. Moreover I added a new processor class to store coloration data into a 2D texture and implemented options in the mesh script to make use of them. Such data can also be stored per vertex now. Both ways are allowing the merge objects with high color variation much better and so massively reducing the draw calls. Thus I optimized the creation as well as the presentation.

As you can see in the manual I refactored the class Voxels.Converter to Voxels.Rasterizer because the former name rather described the whole execution. And I removed Voxel from scripts like Voxels.VoxelMesh so the duplicated labels vanished.

I resubmitted the package on Thursday. In fall it took about two weeks to get a rejection notification but this time “Voxel for Unity: Rasterizer” has gone live within a day and can be purchased at the Asset Store now.

Voxels for Unity: Tutorial

I added a tutorial video to YouTube. It shows how to add the extension to your objects, so they get converted to voxel meshes. Moreover you can see how to set up materials for best outcome and how important properties of the plug-in impact the result.



Please turn on the sub-titles, if you want to get more information!

Voxels for Unity: The release version



“Voxels” is being published as an extension to the Unity runtime and editor via the Asset Store. Its purpose is to scan existing graphics for its colors or materials and store those into a three-dimensional data structure. Those scanned cells can be called “volume pixels”, or voxels for short, and are being transferred to processor classes. Two types of processors are included in the release package.
The first one constructs a hierarchy of game objects from the incoming data and attaches a specified mesh, a renderer and a material to every of its objects. The material is instantiated using a standard shader or a given template and modulated by the sampled color data of the individual cell. An optimization can be enabled to merge multiple voxels that share the same material into single meshes.
And the second processor is able to store the voxel data into a particle system, which is also instantiated by a given one.
Because there is a very simple programming interface it is easy to write own scripts, which are building other game objects, passing the voxels to volume textures, converting the data for (existing) scripts respectively plug-ins or even exporting them to be used outside of Unity. You can use the two included processor classes as blueprints for your own efforts.

But you can also stay away from programming and only utilize the user interface of the components to create appealing voxel graphics. The conversion can be done in the edit mode and while the game or application is running.

Converter inspector in edit mode Converter inspector in runtime while processing

It is also possible to mix inspector adjustments and scripting. For example you set up converter and processor properties in the editor but the operation will only be started when an event in the game like loading a level occurs.

The scanning process works by rendering the desired items in slices to off-screen buffers, which are being copied to main memory afterwards. Whenever a pixel is set, its color is added to a cell in an octree. Later the colors are being combined per cell using mathematical operations or a more complex algorithm for the most frequent color method. That way source materials, lights and shaders remain intact and you get a result comparable to the original, if the settings are right. And this solution is the unique feature of the tool because other, existing extensions are using the ray casting methods provided by Unity. Those methods do not perceive vertex transformations by the shader or material computations per pixel.

Voxels logo

Further on you can also create results that only resample the shape of the basis but contain total different surfaces and appear as holograms, dust clouds, artistic effects and so on. Another option is the ability to animate voxels, e.g. for detonating 3D models or transforming between different ones.

Converter inspector in runtime while processing

Unfortunately not everything works the way it has been planned. Shadow maps seem to become effectless and particle systems are culled in the scanning process because of the near depth clipping planes. Up to now no options could be found to prompt Unity to use other clipping values for shadow map creation or not to hide specific objects while rendering. But I am still looking for answers. Moreover I want to include new features into upcoming versions. Some will help to make the conversion more powerful, others may handle the results in various directions.

Voxels: A personal introduction

In my free time of the past year I developed a tool for Unity, which arose out of Project: Evolution. For the planned main effect I need pixels in three-dimensional shape to advance graphically from level to level. Those cells are commonly called voxels, which is a combination of “volume” and “pixels”, and they have to be generated from 3D models with generic meshes like I did it for the 2D presentation in the prototype. So I started to program a solution to do the conversion and shortly afterwards a decision grew inside me. Because there was no plug-in comparable to mine I wanted to release it as a product, which other people can use.

The actual functionality for meshes had been finished relatively rapidly but at that state it was a quick-and-dirty implementation, which could be used in-house but was not ready to be published. I began to adapt the user interface and polish the functionality. And it lasted a long time and there are still sections to improve and features to be added. But I am satisfied by now and intent to release “Voxels overview” in the next days.