Sign in to follow this  

Realtime collision with dynamic concave meshes

This topic is 795 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

We're trying to find a starting point for implementing physics like in this video. https://youtu.be/on-0Ou48tak?t=79

 

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).

 

Any help would be amazing.

Share this post


Link to post
Share on other sites

This is a very tough problem to solve and I am not aware of any solution for this in realtime. If I needed to solve this I would start from this paper using SDF:

https://graphics.stanford.edu/papers/rigid_bodies-sig03/

 

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:

http://box2d.org/files/GDC2015/DennisGustafsson_Destruction.pdf

 

There are some good SDF libraries out there which might be a good start. The authors of the libraries might be good initial contacts as well:

https://github.com/imageworks/Field3D

 

HTH and good luck!

-Dirk

Share this post


Link to post
Share on other sites

Another option, you could look into VHACD.

 

http://kmamou.blogspot.com/2012/11/v-hacd-hierarchical-approximate-convex.html

 

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.

Edited by Val Gorbunov

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.

Edited by Dirk Gregorius

Share this post


Link to post
Share on other sites

This topic is 795 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this