Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  How to stack different colors but keep their volumes
#1
Hello,

Forgive my English. I am using Obi Fluid for a game. However, I am stuck at 2 questions that I thought would be easy.

Q1
I am pouring two colors in a container one by one. Then I found when I stack the second color on the first one, the volume of the first one will be smaller. It seems the gaps in the particles are compressed. Could I just keep the volume of the first color? BTW, the liquid in our game should be very thick.

Q2
The borderline of the two colors is not very smooth(We want the borderline more clear, not diffused). We tried to make the particles smaller, it got better a little bit. But the FPS will be very low. Am I missing something obvious?

Many thanks,
Meng
Reply
#2
(30-04-2020, 09:26 AM)wm4583816 Wrote: Hello,

Forgive my English. I am using Obi Fluid for a game. However, I am stuck at 2 questions that I thought would be easy.

Q1
I am pouring two colors in a container one by one. Then I found when I stack the second color on the first one, the volume of the first one will be smaller. It seems the gaps in the particles are compressed. Could I just keep the volume of the first color? BTW, the liquid in our game should be very thick.

Q2
The borderline of the two colors is not very smooth(We want the borderline more clear, not diffused). We tried to make the particles smaller, it got better a little bit. But the FPS will be very low. Am I missing something obvious?

Many thanks,
Meng

Q1 -Fluid compressibility depends on what your simulation budget is. If you spend few iterations and have a large-ish timestep, fluid will be more compressible. In other engines, it would outright explode or become inestable. Obi degrades much more gracefully though, as it is unconditionally stable.

Try increasing the amount of density constraint iterations, and/or the amount of substeps. To see how iterations/substeps affect the simulation, see:
http://obi.virtualmethodstudio.com/tutor...gence.html

A trick that many games use to avoid having to crank up simulation quality, is to simply reduce gravity a bit. This reduces the fluid pressure, and allows density constraints to be more effective.

Q2 - More particles->less performance. If you want a clearer interface between the two fluids, you can try reducing "smoothing" in the fluid renderer.
Reply
#3
(30-04-2020, 09:38 AM)josemendez Wrote: Q1 -Fluid compressibility depends on what your simulation budget is. If you spend few iterations and have a large-ish timestep, fluid will be more compressible. In other engines, it would outright explode or become inestable. Obi degrades much more gracefully though, as it is unconditionally stable.

Try increasing the amount of density constraint iterations, and/or the amount of substeps. To see how iterations/substeps affect the simulation, see:
http://obi.virtualmethodstudio.com/tutor...gence.html

A trick that many games use to avoid having to crank up simulation quality, is to simply reduce gravity a bit. This reduces the fluid pressure, and allows density constraints to be more effective.

Q2 - More particles->less performance. If you want a clearer interface between the two fluids, you can try reducing "smoothing" in the fluid renderer.

Thanks for your reply. The Q1 is mostly solved. But the Q2 still exists. I upload a pic that shows the interface between the two fluids. There is a serious graininess at the interface.


Attached Files Thumbnail(s)
   
Reply
#4
(07-05-2020, 07:45 AM)wm4583816 Wrote: Thanks for your reply. The Q1 is mostly solved. But the Q2 still exists. I upload a pic that shows the interface between the two fluids. There is a serious graininess at the interface.

This is a particle-based simulator, and at the interface between two fluids the particle-based structure will be apparent. The only way to reduce this is using higher fluid resolutions (not recommended, very taxing on performance), or using a custom fluid renderer that performs more aggressive smoothing at fluid interfaces.
Reply