FluidVolume surface triangles. Are they always coplanar?

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Spankenstein
Posts: 249
Joined: Wed Nov 17, 2010 1:49 pm

FluidVolume surface triangles. Are they always coplanar?

Post by Spankenstein »

When using a FluidVolume to represent some fluid in a container there seems to be no change to the SurfaceTriangle vertices when objects are thrown in the water.

Is this something that you have considered adding to BEPU at some point?

No response occurs if I were to grab an object containing a FluidVolume and shake it but I guess that this would require simulating fluid mechanics?
Fe_Yoshi
Posts: 397
Joined: Tue Jul 04, 2006 5:05 pm
Location: New Tower!

Re: FluidVolume surface triangles. Are they always coplanar

Post by Fe_Yoshi »

Try shaking it more.
It's simple, just take the hydraulic phase ship emulator and attach it to the photon particle emitter, BAM, new tower!
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: FluidVolume surface triangles. Are they always coplanar

Post by Norbo »

When using a FluidVolume to represent some fluid in a container there seems to be no change to the SurfaceTriangle vertices when objects are thrown in the water.

Is this something that you have considered adding to BEPU at some point?
Yes, but it's not very high priority. The fluid volume was just designed for relatively efficient buoyancy effects. Fortunately, adding a dynamic surface is not very difficult either. When the fluid volume was mostly rewritten for v0.15.0, the buoyancy calculations were redesigned to factor in water columns. The remaining work would be to compute volume transfer around a 2d grid. A mesh could be built from the grid to simulate the waves. It would be slower than the regular old FluidVolume, but you could still have fairly big simulations on the CPU on a game's budget.
No response occurs if I were to grab an object containing a FluidVolume and shake it but I guess that this would require simulating fluid mechanics?
That would indeed require a much heavier simulation like SPH. While I've fiddled with interactive CPU particles and some related fluid simulation, it's hard to justify their existence when the GPU does it so much better. A CPU-side SPH simulation might simulate a reasonably large puddle (around 10,000-30,000 particles, give or take) on a modern computer given the whole frame time of a game. In the same time, a modern GPU could simulate more like a million particles.

I am not sure when or if I'll get around to actually releasing such a feature; I try to balance features with how useful they end up being. Game-usable fracture simulation and other things are more valuable at this point.
Spankenstein
Posts: 249
Joined: Wed Nov 17, 2010 1:49 pm

Re: FluidVolume surface triangles. Are they always coplanar

Post by Spankenstein »

I am not sure when or if I'll get around to actually releasing such a feature; I try to balance features with how useful they end up being. Game-usable fracture simulation and other things are more valuable at this point.
That's cool. I'll focus my attention elsewhere when using the engine. :)
Post Reply