Search Unity

Fluidity - NextGen Fluid Dynamics - [ RELEASED ]

Discussion in 'Assets and Asset Store' started by smb02dunnal, Oct 22, 2013.

  1. vicdelacroix

    vicdelacroix

    Joined:
    Apr 13, 2014
    Posts:
    6
    hi! Just wanted to drop by and thank you for working on this. It truly makes amazing effects!!

    Will definitely buy after a liquid fluid has been achieved (water, etc) since those are essential to my game. Is there an ETA on that?

    Also, could you give me an rough estimate of the performance cost? FPS for the demo scenes at least? Would it be feasible to build a game around fluids or is it too demanding and should only be used for decoration or specific effects?

    Sorry for all the questions. Thanks!! :D
     
  2. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Hi,
    I just bought your volumetric asset "Pyro tecknix", now I'm getting an error with fluidity.

    I get nine of these: (update: you have a fluidity demo in the package, reinstalled without and error did not return)
    "Assets/Fluidity/Scripts/Simulation/Simulation.cs(371,24): error CS0246: The type or namespace name `ProfilerMarker' could not be found. Are you missing a using directive or an assembly reference?"

    I cant find any support forum post for pyro Technix... I installed but am getting these errors...any help would be great!

    Assets/Pyro Technix/Scripts/Explosion System/ExplosionDebris.cs(28,48): error CS0103: The name `Helpers' does not exist in the current context

    Assets/Pyro Technix/Scripts/Explosion System/ExplosionDebris.cs(28,36): error CS1502: The best overloaded method match for `UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Vector3, UnityEngine.Quaternion)' has some invalid arguments

    Assets/Pyro Technix/Scripts/Explosion System/ExplosionDebris.cs(28,36): error CS1503: Argument `#1' cannot convert `object' expression to type `UnityEngine.Object'
     
    Last edited: Apr 26, 2014
  3. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Hmm... I'm struggling to repro this.

    It doesn't happen for me on any of my sample demos. Is anyone else experiencing this.

    I would recommend deleting the Fluidity folder and reinstalling it. Unity can be a bit of a pain sometimes with CGInclude files.
     
  4. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    No ETA sorry. I really want to do this. I just have a few things to take care of first. It's on my todo list though.

    All the demo scenes run at 60fps on my 560ti.

    It's possible. You would have to be quite selective with placement etc... That's a bit of a tough question to answer though.
     
  5. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    This is with both Fluidity and PyroTechnix installed right?
     
  6. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
  7. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Just purchased Fluidity. I truly believe this is some bleeding-edge stuff that represents the next generation of special effects in games.
    I have a question, however.
    Flames look really easy to make, but what I would really like to do is an explosion effect. I can't seem to find a way to get the flames to "explode outwards" initially. How should I approach this?
     
  8. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Reaction speed and the initial rate, especially using a bitmap for an emitter rather than a sphere can produce explosive initial emission, but all of the settings can affect the rate in some way, although i suppose vorticity influences how 'noisy' the effect is, not in the same way the 3D texture noise does
     
  9. Biggsism

    Biggsism

    Joined:
    Jul 8, 2013
    Posts:
    5
    Just bought this package earlier tonight, love the effects but some problems.

    I am having some frustrating issues using Oculus Rift. I thought it was "VolumetricRenderer.cs" component missing but I see here we don't need it anymore. Is there something else I need to attach to my two cameras to get this working right? The effects are working without Rift but many issues with.

    First issue, and all are probably related, is that the fluid effects get clipped off (perhaps culled?) way before leaving actual visibility as I move my head around. This is the worst and most obvious. Effects seem to "shrink" or pop in and out similar to broken occlusion culling.

    I also have portions of fluids that constantly go invisible as if the geometry in the scene is inverse/rotated from some post processing or rendering issue and occluding it (but it isn't actually visibly blocking my vision or even remotely near where it creates the alpha effect). This gets really bad in a full scene but happens for me in the provided demos as well while using Oculus Rift OVR camera setup.

    Example: Hands that are actually in front of player have an invisible phantom version, kinda upside down, moving around my upper vision and blocking the fluid effects as it crosses over and dances around my vision.

    So while trying to test these problems outside of my main project I opened Volume_Renderer_Demo scene, used sphere projectiles that, when I attached to the Oculus cameras, shoot to the left and right at an aggressive angle, leaving my vision if I don't move my head around to follow. This created an easier error to pin down.

    I see a visual problem in which, on the opposite side of each eye, moving inward as if mirrored to these meshes moving outwardes, an alpha effect. This is moving towards the fluid particle mass centered in my vision, exactly opposite and away from the "real" ball mesh, occluding portions of the effect in the sphere shape of the projectile (without any actual geometry there to occlude, it is going the opposite direction). It all seems related of course but I cannot figure out what is wrong.

    Any help from anyone would be appreciated. My intuition is something about using 2 cameras from OVR prefab is messing up everything, I can't figure it out to save my life and these effects are too interesting to give up on! I hope it is something simple I am not setting up correctly as the documentation seems dated. Thanks in advance!
     
    Last edited: May 7, 2014
  10. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    This is still one of the most impressive effects i've seen for Unity and a lot of the reason i first got very interested in GPU computing and became a bit of an evangelist (I'm piping up cause i'm this second reading about doing spherical harmonic calculations on a gpu (feeling pretty dumb atm but hey) and this thread popping up reminded me of why i was there in the first place!) so i definitely hope the OR things are fixed, they worked at some point and the dev spent a lot of time getting them working, the OR sdk, including the unity implementation may have updated and changed.

    In fact it seems quite likely it could have changed somewhat since crystal cove (can anyone verify this?) so maybe it's a consequence of that. I think i still have the same unity OR sdk as when i first got my OR last year on my external so i can try that out, i might have a go with my homegrown/'kit bashed' OR solution too which is not the official SDK and might offer different results so i'll check after i'm done reading this paper.

    The SSR dev (the Candela thing) is still informing people its easier for others to change their assets for it than they change theirs for compatibility which i didn't follow up on because i have no idea what to say to anyone because i don't know enough to be informed on the matter. I am sorry for being naggy bout it way back, assuming the AABB is enough to get it implemented into an SSR image effect i'll try to explain to them, although further details how this can be done would be much appreciated. I'm going to check with other volumetric effects i have because if it's volumetric effects in general that aren't compatible with it and get back, i'd just like to know what to say to who, rather than expect developers to buy each other's assets.

    Maybe i should encourage them to buy this, anyone who didn't grab it at the sale missed out on a steal
     
  11. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Hm, bitmap emitter? Docs are a tad sparse, what does a bitmap emitter do? Is there a way to define initial velocity in a 3D bitmap or something?
     
  12. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    If you go to your main volume object you'll see its simulations listed, edit a simulation and at the bottom it will allow you to use a greyscale image to emit the fluid instead of a sphere, i've found emission to be much higher using one of these than the sphere emission. You can set the emission rate here too
     
  13. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Hm... I still seem to only be able to get it going mostly upwards. I mean, there's a tiny bit of burst, but not "hollywood explosion zomg it's coming at me". While I know that's not realistic, it would still be nice to have some method of getting the flames to burst outwards in every direction like an explosion (pressure causing the gases and flames to rapidly expand outwards, I think?)
     
  14. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Ahh you mean like a spherical explosion, rather than 'top hemisphere' type. Hmm, i'm not really sure it's been designed for that but could be proven wrong, you've seen the flamethrower right?
     
  15. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Wonder if I couldn't achieve the desired effect with a couple of spherical temp emitters where I rapidly scale up the radius and then disable emission...
     
  16. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,349
    Got the pack, i dont have Pro yet, but soon :), the offer was too good to pass by

    BTW, are there any considerations for Unity 5 ? Will the pack be made to work on Unity 5 ?
     
  17. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Why would he know if it works with Unity 5? It's not even released yet.
     
  18. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,349
    I am not asking if it works with Unity 5, rather if it is planned to support Unity 5, even if there are radical changes from Unity 4 and the system would need a big update or rework
     
  19. Biggsism

    Biggsism

    Joined:
    Jul 8, 2013
    Posts:
    5
    Pleading for any info or help on these issues. Here is an image displaying the issue in Oculus Tuscany scene. Thanks guys.

     
  20. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Actually, I just found a free raymarched pyroclastic explosion system on the asset store.
    So it seems to me I could combine the two - I've gotten the pyroclastic sphere to look very convincing (by combining a couple of spheres together and animating the scale+brightness), and then I could just throw in the fire afterwards as the object is engulfed in flames after explosion... plus for several other effects. Would make a VERY convincing smoke grenade effect I think :)

    EDIT: Hm, having some trouble getting the smoke working. I've got a flame volume, and now I'd like a secondary smoke effect, but the minute I add other color channels to the volume the whole thing turns white.
    I also tried a whole separate simulation with another volume, but the second volume also turns white.
     
    Last edited: May 9, 2014
  21. yezzer

    yezzer

    Joined:
    Oct 30, 2009
    Posts:
    143

    I too am having the same problem, it's totally unusable with Oculus! Since the description says it supports Oculus Rift, I think this should get some serious attention. This is the reason I purchased it!

    Any ideas?

    $Capture.PNG
     
  22. yezzer

    yezzer

    Joined:
    Oct 30, 2009
    Posts:
    143
    Ah, sorry, I'm an idiot. Needed to select Deferred Lighting on the OVR cameras. *facepalm*.
    Now appears to work correctly on Oculus!
     
  23. Biggsism

    Biggsism

    Joined:
    Jul 8, 2013
    Posts:
    5
    Makes both of us, for future reference- I had to manually change "Use Player Settings" to Deferred on each camera rather than just player settings only. Finally get to play with fluidity!

    Thanks Yezzer!!!
     
  24. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Hey guys! I know it's been a while. I've been really busy with other things. I know it's not a good excuse, but sometimes these things happen :(

    I'm really glad to hear that you all seem to of fixed your oculus problems. It sounds and looks as though the depth buffer is flipped in forward rendering?? FFS I'm really sorry about this. Can anyone confirm? Also, if you could let me know your Unity version number that would be great!

    As for Unity 5. It will all depend on whether or not I decide to make a license purchase. If or when that happens, Fluidity will be the first of my packages to make it onto the new version.

    As for explosions, yes it would be great to have them in Fluidity. But because of the constraints on the size of grid and volume, it's my strong recomendation that you seek an alternate method. Check out my PyroTechnix package on the store (only $10) it features alot of the rendering technology (including some advances I haven't had a chance to merge back into Fluidity yet) from Fluidity to achieve truly volumetric explosions. And comes with a bunch of tools to enable explosions affecting more than just the graphics.
     
  25. silentslack

    silentslack

    Joined:
    Apr 5, 2013
    Posts:
    393
    Hi, I'm attempting to create a flamethrower that is dynamic in the scene. As the player waves it around I would like to see the fluid react to the movement. I looked at your example scene and it looked like the floating fire ball behaves as I would like but I see it has a baked animation + controller on it. Can I achieve a similar effect with a dynamic object (flamethrower rotation set dynamically per frame). I think I could achieve the effect with a very large fluid container but the performance hit is too great.

    Thanks!
     
  26. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Have you had a look at the angry bots flamethrower demo? I posted a tutorial video on how to achieve this effect, it's called translating grids, I even included a flamethrower script with Fluidity to show you how to set this all up.

    Here's the video again, incase you missed it:
     
  27. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Out of interest has anyone made anything cool with this I could showcase?
     
  28. johnnydj

    johnnydj

    Joined:
    Apr 20, 2012
    Posts:
    211
    someone was mentioning also about water demo.
    you said somewhere on page 2 that you will make a demo with water.
    have you ever done that? I would be interested to see it :)
     
  29. theLittleSettler

    theLittleSettler

    Joined:
    Jul 14, 2012
    Posts:
    36
    ^+1

    I too am very interested in a water - particularly fast moving water (rapids, flash flooding). I believe fluidity would be able to handle static obstacles (eg, waves against a levy), which is something the innumerable other water simulations can't do afaik.
     
    Play_Edu likes this.
  30. Play_Edu

    Play_Edu

    Joined:
    Jun 10, 2012
    Posts:
    722
    +1
     
  31. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    +2
     
  32. johnnydj

    johnnydj

    Joined:
    Apr 20, 2012
    Posts:
    211
    I'm looking to make a game similar to this:


    so I need some info and demo's before I purchase a plugin.
    Don't want to spend any money on something that will not be able to get the job done.
     
  33. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    I've just updated my oculus Rift to DK2, using the new Oculus SDK 0.4
    It broke fluidity, they no longer render in exported games, but play in the editor.
    Any ideas?
    thanks!
     
  34. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    This isn't the plugin for you. You want SPH water sim for this.
     
  35. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Did you manage to figure this out? If it's a regression due to updating the Rift SDK, perhaps there is some setting you've missed when updating.
     
  36. Rico21745

    Rico21745

    Joined:
    Apr 25, 2012
    Posts:
    409
    I'm kind of curious if you can use Fluidity to simulate other things like fog, smoke, etc. I understand that it may not be 100% physicially accurate, but would it be possible to use it in other ways other than the showcase flame/fire effects?
     
  37. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Absolutely! e.g. You could set the reaction speed to 0 (or very close) and create a dynamic fog volume that reacts to players walking through it (using fluid affectors). Possibilities are endless :)
     
  38. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,349
    Really cool, would that affect performance a lot and should it be made locally and move along with the hero for better speeds ?
     
  39. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    It depends what effect you're trying to achieve. If you want to create a dynamic fog volume like this, I'd recommend creating a volume fixed in place.
     
  40. Z43D

    Z43D

    Joined:
    Jan 2, 2013
    Posts:
    100
    Hey smb02dunnal, I've sent you a message as well as an email and haven't heard anything so I'm posting here in hopes of a response. Any plans to update this to play nice with Unity 5? It's throwing quite a few errors at the moment.
     
    yezzer likes this.
  41. yezzer

    yezzer

    Joined:
    Oct 30, 2009
    Posts:
    143
    I would also like to know this..
     
  42. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Assuming the errors you are getting in Unity 5 beta are the same ones I get, I worked out how to get rid of them.

    Edit fluidity/scripts/demo scripts/camera/Cannon.cs
    Change the line near the top that says:
    namespace Fluidity.Renderer
    to be this instead:
    namespace Fluidity.RendererX
    Repeat the exact same thing for the other files in that folder called FlyCamera.cs and OrbitCamera.cs

    Edit fluidity/scripts/volumes/BaseVolume.cs
    Change the line near the top that says:
    using Fluidity.Renderer
    to be this instead:
    using Fluidity.RendererX
    Repeat the exact same thing for other files such as FluidVolume.cs, TextureVolume.cs, VolumeEditor.cs and any others that I've forgotten to mention that still give you console errors about Fluidity.Renderer

    Thats enough to get the thing running. But on my system there was still a problem with Self Shadowing not working, so:

    Open fluidity/resources/shaders/Fluidity.cginc
    Select the entire contents of that file and copy it to your clipboard.
    Open fluidity/compute shaders/Lighting.compute
    Find the line near the top that says #include "../Resources/Shaders/Fluidity.cginc"
    Replace that line with the entire contents of the file that you have copied to your clipboard.
    Save it and that shader should now compile ok.

    Some of these details are from my memory so apologies in advance if I've made any slight mistakes above, I am happy to attempt to sort any issues out or clarify anything while we wait to see if there will be an official fix.
     
    MornFall likes this.
  43. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    Yes I was just going to post the fix
     
  44. Z43D

    Z43D

    Joined:
    Jan 2, 2013
    Posts:
    100
    Hey, I was able to get the fluids rendering when implementing this fix but Fluidity definitely doesn't seem to like Enlighten at all and I'm seeing some very odd occlusion/clipping problems. You guys experience this as well?
     
  45. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Regarding the occlusion/clipping problems, assuming you mean that the clipping seems to be upside-down when using deferred rendering, I have just come across and fixed that.....

    Edit Fluidity/Scripts/Volumes/BaseVolume.cs

    Around line 814 you will see this:
    GetComponent<Renderer>().sharedMaterial.SetFloat("_IsDeferred", Camera.current.renderingPath != RenderingPath.DeferredLighting ? 0 : 1);

    Change it to this:
    GetComponent<Renderer>().sharedMaterial.SetFloat("_IsDeferred", Camera.current.actualRenderingPath != RenderingPath.DeferredShading ? 0 : 1);
     
  46. Z43D

    Z43D

    Joined:
    Jan 2, 2013
    Posts:
    100
    Awesome, appreciate the help :)
     
  47. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Well, as the author has gone awol and some very friendly folk have been looking at patching this up, has anyone had any success at fixing the one working but seemingly broken now vr compatibility, so it can reseat its throne as one of my favourite unity things
     
  48. MornFall

    MornFall

    Joined:
    Jan 11, 2013
    Posts:
    160
    Thank you Elbows. Just bought Fluidity, being naive that it would work out of the box for unity5.

    Edit : The deferred fix did not fix it for me (=
    now i have got an issue where the volumes just go black randomly...

    I could not find any "replacement" for a volumetric sim... if anyone has any ideas, that would be welcome ! I am getting tired of trying to make particles looking good ( not 10 years old particles ).
     
    Last edited: Dec 16, 2014
  49. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I totally missed the comments about deferred rendering, i feel silly about prev comment currently, i will follow elbows fix too and hopefully i WILL have something to showcase. I somewhat forgot abot this until just watching the 2014 nvidia siggraph presentation on flameworks and realised this has a huge amount of their features at an absolute steal of a price too, so along with a few other interests i want to put it in something during some downtime before returning to webvr headaches (dx11 vr, so much more freedom)

    As the author says, this isnt really suitable for water, water's typically meshed and rendered as a polygon surface, or it would appear like a gas, and a more suitable simulation like sph would be more appropriate, there are assets for this. But for gas simulation, of all kinds, this has no equal on Unity. Rather enthused now
     
  50. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Note that although I've not had a chance to try it myself, there are some direct compute shader issues being reported with Unity 5 beta 20, so I'm not convinced Fluidity will work on that version.