Recommended Posts

We're trying to find a starting point for implementing physics like in this video.

VoxelFarm is a voxel engine which from what we can tell runs on Dual Contouring. We're attempting something similar but don't know quite where to start with realtime collision (non static) with meshes that are frequently concave. The couple of ideas we've come up with or suggestions we've heard have been along the lines of compound bodies of primitives which too me sounds like an unwieldy quantity of bodies that PhysX won't be able to handle (thinking in the tens or possibly hundreds of thousands of cells) and even if it could updating the massive compound body also sounds like a slow operation. The next idea was convex decomposition, but from what we can tell that would be too slow to do at runtime unless it's somehow creating the set of convex bodies from the volume data directly which is something we're not too sure on how it would be done (if that's even the best direction).

The SDF are very intensive in memory (e.g. PhysX had an implementation of this called PMeshes for a while, but dropped it again because of the high memory usage) so you would need to come up with some kind of compression. I heard there has been some good experience with low band SDF in the FX field recently, but I have no practical experience. In games you usually take much simpler approaches. Dennis gave a presentation on this at GDC here:

You could probably decompose your concave meshes into a limited set of convex bodies, but you would need to process your meshes ahead of time as there seems to be no dynamic way of doing this. There are other forms of convex decomposition available, but none of them are very product-level solutions and require a lot of tuning.

Edit: I just realized when you said dynamic you meant the geometry was changing, rather than moving. That is a tough one, I'm going to be doing some research into this right now, but as far as I know there is no way to decompose a concave mesh very efficiently.

Share this post

Link to post

Share on other sites

One other method might be to fill your mesh with spheres. Since you already have the voxel representation and there might be simple ways to come up with a fill algorithm. This method was used successfully used e.g. in Kong, but they used Houdini for the filling iirc.