Obi Official Forum
Help Filling a bottle on start - 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: Help Filling a bottle on start (/thread-690.html)



Filling a bottle on start - DJacquemin - 17-09-2018

Hi everybody,

I'm trying to fill a bottle with liquid at the start of the application.

This is the list of problem I encounter :
  • Filling at startup : I suppose I should use the "burst" emission method but it only spawns a little amount of particles. I tried to set the speed to a higher number but it didn't change anything. I probably missed something.
  • Leaks : after a certain height, the particles start leaking from a side of the bottle (always the same) and from the bottom.
    I tried to add another object with a collider (and obi collider) to the leaking side but if it's too far, it leaks between the bottle and the object, if it's too close to the side of the bottle, the particles leak through the object.
    I also tried to increase the thickness of the Obi collider but it still leaks.
    Changing the emitter material (From blood to foamy water) improve the situation but it stillĀ leaks after a moment.
    I also noticed that the leak "pattern" changes when the starting position changes.
I attached screenshot with my bottle configuration.
The emitter is a child of the bottle.

Am I doing something wrong ?
Can I "pre-fill" the bottle ?

Thanks for your answer.


RE: Filling a bottle on start - josemendez - 18-09-2018

(17-09-2018, 11:02 AM)DJacquemin Wrote: Hi everybody,

I'm trying to fill a bottle with liquid at the start of the application.

This is the list of problem I encounter :
  • Filling at startup : I suppose I should use the "burst" emission method but it only spawns a little amount of particles. I tried to set the speed to a higher number but it didn't change anything. I probably missed something.
  • Leaks : after a certain height, the particles start leaking from a side of the bottle (always the same) and from the bottom.
    I tried to add another object with a collider (and obi collider) to the leaking side but if it's too far, it leaks between the bottle and the object, if it's too close to the side of the bottle, the particles leak through the object.
    I also tried to increase the thickness of the Obi collider but it still leaks.
    Changing the emitter material (From blood to foamy water) improve the situation but it stillĀ leaks after a moment.
    I also noticed that the leak "pattern" changes when the starting position changes.
I attached screenshot with my bottle configuration.
The emitter is a child of the bottle.

Am I doing something wrong ?
Can I "pre-fill" the bottle ?

Thanks for your answer.

Hi there,

Regarding collision detection, you're suffering from tunneling. This is a very common problem in realtime physics. If your bottle is completely static and does not move, you might be able to prevent it by increasing the amount of solver substeps. Note that this will impact performance.

The alternative is to avoid using MeshColliders at all, as they're paper-thin boundaries. Use thicker primitive colliders, or distance fields:
http://obi.virtualmethodstudio.com/tutorials/distancefields.html

To prefill the bottle at the start, use burst mode but give the emitter a large enough particle pool by increasing "num particles". Changing the emission speed will not affect the amount of particles emitted.

Note that if you cannot approximate the shape of the bottle with just one emitter shape, you can attach more than one emitter shape to the same emitter.