Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fluid Control Issues
#1
Hi, I'm working on a project using Obi Fluid in Unity (URP), and I'm running into some frustrating issues that I haven’t been able to solve despite a lot of trial and error. The main problem is that fluid keeps pouring out of containers even when their openings are visibly blocked by colliders both Obi Colliders and standard Unity Colliders. I’ve tried adjusting collision layers, surface thickness, and resolution settings but it doesn’t seem to help i am trying to achieve the same exact result as in the reference video. On top of that, I need to have multiple fluids how fluids interact or mix with each other if possible, right now one liquid keeps on pouring over the other. Also, my fluid materials and colors have suddenly stopped working everything is just rendering as a grey blob now, even though I’m using URP and the correct shader. This is preventing me from making progress on a critical part of the project. I’ve looked through the basic documentation, but I’m wondering if there are any more in depth tutorials or resources that focus on accurate fluid control, especially for situations like blocking pours and keeping fluids isolated. Any help would be massively appreciated. Thanks.
Reply
#2
(Yesterday, 01:55 AM)Reflower Wrote: Hi, I'm working on a project using Obi Fluid in Unity (URP), and I'm running into some frustrating issues that I haven’t been able to solve despite a lot of trial and error. The main problem is that fluid keeps pouring out of containers even when their openings are visibly blocked by colliders both Obi Colliders and standard Unity Colliders.

Hi!

ObiColliders are added to Unity Colliders in order to make them "visible" to Obi. You need to have both components on the collider object for them to work.

My first guess would be to make sure that the amount of substeps you're using is high enough for the simulation to converge - otherwise some constraints will be skipped, including collisions. Also make sure that the solver's collision margin is high enough for particles to interact with the collider, and that the max depenetration velocity (expressed in m/s) is high enough to counteract pressure-induced velocity at the collider's surface.

(Yesterday, 01:55 AM)Reflower Wrote: On top of that, I need to have multiple fluids how fluids interact or mix with each other if possible, right now one liquid keeps on pouring over the other.

Fluids interact - that is, collide- with each other by default, as long as they're managed by the same solver. Fluids managed by different solvers will completely ignore each other, since each solver carries out their own separate simulation. There's many examples of this included with the asset, I'd suggest taking a look at some of the sample scenes - FluidMixing, MultiphaseBuoyancy, just to name a few.

Mixing however requires specific setups, depending on what you mean by "mix":

- Low  polarity fluids or similar density will mix with each other, in the sense that there will be no surface tension at their interface to prevent the formation of a heterogeneous mixture.
- Fluids of different density will separate, with the lower-density fluid floating above the denser ones. So only fluids of similar density will "mix".
- Fluid of different polarities will keep their particles clumped together due to surface tension, avoiding mixing with or sticking to particles belonging to fluids with smaller/larger polarities. The larger the polarity difference, the stronger the surface tension force at their interface.
- If you want nearby fluid particles to exchange properties such as color or viscosity, this is a process called diffusion.

(Yesterday, 01:55 AM)Reflower Wrote: Also, my fluid materials and colors have suddenly stopped working everything is just rendering as a grey blob now, even though I’m using URP and the correct shader.

Make sure the URP renderer asset you've set up for fluid rendering is the one actually in use by your URP pipeline. Otherwise fluid will be gray, as URP will ignore your renderer feature required to render transparent fluids. Note that global project Quality settings may switch your pipeline to a different renderer depending on the quality level being used, and this may cause fluid rendering to stop. You need to set fluid rendering up for all renderers you're going to use.

(Yesterday, 01:55 AM)Reflower Wrote: I’ve looked through the basic documentation, but I’m wondering if there are any more in depth tutorials or resources that focus on accurate fluid control, especially for situations like blocking pours and keeping fluids isolated. Any help would be massively appreciated. Thanks.

Which settings to adjust is very situation/scene dependant, even though there's acceptable values for common use cases so there's no silver bullet for all cases. Obi is a rather large and complex system that requires considerable familiarity with fluid mechanics, physics simulation and rendering concepts to be used effectively: understanding things like fixed timestepping, sub-stepping, distance fields and their relationship to colliders, vector spaces (world/local), iterative physics solving, voxelization, the relationship between pressure, density, polarity, miscibility, etc is a prerequisite since these are very common in all existing fluid simulation and rendering systems.

let me know if you need specific help with any of these and I'll do my best explaining them.

kind regards
Reply