Techniques for detaching particles from fluid force - Printable Version +- tyFlow Forum (https://forum.tyflow.com) +-- Forum: tyFlow Discussion (https://forum.tyflow.com/forum-1.html) +--- Forum: General Discussion (https://forum.tyflow.com/forum-2.html) +--- Thread: Techniques for detaching particles from fluid force (/thread-610.html) |
Techniques for detaching particles from fluid force - neildbox - 05-10-2019 I was doing a little r&d into an effect I plan to create and hit a few snags. I would like a large cloth surface to be affected by a phoenix explosion, but the issue is that once those forces are acting upon the cloth they take priority over any others and nothing can ever fall back down. Anything outside of the phoenix grid behaves completely differently, i guess because the grid itself has air pressure / static forces. Here's what I made while playing around, but it's intentionally avoiding the issues I found and is super simple - https://www.instagram.com/p/BxDg_7UlIMY/ I could not find a way for the cloth particles to ever fall back down - they were perpetually carried by the forces within the phoenix grid. I know I can do a volume test where any particles that move outside of it go into a second event, but that doesnt help with the ones still attached to the main cloth body. I'd like the ones flapping around still attached to be able to fall down and rest. For that instagram test the smoke keeps going, but even if it stops emitting smoke, nothing falls as the 'air' in the phoenix group isnt affected by gravity - it just hangs there, or keeps drifting influenced by the very slight phoenix grid forces. I thought that 'add' in the fluid force should be able to do this as it would be adding the forces in addition to existing ones, but that still doesnt help it settle and it gives kind of a crazy result. Is it possible to set up a threshold test so that only fluid forces over a certain velocity will affect the tyflow particles? I can only see ways to threshold test the particles after the forces are already acting, however doing it before I'm pretty sure this would solve it. It would also stop the pulsing and variations that you get at the borders of a grid that doesnt cover the entire cloth. Anyone been working with the same operators and found some things that could help? Thanks in advance for any pointers! Looking at the tyflow instagram example and other people that have done things like this, every one is in a low/no gravity situation and has the entire phoenix grid around the cloth object, seems like it's as yet unsolved? RE: Techniques for detaching particles from fluid force - tyFlow - 05-10-2019 This is a trickier problem than intuition might suggest. Fluid force is nothing fancy, all it does it read velocities from each cell of your fluid grid. Each cell velocity has a direction and a magnitude. Those values are used to push particles around that are inside each respective cell. When set to 'Add' mode, the integration method is no different from the way a normal wind, gravity or noise force pushes particles. However, by default "Blend" mode blends between existing velocities on particles and grid velocities, using linear interpolation...and when affect is at 100%, that means each time step the particle velocities are getting completely replaced with grid velocities. This is where a Fluid Force operator and a typical force operator diverge (wind/gravity/etc are all purely additive). What you'll probably want to use is "Add" mode, which adds grid velocities to existing particle velocities, the same way any other force works (gravity/wind/etc). The problem, however, is that you're not going to want the grid to continually accelerate your particles, as fluid grids have accelerations already baked into their values over time...so you'll essentially be doubling up on your accelerations which will cause particles to move too fast. You'll have to add some damping (in the form of a Slow operator above the Fluid Force) and balance the Fluid Force influence %, along with your gravity strength. Alternatively, you could just do a velocity or age test or something on particles and send them to an event with just a gravity force (maybe a fluid force as well, set to 'add' with just a little bit of influence so you don't lose all vorticities) after a while. You can't really have them only affect particles beyond a certain threshold, because then you'll get strange/unnatural motion, where particles aren't affected by the grid at all and then suddenly when they reach a cell that crosses the threshold, they're immediately pushed by the full force of that cell. I guess a compromise in that regard would be to add a threshold value, and also use that as a water level for all grid velocities, so you'd essentially be cropping all velocities by that value (the threshold would be subtracted from the magnitude of all grid forces, thereby scaling the strength of all grid forces down)...but I don't think that would really solve the original problem you're facing, instead it would just add dead spaces to the grid which themselves could result in strange, unnatural motion. The best solution would be to simply setup your fluid sim with the gravity force you want. So you'd inject your fluid into it (liquid, smoke, whatever) and then let gravity do its thing within that sim. Then, once you're ready to use it to advect particles, all the proper forces are already baked in. RE: Techniques for detaching particles from fluid force - neildbox - 05-11-2019 Really appreciate the detailed response! That's a huge help. Thank you. I'll do some more work on it this coming week and post the results. |