Can Obi simulate a solid/liquid system and emulate discrete objects - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Fluid (https://obi.virtualmethodstudio.com/forum/forum-3.html) +--- Thread: Can Obi simulate a solid/liquid system and emulate discrete objects (/thread-2818.html) |
Can Obi simulate a solid/liquid system and emulate discrete objects - krooq - 21-03-2021 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) RE: Can Obi simulate a solid/liquid system and emulate discrete objects - josemendez - 22-03-2021 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/tutorials/emitters.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/thread-2631.html Quote:It seems like Obi can do the melting part easily, I'm just not sure about the re-solidification part. 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! RE: Can Obi simulate a solid/liquid system and emulate discrete objects - krooq - 22-03-2021 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 triplanar material 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!! RE: Can Obi simulate a solid/liquid system and emulate discrete objects - josemendez - 23-03-2021 (22-03-2021, 09:51 PM)krooq Wrote: Perhaps I can generate a mesh with a triplanar material 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. Yes, Obi exposes particle positions (actually, all particle properties). See: http://obi.virtualmethodstudio.com/tutorials/scriptingparticles.html |