Destroyable worlds/objects with raycasting

Hi,

I am currently working on a raycaster in Unity which allows any mesh to become destroyable.

I have some videos of it here:

The videos are of very low framerate due to recording with VLC. The actual framerate is MUCH higher; I get 60 fps on a distance, and ~40fps with fullscreen raycasting (raycasting on every pixel of the screen, which is heavy). Note that this is using SBS and warping for the Oculus Rift; without this I believe the framerate will be much higher. This is on a AMD A10 K5800, a not too heavy GPU.

It should work fine also with the free Unity version.

I currently have some options built in for adjusting the raycasting: adjustable and optional dithering (search for dither raycasting), adjustable stepsizes for the rays, a customizable number of voxels per object, a 2D texture for the inside(s), and different voxel formats (smoothed, more smoothed and rectangular). On the outer texture (on the actual unraycasted geometry) you can apply a bumpmapped texture.

It works best on rectangular geometry since the voxelgrid is rectangular as well. If you watch the videos you’ll see you’ll nice results with spheres and cylinders as well. For example a tree, where the stem is thin and the leaves part is big, would work less well, so it’d be best to seperate the stem and leaves part and apply seperate voxelgrids.

Let me know if you are interested; I’ll release this plugin in the asset store if there’s enough demand for it.

Currently I haven’t implemented physics yet, this won’t take up a lot of time I figure.

I’ll release a demo in a short while.

Greetings,
Kajos

Looks nice, Looking forward to the demo.

Looks really cool to me. I would use it with some of my voxel stuff. I have created an importer so I could turn normal meshes to voxels but it is somewhat intensive depending on the quality needed, so this might be a perfect solution for something like this.

-Dane

Hi

So the advantage of this method are that you can have more advanced shapes then a normal voxel terrain ? How is the memory usage compared to normal voxels?

Memory usage is dependent on the amount of voxels. In the videos I only use 16x16x16 grids ( so 16x16x16x8 bits in GPU memory and RAM ), and use linear subpixeling to make them smooth, somewhat but better than marching cubes.