• Image
  • Image
  • Image
  • Image
  • Image
  • Image
  • Image
  • Image
  • Image
  • Image
  • Image
  • Image
  • Image
  • Image
  • Image
  • Image
  • Image
  • Current Version: 1.5: 2023-07-17T16:51:43Z
  • First Published: 2022-12-19T14:11:14Z
  • Size: 3082928
  • Supported Unity Versions: 2021.3.9
tools physics

Voxel Destruction

(5 Votes)
$9.67 $9.67

Feel free to try it out yourself here: https://atan-games.itch.io/unity-voxeldestruction

Forum: https://forum.unity.com/threads/released-voxel-destruction.1431157/


Directly load from MagicaVoxels .vox files:

This Package allows you to model anything in the free Voxel Modeling Software "MagicaVoxel" and then save it in the StreamingAssets folder and directly load them in Unity.


Supported Platforms:

Windows: ✔️

Linux: ✔️ Tested on Ubuntu and Fedora, should work on most distros

Android: ✔️ Note: Streaming Assets don't work as expected on aab files, but it works fine with apk

WebGL: ✔️ Uses Webrequests to read Streaming Assets

VR: ❔ Worked on a Oculus quest 1, but I can't guarantee that it works on all headsets.

MacOS and IOS: ❓ Not tested, I can't guarantee that it works


→ Greedy Meshing:

It uses a fast Greedy Meshing algorithm that combines neighbor faces together to save processing Power.


→ Collapsing:

The package automatically detects voxel groups that are no longer connected to the main voxel object and separates them into fragments.


Performance:

The Package uses the Unity Job system to make the Greedy Meshing calculations multithreaded, you can choose between a simple Job a ForJob and a ParallelForJob.


Multiple models:

You can create multiple models in the same vox file, this will improve performance as it allows to split the Mesh calculation into smaller parts.


Voxel Intercollision:

Voxel Objects can collide with each other and have rigidbodys attached to them.


Movement:

The demo also includes a basic first person movement, that I created. You can also download it here.


4 types of destruction:


Passive Voxel Removal: The destroyed voxel is removed from the mesh, a particle effect can be added.


Active Voxel Removal: The destroyed voxel is removed from the mesh and receives his own instantiated cube.


Voxel Fragmentation: Several voxels get selected to form a new voxel fragment that is removed from the mesh and made a physic object.


Precalculated Fragments: Fragments get precalculated in the editor, uses a job to find nearest fragments.


FAQ:


Is it possible to animate voxel objects?

It is not possible to add an armature or animation frames to the voxel objects. However, it is possible to use unity's animator to animate the voxel objects using position and rotation. For example, by splitting a character into multiple parts (torso, legs, arms, head, ...) and building each in a separate object, these can then be animated using position and rotation.


Where is the Pivot of the object located?

By default, the pivot is placed on the edge of the bounding box of the voxel object. However, there is also the option to center the pivot or to place it in the lowest edge of the voxel object.


Is it possible to reset destroyed objects?

Yes the package has a built in function to reset voxel object, for this you only need to enable the "Is resetable" bool and call the "Reset()" function once the object should reset.


Is it possible to generate procedural terrain using the package?

The package does not support generation of procedural terrain. However, it definitely is possible to achieve by modifying/writing some scripts. The voxels are saved into a custom data structure that can be easily modified. There also is the possibility to use the greedy mesh jobs in other scripts since they are not directly linked to the destruction.


Is it possible to use non voxel 3D models with the asset?

No it is not possible to use non voxel 3D models (fbx, obj) with the asset. However, it is possible to convert 3D models into voxel 3D models, using this tool: https://github.com/Eisenwave/obj2voxel


Credits:


This Package is using: BetterStreamingAsset and VoxReader

The Greedy Meshing algorithm is similar to the one in CloneCraft


Add to cart
This site contains affiliate links, which means that we can receive a commission if you click on a link and buy something that we have recommended.
Although clicking on these links will not cost you anything, they will help us finance our development projects while recommending good products!