Destroying voxel with structural integrity check

0
Pixellore posted this 27 October 2015

This question may not be directly related to picavoxel itself, but i thought it wouldnt hurt to ask in here since there maybe more voxel experts than myself.

so. destroying voxels are fun.. but when we bring some destruction to our world, i am looking for a way to implement some sort of structural check so that..

  1. There are no floating voxels in the air. single or groups. (well unless i allow them to be such as birds or clouds..)
  2. Some sort of checks to find out if there is voxel that has very unrealistic structures such as very long thin horizontal row of voxel having very large chunks of voxel volume at the end.

i am looking for some in-sights into such thing so that i can simulate a building collapsing with enough damage to the bottom structure of a building etc...

if anyone has idea or in sight into this please can you show me some light? i am guessing because of the nature of voxel and its simplicity this kind of simulation must be possible and should be easier than trying to do it in other normal traditional 3d mesh.

thanks.

2 Comments
Order By: Standard | Newest | Votes
0
Pixellore posted this 27 October 2015

perhaps something like this?

http://www.rockpapershotgun.com/2011/08/01/a-new-zero-voxel-destruction/

0
GarethIW posted this 27 October 2015

I've thought about this exact thing a lot, but I just don't know how you would accomplish it and still maintain a decent framerate. Not in Unity at least, not without doing calculations on the GPU which is waaaay out of my area of expertise.

I mean, a basic idea would be to check each voxel for X number of adjoining voxels. If it's 1 or less, make it break off.

It's juts a matter of how you do this efficiently. You can't check every voxel every frame. Throwing ideas out there, this is how I would approach a first interation of this:

  1. When an explosion occurs, store the boundaries of a vertical slice of the volume that the explosion hit. So basically, an imaginary cube that the explosion radius can fit inside, but extend it to the "bottom" and "top" of the volume on the Y axis.
  2. Each frame thereafter, process a 1-voxel high vertical slice of the voxels inside the boundary you created in step 1.
  3. if any of the voxels only has 1 adjoining voxel, destroy it and spawn a particle in its place that is only affected by gravity.

It's an interesting little project that I might try sometime. Still reckon that it'll be too slow in Unity.

Edit: thinking about it, it would probably have to be < 3 adjoining voxels otherwise you'd need multiple passes.

edit 2: yeah, still wouldn't work properly. you would need to properly analyse for rational structures.

i mean, it could be something as simple as:

  • a voxel is supported if it is joined by more than 1 horizontal voxels.
  • a voxel is supported if there is a voxel below it.

Last edited 27 October 2015


Our 123 members have posted 454 times in 109 discussions