Posts: 71
Threads: 18
Joined: Jan 2022
Reputation:
0
I'm trying to make fluid behave as much like a thick, stiff paste as possible. I though I could achieve that using collision material settings, but it looks like the friction in stickiness parameters only have a very limited effect on the fluid.
Raising static and dynamic friction to 1 and using maximum combination does slow the fluid down somewhat, but not nearly as much as I would need. It still flows pretty fast, like tomato soup at best maybe. I would much rather have something that behaves like mashed potatoes or soft butter.
Stickiness doesn't seem to do much of anything other than making the particles spastically dance around, they still flow off any angled surface immediately.
Here are the fluid and collision material settings I used: https://imgur.com/a/dGc779u
The container material is on the jar, and the tool material is on the spatula and the stirring rod. Solver, Emitter and everything else is using the default values from the faucet sample scene.
Posts: 6,321
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
25-03-2022, 12:09 PM
(This post was last modified: 25-03-2022, 12:25 PM by josemendez.)
(25-03-2022, 11:34 AM)locque Wrote: I'm trying to make fluid behave as much like a thick, stiff paste as possible. I though I could achieve that using collision material settings, but it looks like the friction in stickiness parameters only have a very limited effect on the fluid.
As the name implies, collision materials only affect collision behavior. They have zero influence on internal fluid dynamics, just like Unity's physic materials have zero effect on internal rigidbody dynamics (you can't make a rigidbody rotate slowly by adjusting its physics material, for instance. You'd have to set its angular damping instead.)
What you want to do is increase the fluid's viscosity.
You can get thick, viscous fluid that slips off surfaces by using high viscosity and low stickiness/friction.
Or, you can get thin, runny fluid that sticks to surfaces easily. Stickiness, friction and viscosity are completely independent from each other.
Note that very high viscosity values will cause fluid to be unstable (jitter, exploding/flying particles). This is because large viscosity values require stepping the simulation in very small increments (in other words, a very small timestep) to maintain stability.
Note this is not some arbitrary Obi limitation/bug. Viscosity is extremely costly to simulate, high viscosity values (clay-like) cannot be simulated in realtime. Just for comparison, simulating just a few seconds worth of toothpaste-like behavior takes >10 hours on a state of the art simulator like RealFlow:
https://www.youtube.com/watch?v=oa43MoGSrRI
Posts: 71
Threads: 18
Joined: Jan 2022
Reputation:
0
25-03-2022, 12:25 PM
(This post was last modified: 25-03-2022, 12:28 PM by locque.)
Thanks for explaining, I guess viscous fluids are just not happening then.
What about the stickiness / friction issue though? Shouldn't the particles still stick to my stirring rod which has friction and stickiness set to 1? I'd expect them to come to a dead stop, just like the example with the ball and cloth on the manual:
The fluid just runs straight off though as you can see in the video, not a single particle sticks or shows any signs of friction. All it does is make the fluid vibrate as soon as it comes in contact.
Is there something that can be done about this jittering when using stickiness? Even lower values like 0.2 cause it. Is this the same problem that forces you to lower the simulation timestep for high viscosities or something else?
Posts: 6,321
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
(25-03-2022, 12:25 PM)locque Wrote: The fluid just runs straight off though as you can see in the video, not a single particle sticks or shows any signs of friction.
Is the knife a kinematic rigidbody once you pick it up?
Friction and stickiness are forces. For them to have any effect, the objects they're interacting with (in this case, the knife) need to honor forces properly. To understand this, try placing a cube on top of a floor in Unity and give them a physics material with full friction. Then, move the floor around: the cube on top will simply slide as if the floor was made of ice, because as far as the physics engine goes you're not actually "moving" the floor: you're teleporting it around. For friction to kick in you'd need to apply the floor a force/acceleration to increase its velocity, then the box would also increase its velocity as a result on frictional contact between them.
Another possible cause would be the mass of the knife vs the mass of the fluid, check that the mass of the particles (should appear in an info box in the fluid blueprint inspector) is smaller than that of the knife.
(25-03-2022, 12:25 PM)locque Wrote: And is there something that can be done about the jittering when using stickiness? Even lower values like 0.2 cause it. Is this the same problem that forces you to lower the simulation timestep for high viscosities or something else?
There should be no jittering when using stickiness... my guess is the mass ratio between the fluid and the knife is very large. See the included "Fluid Viscosity" sample scene for reference.
Posts: 71
Threads: 18
Joined: Jan 2022
Reputation:
0
Quote:Is the knife a kinematic rigidbody once you pick it up?
No, I'm using HurricaneVR. Everything is force-based, just like Boneworks. It's really cool because that actually allows you to kind of feel the resistance of fluids in obi since they apply force to your hand.
Quote:There should be no jittering when using stickiness... my guess is the mass ratio between the fluid and the knife is very large. See the included "Fluid Viscosity" sample scene for reference.
Okay, so drastically reducing the density of the fluid or increasing mass of the knife does make it start to stick a little bit. However this means either my fluid has to have a density of 10 or less which means I can't properly weigh it any more, or I have to increase the mass of my knife to at least 100 which means it's to heavy to pick up and even if I increase hand strength it would still cause havoc when colliding with any of the lighter objects.
This does not affect the jittering at all though, its exactly the same even when i change the mass ratio by a factor of 1000.
Posts: 6,321
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
25-03-2022, 01:17 PM
(This post was last modified: 25-03-2022, 01:18 PM by josemendez.)
(25-03-2022, 01:04 PM)locque Wrote: No, I'm using HurricaneVR. Everything is force-based, just like Boneworks. It's really cool because that actually allows you to kind of feel the resistance of fluids in obi since they apply force to your hand.
Oh ok! not sure how HurricaneVR works, never tried it. A question I get asked very often has to do with kinematic rigidbodies (or even colliders with no rigidbody at all) not applying or receiving forces from Obi actors, that's why I assumed this could be the case.
(25-03-2022, 01:04 PM)locque Wrote: Okay, so drastically reducing the density of the fluid or increasing mass of the knife does make it start to stick a little bit. However this means either my fluid has to have a density of 10 or less which means I can't properly weigh it any more, or I have to increase the mass of my knife to at least 100 which means it's to heavy to pick up and even if I increase hand strength it would still cause havoc when colliding with any of the lighter objects.
It should not be necessary to reduce the density that much, for instance the Viscosity scene has a fluid with density 1000 kg/m3 and a rigidbody that's 50 kg, and it works fairly well. As far as I can tell from the info you've given, this should work.
Will take a look at HurricaneVr to see if I can spot anything that could cause issues with this.
Posts: 71
Threads: 18
Joined: Jan 2022
Reputation:
0
25-03-2022, 01:22 PM
(This post was last modified: 25-03-2022, 01:29 PM by locque.)
Quote:It should not be necessary to reduce the density that much, for instance the Viscosity scene has a fluid with density 1000 kg/m3 and a rigidbody that's 50 kg, and it works fairly well. As far as I can tell from the info you've given, this should work.
Will take a look at HurricaneVr to see if I can spot anything that could cause issues with this.
Thanks, I can definitely recommend the asset on it's own but I don't want you to have to buy it and spend the time just to help me. I'm pretty sure it's something I configured wrong, could a high fluid resolution like 60 cause problems with stickiness?
Update: Can confirm this has nothing to do with HurricaneVR, the jittering also happens when the fluid contacts rigidbodies that aren't being held.
|