Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Foam generation decreasing over time
#2
(16-12-2021, 07:55 PM)Nitroxin Wrote: I just recently purchased obi fluid and I am loving it so far. My main use of it is in 2D at the moment and I've been playing with the foam generation which works great!

The only issue I am running into is that after the fluid particles die and new ones are emitted, the foam seems to almost not show up at all any more (almost completely stops being generated for the new particles). Looking at the particle emitter I am using for the foam while the simulation plays, I noticed that the number of foam particles increases very high (to some number around 5000) and stays there until fluid particles begin to die, where it then drops to around 30 and never goes past 300 or 200 again. I have attached an image of the first emission and one of the second emission for comparison (The second image is the initial emission, and the first one is the second emission).

I am not sure if there is any way to fix this at the moment or if it's just how the foam generation works. I did look at the sample scene for the foam and the same problem persists there as well. I would love to be able to have foam in the simulation for fluids like water all the time as it looks amazing!

Hi,

Foam is generated in regions of low density and high vorticity. When the fluid first splashes on the floor, it's still low density (as there's not much fluid around yet) and has high vorticity because of the initial impact with the floor. Once all or most fluid is out and starts re-emitting while there's still fluid on the scene, density will remain pretty high and vorticity low.

You can control the density and vorticity thresholds in the foam emitter, this will allow you to fine tune where foam appears. Note the foam emitter is just a sample/helper script, you can write your own methods of foam emission. The only part that's built-in into Obi is advection (fluid carrying regular Unity particles) but how, when and where to create these particles is  up to you. See: http://obi.virtualmethodstudio.com/manua...ction.html

Let me know if I can be of further help. cheers!
Reply


Messages In This Thread
RE: Foam generation decreasing over time - by josemendez - 17-12-2021, 08:33 AM