Octree AND Greedy Meshing Voxel Simulation

Hello! I whipped up this cool voxel demo that I think is pretty cool. It can handle different voxel sizes, debris, and uses good techniques to make it really fast.

image

Personally I think it’s really performant, and works really well. I made this video demonstration really fast, so there isn’t much detail and I slapped in some free model signs.

All the code here was written by me.

It takes in multiple parameters, listed below:

  • Hitbox (The part where the hole should be)
  • MinVoxelSize
  • MaxVoxelSize
  • Debris?
  • DebrisAmount
  • Parts to ignore in voxelization.

The code uses octree’s to divide up the cube first, surrounding only the needed voxels, then greedy meshing comes through and combines all extra parts together.

Imagine each voxel was 0.2 studs big, and i took a 20 studs big cube. I could fit 1,000,000 cubes inside that :skull:.

But, if I use greedy meshing and octrees to divide it up, I can sometimes get away with <20 parts per hole made! Of course, with big explosions its around ~120

Should I release this?

5 Likes

Please release this, I have not found a good simple greedy mesher. I’ve seen Sushi’s Greedy mesher but it only works with planes and cubes, not complex shapes like houses.

1 Like

I have actually released this! VoxDestruct | Voxel Destruction Module

Check out the example place or code to get started.

1 Like