Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Fluvio - Fluid Dynamics for Unity

Discussion in 'Assets and Asset Store' started by lilymontoute, Jul 3, 2011.

  1. lilymontoute

    lilymontoute

    Joined:
    Feb 8, 2011
    Posts:
    1,181
    Hm, still not seeing what's going on here. I also have been unable to reproduce the issue on my end - Do you think you could reproduce this issue in a new project and reach out at assets-support.thinksquirrel.com? I'll take a look at it and see if I can find anything.
     
    Last edited: Apr 11, 2017
  2. VicToMeyeZR

    VicToMeyeZR

    Joined:
    Jun 3, 2012
    Posts:
    427
    How many "particles" can your system produce? Can it make a full body of water? In your demo/video is the water the fall is flowing to part of it, or standard water?
     
  3. lilymontoute

    lilymontoute

    Joined:
    Feb 8, 2011
    Posts:
    1,181
    The amount of particles varies based on your configuration (2D simulation has much higher particle counts than 3D) - for a modern desktop you can get about 800 particles in 2D or 300-400 before performance degrades. On mobile you'll want to decrease this by a factor of 8-10. If your particles are spread out in many areas, or you have a very high timestep, you can simulate even more (albeit with a lower quality level).

    In the demo video, the waterfall is made up of simulated particles (with extra "splash particles" that aren't simulated), with the main body of water being Unity's standard water. For best results, especially in 3D, you'll need to combine different techniques.
     
  4. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    390
    Is there a way to make the fluid simulation play while timescale = 0? Also I haven't had a chance to get you a demo scene of the bug I was seeing, I should be able to get to it next week.
     
  5. lilymontoute

    lilymontoute

    Joined:
    Feb 8, 2011
    Posts:
    1,181
    Unfortunately, I don't think this is possible with the current API - I'll look into adding a Simulate() method that you can manually call when the timescale is set to 0.

    EDIT: Verified that this is the case. I went ahead and added this to the roadmap as I don't see too many potential issues with doing this. You can follow progress on the issue here.
     
    Last edited: Nov 2, 2013
  6. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    390
    I'm unable to reproduce the issue with the ellipsoid emitter in a new project. I could send you the project but it would be large and I would need you to fill out an NDA.
     
  7. lilymontoute

    lilymontoute

    Joined:
    Feb 8, 2011
    Posts:
    1,181
    Ah, no guarantees on that, but feel free to send an NDA over with a general description of the project (to ensure no overlap with current things I'm working on) to support AT thinksquirrel [dot] com.

    As for the issue itself - does it happen in an empty scene within your project? It may be a good idea to narrow down the issue to something within your scene or something within your project.
     
  8. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    390
    I managed to extract my files from the project with the issue remaining so here's the link no NDA necessary.
     
  9. lilymontoute

    lilymontoute

    Joined:
    Feb 8, 2011
    Posts:
    1,181
    Thanks! What Unity version is the project in?
     
    Last edited: Nov 26, 2013
  10. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    390
    OH sorry forgot to mention I'm on the latest release candidate, though the new unity is out today so it should run in that.
     
  11. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    390
    Any luck with the demo? Was the error there for you as well?
     
  12. lilymontoute

    lilymontoute

    Joined:
    Feb 8, 2011
    Posts:
    1,181
    Hey wightwhale,

    I'll actually be checking this out in full first thing tomorrow - got swamped with a project so I'll be catching up on support-related tasks. Sorry for the delay!
     
  13. demir

    demir

    Joined:
    May 28, 2013
    Posts:
    8
    I found out that unless I am doing something extremely wrong fluvio is no good for collecting water (in 2D cases, can't imagine 3D). It doesn't work even if 20% of the screen is covered on our Intel Core i7 3.4 GHz with 4 GB ram machines at all (see the photo) which is not nearly enough to show any kind of production quality effect. Unless you want big balls flying around. (See the image).

    Unfortunately this was not possible to detect in the Free Edition because it is capped max 100 particles so it was a 50$ lesson. I would be more than happy to be put wrong but I just don't see a way.

    $Capture.PNG
     
  14. lilymontoute

    lilymontoute

    Joined:
    Feb 8, 2011
    Posts:
    1,181
    Hey demir,

    Have you taken a look at the Performance Considerations section of the documentation? One thing you'll want to take a look at is your current physics timestep, as well as particle solver iterations.

    As a reference point, you should be able to get 600-800 particles on a machine like that without performance drops.
     
  15. demir

    demir

    Joined:
    May 28, 2013
    Posts:
    8
    I just used Fluvio > Create Fluid and limited dimensions to XY.

    I did look at the performance considerations. Here are the current settings. The only help was perhaps reducing max time limit, which helped it stay at 30FPS, still with around 100 particles though on the latest Unity (4.3.0f4)

    $Capture1.PNG $Capture2.PNG $Capture3.PNG
     
  16. lilymontoute

    lilymontoute

    Joined:
    Feb 8, 2011
    Posts:
    1,181

    Are you testing this in the editor only or with actual standalone/web/device builds? There is a fairly significant overhead within the editor (which is why there is an option to halve the particle count in the editor itself). That said, I would still consider those performance levels an issue, there could have been a performance regression in newer Unity versions. Can you send me a PM or post with detailed specs (CPU, GPU, Operating System, etc)? I'll investigate this further.
     
  17. Johnoss

    Johnoss

    Joined:
    Nov 21, 2013
    Posts:
    1
    I suppose it's too expensive to use for mobile platform right (preberably Android)?
     
  18. demir

    demir

    Joined:
    May 28, 2013
    Posts:
    8
    It did get slightly better with standalone build, but not near the numbers.
    I sent a PM.
     
  19. lilymontoute

    lilymontoute

    Joined:
    Feb 8, 2011
    Posts:
    1,181
    Alright guys, some Fluvio updates.

    Took a look at this, was able to confirm - a fix will be in for the next version update. It only affects the ellipsoid emitter from what I see, but I'll double check the ellipsoid attractor as they use some common code.

    Actually, Fluvio can perform fine on Android, especially more recent devices - for mobile platforms you'll have to cut back from desktop by about a factor of 8-10. Fluvio includes some mobile-specific shaders that work well on those devices, and we do support it. More info on performance below as well.

    Thanks, got the info, I'll take a very close look at this.

    ---
    A more general note - I wanted to share some more info on what we're working on with Fluvio, mainly regarding performance.


    • Much better 2D performance for Unity 4.3+
      We have a new fluid solver that takes advantage of Unity 4.3's new 2D physics system - it does away with the particles-as-bodies approach and calculates collisions directly (reducing a lot of overhead). The goal is to have this ready by early next year. This will be in addition to our current physics solver (which will also receive a bit of work on it, more info below). The 2D solver will likely tie into Physics 2D Extensions, our new package that enhances Unity's 2D physics system.
    • Multithreading
      We've been slowly taking advantage of multiple cores, and hope to ship a new multithreaded solver based on our current physics solver, as well as ship the new 2D solver as a multithreaded solver. We're shooting for about a 50-80% minimum performance increase with this. This will arrive about the same time as the 2D solver.
    • Brand new, mesh based renderer
      This one is actually pretty much finished! I'll be adding a new marching-cubes based renderer to Fluvio soon - it's mainly intended for desktop, but is already heavily multithreaded and pretty fast. The fluid mesh renderer allows you to use any shader to render the look of a fluid, and is a true volumetric fluid representation. Expect more info on this one very soon.
    • (Finally) GPU accelerated fluids
      Getting rid of that "been-there-too-long" greyed checkbox, we plan on adding GPU accelerated fluids next year (targetting desktop platforms). A prototype has been built, I'm pretty pleased with the results, and this should be coming some time next year, after the other features above. GPU accelerated fluids will automatically fall back to the standard solver when acceleration is unavailable.
     
    Last edited: Nov 27, 2013
  20. hankjiye

    hankjiye

    Joined:
    Nov 27, 2013
    Posts:
    1
    Hello Thinksquirrel,
    I have a particle system, I want to improve the visual size based on it. I tried many times but failed. So I write this letter to consult which exact file or path I should change. I will very appreciate it if you can replay me.
    $11.jpg
     
  21. lilymontoute

    lilymontoute

    Joined:
    Feb 8, 2011
    Posts:
    1,181
    Hey hankjiye,

    It looks like you're using a very old version of Fluvio - you'll want to upgrade your project first to eliminate any issues there.

    To upgrade:

    1) Back up your project! There have been some changes that aren't necessarily backwards compatible
    2) Make sure no scenes are open in Unity (Untitled scene)
    3) Make sure you have no compile errors. You'll need to fix those before continuing.
    4) Delete the Plugins/Fluvio, Editor/Fluvio, Plugins/Thinksquirrel Common, Editor/Thinksquirrel Common, and Fluvio Example Project folders
    5) Remove any Fluvio-related images from the Gizmos folder
    6) Import the newest version of Fluvio from the Asset Store. Make sure to import all files
    7) Follow the instructions that appear

    Hope this helps!
     
  22. demir

    demir

    Joined:
    May 28, 2013
    Posts:
    8
    Is there a way to purchase this plug-in and drop it into an existing project reliably? It is impossible to find a right setting for the scale of the scene (plus evey scene is different in scale.)
     
  23. lilymontoute

    lilymontoute

    Joined:
    Feb 8, 2011
    Posts:
    1,181
    Hey demir,

    I'm looking at adding a global scale to the new solver to make it *much* easier to resize everything. It's probably one of the most requested things, and I agree that adjusting the scale while keeping everything stable is harder than it needs to be.

    As for now:

    When changing physical properties, I recommend adjusting only one property at a time in small amounts until you're able to get the desired effect. Many of them are linked - mass, density, and smoothing distance are very closely linked and if all 3 don't match up you'll end up with an unstable fluid.

    If you're still running into issues, let me know - if you are trying to get a desired size and can't get a stable fluid, I'd be happy to help.
     
  24. demir

    demir

    Joined:
    May 28, 2013
    Posts:
    8
    Thanks for the response. I have been unable to unfortunately come up with a flow to adjust scale for any of my scenes yet. I went by reducing smoothing distance slowly, and mass as well with that. I can get the fluid to be pretty stable still but individual particles still don't get any closer to each other.

    My screen width is about 1.7 units (in Unity).
     
  25. lilymontoute

    lilymontoute

    Joined:
    Feb 8, 2011
    Posts:
    1,181
    Took a crack at this and very pleased with the result.

    The next update will contain a global simulation scale - just a simple value you can change in the inspector to scale up and down the fluid simulation. Only the simulation (position, velocity, smoothing distance, max distance, broad phase size) is scaled with this parameter, so you can position emitters independently of your scaling.

    Simulation scale works by scaling everything that is sent or received with GetParticles/SetParticles, with the internal representation kept the same for consistency.

    I'll probably send this out in an update ASAP with a few other important bugfixes. A full changelog will be coming after I test/document everything.


    • Added a Simulation Scale property to both the inspector and API
    • Loading fluid profiles should work properly now
    • Added API access to individual rigidbody particles
    • Fixed GetParticle/SetParticle methods
    • Added the ability to pause/play simulation (Play() method, Pause() method, isPlaying property)
    • Added a Simulate(deltaTime) method to simulate fluids at a different speed, or if timeScale is zero
     
  26. Toad

    Toad

    Joined:
    Aug 14, 2010
    Posts:
    297
    Looking forward to the new features, they sound excellent!
     
  27. lilymontoute

    lilymontoute

    Joined:
    Feb 8, 2011
    Posts:
    1,181
    Thanks!

    To follow up on this - I also managed to track down the bug here and fix this issue. Also, all of the emitters should properly support adjusting the transform (position/rotation/scale) now. Also fixed some issues with the handles.
     
    Last edited: Dec 12, 2013
  28. lilymontoute

    lilymontoute

    Joined:
    Feb 8, 2011
    Posts:
    1,181
  29. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,277
    Can this now work with your 2d asset together?
     
  30. lilymontoute

    lilymontoute

    Joined:
    Feb 8, 2011
    Posts:
    1,181
    Not yet - but I've started the groundwork behind the scenes to make that possible. This release mostly included bugfixes plus two heavily requested things.
     
  31. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    The intended changes look great! I've had fluvio a long time and really havent found the right opportunity to use it, but you've pretty much hit the nail on the head for what I wanted fluivio for in the first place with your planned additions, which make this yet another asset store purchase that has become a very appreciated investment. Looking forwards a great deal to the results, and cheers for the hard work
     
  32. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Also, in a spontaneous exlosion of inspiration, i thought I might ask how well your 2d simulation is suited to generating flowmaps for water based assets working as larger bodies of water (wide rivers etc). I havent been following your product enough, despite owning it, do you think flowmap generation is a good idea (would certainly make for great rivers) have you already done it? And if its calculated on the gpu could that mean dynamic recreatipn of the the flowmap

    The things you are moving to add to fluvio have just really put it on the map with me, and stuff like mentioned above would make fluvio very useful indeed, on top of the rest of the very useful things you're adding, my current gpu based asset is great but seems more focussed in gasses atm, so fluvio and interactions with larger, less concerned with exact simulation bodies of water culd be all kinds of interesting

    Also amusing note, not sure you'll appreciate my sense of humour, but when i first got fluvio it was to make a silly game to amuse my mates inspred by the amusing idea of of destroying flora and fauna based on post-drinks needing a pee, and it seems it could be done convincingly soon, but i think im a bit busy for such things these days, fluvio will be used for much classier things. A cost effective solution to flowmaps for me at least would be grand. If thats already been done, im happy to bear the dunces hat
     
  33. lilymontoute

    lilymontoute

    Joined:
    Feb 8, 2011
    Posts:
    1,181
    I was actually thinking of this in a different way, where a fluid is controlled by a user supplied flowmap (which could be matched up with another larger body with a flowmap). Turning a fluid into a flowmap -could- work, but you wouldn't end up with good results really, and is a bit overkill as far as automatic flowmap generation goes.
     
  34. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I suggested it mainly because atm the two things I know that create flowmaps (i think the posh name is 2d vector displacement maps) are one in which you paint it yourself, and one that uses fluid simulation to calculate it, the latter costs money. I have no idea if the way you handled fluids would be analogous to such a task but I thought it was worth asking
     
  35. ptterb

    ptterb

    Joined:
    Dec 18, 2013
    Posts:
    2
    Hey Thinksquirrel, I'm looking to create a wind tunnel mock-simulation in unity and was wondering if Fluvio would be a good fit for the particle emissions. Is this something that it's capable of?
     
  36. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    390
    Thanks for the bug fix on the elipsoid emitter! Anyhow, my game has been fully converted to using the new unity 2D physics system. As the particles are falling through objects that aren't 3D I'm guessing this is not supported at this time. Am I correct to assume that's what you're talking about with the early next year update?
     
  37. lilymontoute

    lilymontoute

    Joined:
    Feb 8, 2011
    Posts:
    1,181
    Sorry for the slow responses guys, been travelling.

    Ah, I see what you mean with using fluid simulation to create flowmaps. This could be done, but Fluvio may not be the best simulation technique for it. It's still possible though, and I could look into it down the road, so I won't rule it out just yet. I'll do some experimentation here once I get the chance.

    Hm, this could possibly work in 2D for a mock-simulation. There are other simulation methods that would better capture things like prop wash, turbulence, and lift forces though. This would be pretty tricky to do in realtime for 3D simulation though, since you'll need a pretty high particle count.

    That is correct. Fluvio will be getting a standard 2D solver soon as a free update (similar to the current 3D solver, but both the 3D and 2D solvers will be multithreaded). A more advanced 2D solver for Fluvio will be included as a part of Physics 2D Extensions some time early next year.
     
  38. MPanknin

    MPanknin

    Joined:
    Nov 20, 2011
    Posts:
    361
    Hi there,

    we are currently looking for a plugin that can generate dynamic smoke and are therefore interested in buying fluvio. Are there any demos showing smoke built with fluvio?

    I didn't read the whole thread, so maybe this has been asked before.

    Thanks!
     
  39. lilymontoute

    lilymontoute

    Joined:
    Feb 8, 2011
    Posts:
    1,181
    Hey MPanknin,

    Smoke simulation can be done (and has been done before) with Fluvio. We used to have a smoke demo in 1.x, in fact.

    Smoke is simulated pretty much exactly like a liquid, but usually with an interactive force applied to simulate the lower density of smoke relative to air.

    I recommend trying out the free edition to see what kind of smoke effects you can make - I'd be happy to walk you through some of the steps as well.
     
  40. MPanknin

    MPanknin

    Joined:
    Nov 20, 2011
    Posts:
    361
    Hi and thanks for getting back to me.

    I'll definitely check out the free version but I'd like to ask one more thing in advance. Do Fluvio particles interact with lighting?

    http://assets.digitaltutors.com/dtv_/bison_courses/45/assets/45-render_1040.jpg

    We want to achieve something similar to the above but need the greenish gas/smoke to be fully dynamic. Is this something, Fluvio can be used for?
     
  41. Play_Edu

    Play_Edu

    Joined:
    Jun 10, 2012
    Posts:
    720
    Hi,
    This is awesome tool for making fluid types effects. I want to buy but i have some doubt so pleases mind telling me can possible with this tool .I want to make like this effects in 3d.

    https://www.youtube.com/watch?v=C5tOEBmBAHg

    Best wishes,
    play_edu
     
  42. lilymontoute

    lilymontoute

    Joined:
    Feb 8, 2011
    Posts:
    1,181
    Fluvio Standard and Pro include a bunch of shaders, many of which do react to lighting and cast shadows. All editions of Fluvio also allow you to make your own custom shaders.

    Sure! This could be done with a quick color change of a fluid's particle system (using Unity's API for particle systems).
     
  43. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    8,585
    Has something changed in Unity since 4.1.5f ?

    I upgraded to 4.3.4 and the collision does not happen when my collider has "trigger" enabled, did that change in Unity particle system in general ?

    I try to make Fluvio collide with a trigger collider, which was happening in Unity 4.1.5f and now does not seem to
     
  44. lilymontoute

    lilymontoute

    Joined:
    Feb 8, 2011
    Posts:
    1,181
    That must have changed with particle systems in general - we've never directly supported fluids colliding with triggers, but Shuriken collisions may have worked with them before.
     
  45. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    8,585
    Ok found it after searching all changelog

    After Unity 4.2 they removed collision with trigger

    "Shuriken: Fix collision module such that trigger objects do not cause particle collisions."
     
  46. estpaul45

    estpaul45

    Joined:
    Feb 21, 2014
    Posts:
    1
    Got this nasty error when exporting to Windows Phone 8, this happens with every project, which has Fluvio exported, including the example project. I am using the latest Unity version and just downloaded the free Fluvio Asset.
    Could you please look at this problem and perhaps find a solution.

    Error building Player: Exception: Failed to run reference rewriter with command "--target="Temp/StagingArea\Fluvio.Runtime.dll" --framework="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\WindowsPhone\v8.0,C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Libraries" --platform="C:\Program Files (x86)\Windows Phone Kits\8.0\Windows MetaData\Windows.winmd" --support="Temp/StagingArea/WinRTLegacy.dll" --winmdrefs="" --system=System --dbg=pdb --alt=System.Net;System.Net.Sockets,System.Net;System.Xml.Serialization;System.ComponentModel,System.Windows;System.Threading,mscorlib". [Temp/StagingArea\Fluvio.Runtime.dll]
    Error: method `!!1[] System.Array::ConvertAll<ThinksquirrelSoftware.Fluvio.Plugins.FluidPlugin,T>(!!0[],System.Converter`2<!!0,!!1>)` doesn't exist in target framework. It is referenced from Fluvio.Runtime.dll at System.Collections.Generic.IEnumerable`1<T> ThinksquirrelSoftware.Fluvio.Fluid::GetPlugins().
    Error: type `System.Runtime.Serialization.SerializationInfo` doesn't exist in target framework. It is referenced from Fluvio.Runtime.dll at System.Void ThinksquirrelSoftware.FluvioInternal.AssertException::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext).
    Error: type `System.Runtime.Serialization.SerializationInfo` doesn't exist in target framework. It is referenced from Fluvio.Runtime.dll at System.Void ThinksquirrelSoftware.FluvioInternal.AssertException::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext).
    Error: method `System.Void System.Exception::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)` doesn't exist in target framework. It is referenced from Fluvio.Runtime.dll at System.Void ThinksquirrelSoftware.FluvioInternal.AssertException::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext).
    Catastrophic failure while running rrw: System.NullReferenceException: Object reference not set to an instance of an object.
    at Unity.ReferenceRewriter.RewriteMethodSpecMemberRefs.Visit(MethodDefinition method)
    at Unity.ReferenceRewriter.MethodDefinitionDispatcher.Dispatch(TypeDefinition type)
     
    Last edited: Feb 21, 2014
  47. lilymontoute

    lilymontoute

    Joined:
    Feb 8, 2011
    Posts:
    1,181
    Hey estpaul45,

    The current version of Fluvio doesn't support Windows 8 platforms. We're working on it - expect the next update to fully support the platform.

    Thanks for the heads up though, we didn't catch this one yet. I've logged it as a TODO.
     
  48. HazeTI

    HazeTI

    Joined:
    Jan 12, 2012
    Posts:
    83
    Hi Thinksquirrel,

    I'm currently trialling Fluvio free edition before deciding if it is suitable to purchase a higher version. I am having issues which I'm hoping you could help answer. I'm attempting to have a 3d body of liquid in a container, which could then be manipulated.

    I have a container, which contains the liquid in place as expected and collision is working as intended (if it's not obvious this is a hollowed out ring):
    $Screen Shot 2014-03-03 at 22.04.39.png

    However, when I rotate the container back and forth, even just slightly then the particles very quickly go though the object. Are there some values I could play with to improve this?

    Also I'd like to ask, when settled it does look like the fluid particles remain separate, do you have a system for particles joining together to form a bigger body( of water for example)?

    Thanks!
     
    Last edited: Mar 3, 2014
  49. lilymontoute

    lilymontoute

    Joined:
    Feb 8, 2011
    Posts:
    1,181
    Hey Haze,

    I recommend reading this thread on our forums:
    https://thinksquirrel.com/forum/topic/parenting-emitters

    In short - we're working on it. There is a workaround in that thread that you could try, though.

    As for particles joining together, Pro and Standard have a screen-space metaball effect (for Unity Pro only) that can do this.
     
    Last edited: Mar 3, 2014
  50. HazeTI

    HazeTI

    Joined:
    Jan 12, 2012
    Posts:
    83
    Thanks for the reply!
    Just a FYI update:
    I noticed on that thread you linked to that I should really be using shuriken physics. So I switched to that, unfortunately the particles leaked through the object even when it wasn't moving. I did notice that when I switched from a mesh collider to a box collider the leaking stopped for a non moving object but still had the leaks when the object rotate, even slowly. I guess the shuriken physics just isn't good enough for mesh colliders? Does that sound right?

    I've not tried the parenting or using the Get/Set you mentioned in the thread, I'll try that next with some must simpler collision and let you know how I get on.
    Cheers
     
unityunity