Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can Obi simulate a solid/liquid system and emulate discrete objects
#1
Hi,

I'm investigating Obi Fluid as a way to create a solid/liquid system in my game.  Think melting a metal ingot and then having it re-solidify, possibly into multiple different pieces.
The property diffusion example in this video is pretty close to the effect I'm after (at 0:50s).


It seems like Obi can do the melting part easily, I'm just not sure about the re-solidification part.
Do you have any ideas on how one can use Obi can do this?

More specifically, I'm wondering if this kind of "permanent" fluid type system is supported by Obi e.g. like still water in a cup with "no particle lifetime" or a way to make it seem like there is no particle lifetime? 
Most videos focus on streams of fluids rather than still bodies. 
I'm after an effect where the player can smelt some discrete units of ore (e.g. 10 sphere rigid bodies) and they turn into a blobby melted mass which can be aggregated into one object (1 mesh with 10 times the volume of a single ore unit) and vice versa.

How can Obi emulate discrete objects in this way, i.e. preserving a physical quantity?

(sorry for the word vomit)
Reply
#2
Quote:More specifically, I'm wondering if this kind of "permanent" fluid type system is supported by Obi e.g. like still water in a cup with "no particle lifetime" or a way to make it seem like there is no particle lifetime? 

Just use an infinite lifetime, particles will be permanent. This is a built-in Unity feature: you can type "Infinity" in any numerical input field, and you get the float.Infinity value for that attribute.


Quote:Most videos focus on streams of fluids rather than still bodies. 

Emitters have two modes: Stream, and Burst. The first one continuously emits particles trying to get a constant flow of fluid. The second one emits one "burst" of particles (one particle per distribution point in the emitter shape) and then just waits until these particles are destroyed. See: http://obi.virtualmethodstudio.com/tutor...tters.html

You can use the Burst mode in conjunction with a mesh emitter shape to get a shape made of fluid. If you set the lifetime to infinity, these particles won't ever go away. See this related thread: http://obi.virtualmethodstudio.com/forum...-2631.html

Quote:It seems like Obi can do the melting part easily, I'm just not sure about the re-solidification part.
Do you have any ideas on how one can use Obi can do this?

Not currently possible. As of today there isn't a realtime simulation method that can efficiently simulate the whole range of material behavior from solid->plastic/elastic->viscous->fluid. Obi Fluid stays in the viscous/fluid range, but can't simulate solids, so you can't transition from solid to liquid. ObiSoftbody can simulate solid->plastic/elastic, but not viscous or fluid. Mixing both (with quite a bit of custom scripting) you could get a fluid object with shape-matching (softbody) constraints in it that hold the particles in place, then selectively disable the constraints so that parts of the object become fully fluid. This is far from trivial to do though.

In practice, this is usually done by "swapping" between different objects/prefabs. You might have a solid representation of your object, then instantly swap for a fluid version (kinda like swapping character controllers for a ragdoll simulation when characters get killed). This of course limits the amount of things you can do: melting part of an object, for instance.

let me know if I can be of any help. cheers!
Reply
#3
Thanks for your quick response!

I appreciate the clarifications on the particle lifetimes and "static" volumes.
Seems like this is common question!

I like your idea for swapping out objects.
Perhaps I can generate a mesh with a triplanamaterial using a marching cubes implementation (or similar) using particle positions (I think I read that this is exposed by Obi) and just swap out the mesh for the fluid.
Or as you say, go with softbody as well and do something fully dynamic.

Cheers!!
Reply
#4
(22-03-2021, 09:51 PM)krooq Wrote: Perhaps I can generate a mesh with a triplanamaterial using a marching cubes implementation (or similar) using particle positions (I think I read that this is exposed by Obi) and just swap out the mesh for the fluid.
Or as you say, go with softbody as well and do something fully dynamic.

Cheers!!

Yes, Obi exposes particle positions (actually, all particle properties). See:
http://obi.virtualmethodstudio.com/tutor...icles.html
Reply