Search Unity

Fluidity - NextGen Fluid Dynamics - [ RELEASED ]

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

  1. BuildABurgerBurg

    BuildABurgerBurg

    Joined:
    Nov 5, 2012
    Posts:
    566
    Thats awesome Alex!!!

    :)
     
  2. tomato_comet

    tomato_comet

    Joined:
    Oct 17, 2013
    Posts:
    18
    Oh my goodness this is wonderful. Especially for Unity it's impressive, but outside of Unity I haven't seen this in games.

    Question:

    Is it resource intensive?

    Does the smoke react to a rigid body character touching it? For example, simply having a character run through the smoke, would the smoke disperse, repel, whip around the character as the two collide?

    I presume "yes" because the demo has the smoke colliding with the walls of an invisible cube.


    Does it react to wind?

    This is great. So much potential. Really would love to know what kind of power hog this is or isn't. It truly looks like real world particles of ash reacting randomly to each other. It could be a volcano, dry ice vapour, rolling fog, anything. So much potential.
     
    Last edited: Feb 4, 2014
  3. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    In my experience you can pite far, i my 'heavy' software in my projects, fluidity is one of the lightest, althugh I have a lot to learn naturally, its ooking like 4am is coming round and i'm still generating terrain! i will get to this! Alex if you dare send me updates as they come regarding fumes and their behaviour (cohesion, persistent and wot not) i should be getting very much handy enough to integrate it straight into the volcano. I'm already looking forwards if possible to have different shaped emitters within the caldera making differekinds of explosions, some of various olours, colours changing over tome almost especially light scattering from within as well as outside as magma explosed

    Asking a lot i know! But this could be used for anything, even how magnesium burns

    Incense sticks too fr that matter too, but of a hippy over here
     
  4. zelmund

    zelmund

    Joined:
    Mar 2, 2012
    Posts:
    437
    thats what i wanted to see ))
     
  5. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I was so excited i can hardy even read the above post
     
  6. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Yeah, currently sphere colliders are supported (although I'm looking at adding mesh/planar colliders next).

    And turbulence zones are supported (for wind).

    It's definitely a power hog on full quality, but with fully customizable quality settings and LOD helpers it's easy to tune to your needs.
     
  7. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I'm still awake trying to get this figured out as nicely as i'd like it! Thank god for coffee. Although i am now kaput, and hopefully tonight bring fortune cause if i don't sleep then brain death will surely be mine. If you don't mind could you sling me however far you get with the self shadowing smoke in a note? Then i should be able to get it all in, although it's already looking great. Sorry for taking so long, mind.
     
  8. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    That's it finished, I'm going to submit that tonight, and leave scope for further scattering in the future.

    What was this you were talking about a page ago, with the CUDA filter??
     
  9. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Ahh I see! I think the only thing I can think of with issue with my needs i'd actuallu have to see using my own simulation, which i'll basically do now so you can have a look

    The shock filter is something i've been puzzling with, because I know its fast on the GPU but I dont know how fast it can be for runtime in a game (Although it seems to handle video fine) but the effect it has is quite brilliant for what i had in mind and being able to use it in a realtime context would be great

    It's from a GPU Pro book, here's the software they themselves wrote to explain, based on CUDA https://code.google.com/p/cefabs/

    If you play around with the settings on anything you can think of you can see it can be quite a striking effect, the source is there naturally but obviously the paper is kept to the book. Even if I had to pay a few bob for the thing I wouldnt mind so long as it could be implemented in some form, and I fully intend to treat textures with that software anyway for my own development
     
  10. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Okeydoke well, not the best video was slow cause i had all the things going on in the bg bu the next evolution of the volcano.

    I tried to show the feasibility of persistance by having it run with the reaction time down then turning emit off and on again, such things shouldnt be too terrible to script

     
  11. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Yeah I think what you've done there is correct as smoke doesn't rise from the volcano at a constant rate! Looks awesome, will be even better with the new shadowing (which I submitted yesterday).
     
  12. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Ahh yep re: constant rate, it seems to be fired a lot by internal explosions so the intention is to have several instances with different properties then i can maybe tend to it's temper or elevate it via scripting, it's supposed to run uninterruptedly for, hoping, 1 1/2 or so hours so being able to control phases and reflect events would be great

    As an side, i spent a long time with it to get a nice effect and obv will be spending more too, and you can get some very striking effects with this that don't resemble a volcano at all, or a flame etc, slowed down and messing with the gradient for shading a bit i got some almost haunting results. I see plenty of occasions in the future to use it for things you wouldnt associate by its original intention at all. Its pretty amazing basically

    I'll have as look at the update when i can get at it and i'll try put something together that could show off the new updates, in terms of my intended use and perhaps try and re-find some of the more bizarre results

    In fact presets along with an ability to capture estate would be ace, but i have a bunch of time now i know what i wanted could be done so i wont nag hah

    Finally though, the noise slows it like crazy, i dont know if theres some optimisations there, but i would definitely say being able to introduce it and colours and suchlike on lifetime/energy basis would be great, but no real hurry there. I will post videos of how i get along to maybe sell it to folks
     
    Last edited: Feb 6, 2014
  13. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    Finally I managed to see the new self shadowing fluid . Looks great! And I realized what the problem was that I had with the Text Demo scene and the new Self Shadowing scene:
    In my Player Settings I use Forward Rendering but in the old scenes the camera use the Deferred Rendering. The camera in the new scenes uses "Use Player Settings" as Rendering Path. So here is the problem.
    I wasn't aware that Fluidity only works in Deferred Rendering :eek: It wasn't documented as far as I'm aware (But it should be!!!). Is it a problem to get a version that works also in Forward Rendering?
     
  14. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Of course it's not a problem. Fluidity has nothing to do with Unity lighting rendering paths.

    What's happened is the depth texture flag isn't enabled for the camera in the scene (likely my fault). In forward rendering the depth texture isn't generated unless you explitly decompress and copy it from the depth buffer. Whereas deferred rendering needs it before lighting can be calculated, so generating it is part of the pipeline.

    I'll fix this up ASAP!
     
  15. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    Yes! :)
     
  16. theLittleSettler

    theLittleSettler

    Joined:
    Jul 14, 2012
    Posts:
    36
    Sweet. Most impressive thing I've seen.

    So, I just bought the package yesterday. What I want is self shadowing based on point light(s).

    I was looking for a solution for ground fog (like, a fog machine) but this could do every particle effect I need that I can think of in my current project.

    btw: On the topic of external shadows...Its not so important to me but I would be more than happy to change to whatever system for shadowing if it means you can get this to receive them.
     
  17. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I found the self shadowing on the recent update absolutely beautiful and something good will come of that at some point over the next few days (i hope) as i'm going to have a bit of an assets i own showcase to show everyones stuff, this in particular will be getting lust from the gfx people, with a bit of messing around it can look absolutely beautiful

    Bug report time though, it seems sometimes when you save a scene i dont know what values its saving for the resolution of the simulation but its very high, and not what is specified. It was neat to see how this would look on the computers of tomorrow (absolutely amazing) but yes, was a bug so i thought i should say

    In fact getting it to remember parameters seems to be hard, generally i set the parameters in play mode, copy the component and past values after stopping it, seems to be the only way for the values to stick sometimes

    Let none of this detract though, this is amazing
     
  18. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Interesting bug report. I've seen similar problems like this in Unity when you have the gameobject that's also a prefab else where. Is that the case for you?

    As far as I'm aware, I've followed normal practice for editor serialization, maybe you should file a bug report with Unity?
     
  19. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    You know what, i think not only is it probably that, that i should also know better too by now, i dont think theres much point filing a bug report when the updating the prefab should work fine aha.My bad

    As an aside, did you find much of interest in the filter I showed you? I can definitely understand lack of enthusiasm if it doesnt interest you but I figured i'd throw it your way. There are several other image space techniques and filters in the books I suggested that share a similar theme on interesting 'content aware' kind of techniques that can have a dramatic and pleasing effect on an image (The gpu kuwahara filter being another), and theres nothing really to lose from wrapping them up into a product and making some money! (Not to mention me finding them very useful. Hah)

    You give me volcanos, i give you pretty filters, and on that subject i'm getting increasingly close to a very strong volcano effect that renders all my feature-nagging kind of silly. If you set the reaction time to very low and slow down the simulation to very low, you can get a very convincing approximation of a volcano where if you bump up the gravity influence, you end up with exactly the sort of persistent mist i was looking for. A high gravity influence not only nicely removes energy from the simulation realistically, in a volcano plume sense, but naturally dissipates the cloud. Havent tried using an effector on the mist to introduce wind effects and suchlike but I think you've made some kind of definitive volcano simulator aha. You should rename this thing 'VOLCANOS (but does fluids too)'

    Edit: Edited cause what i thought was a problem, wasnt a problem
     
    Last edited: Feb 9, 2014
  20. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Hello, I was just checking in to see where Fluidity's at nowadays (it's been a while and so I've had to switch back to more classical particle-based solution for Ghost of a Tale). The new self-shadowing web player demo looks very nice so I updated Fluidity to the latest version and tried opening the example scenes. However they don't seem to really work for me. Well, more precisely here's what happens:

    _Affector Demo: The blue flame effect is the only effect that seems to work normally; the other flames are really short, almost like sprites.

    _Jet Demo: The effect doesn't seem to work; I can see a little distortion playing with the slider but the flame effect is not present.

    _Nuclear Demo: Nothing visible (besides the architectural meshes).

    _Ruins Demo: When entering play mode the flames effect appears for one frame then disappears; only the lights are visible.

    _Self Shadowing Demo: Nothing visible; just a black screen.

    _Text Demo: I can shoot projectiles by left-clicking but the fluidity effect is not visible.

    _Volume Renderer Demo: Seems to work as I remembered from the previous version.


    I'm on Windows 8, Unity's in Linear color space, I'm using DX 11 and I tried both in Deferred and Forward rendering mode. I also made sure to update to the latest version of Unity and did a clean install of Fluidity.

    Oh well. Good luck for the development and I'll keep on checking regularly! Can't wait to be able to use it in game!
     
  21. Z43D

    Z43D

    Joined:
    Jan 2, 2013
    Posts:
    100
    Hey Seith,

    I'm having the same problem. It appears as though the Volume Renderer script(kind of important heh) wasn't included in the latest update? I can't find it anywhere and there's nothing attached to the camera components in the demo scenes.

    @smb02dunnal Please repackage and upload the asset for us ;)
     
  22. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    It's not really that important. If you had read the older posts about the latest update, you'd know that it's no longer needed :D

    Why?
     
  23. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Interesting...

    It's not something I'm seeing on my end! Which can only mean it's one of two things; your project/settings aren't correct, or there is a bug in Unity itself.

    I've got to admit though, it sounds an awful lot like you have just installed Fluidity over the top of the old one and are rendering using the old shader...

    Could you create a fresh project and import Fluidity to test it?
     
  24. Z43D

    Z43D

    Joined:
    Jan 2, 2013
    Posts:
    100
    I'm not sure what's going on then :/ Fresh project, everything enabled. Still getting the same issues as Seith.
     
  25. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Can you send me the fresh project, maybe I'll be able to help!
     
  26. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    To be fair the latest release didnt have documentation for the new features (although i understand writing documentation is a chore), and i'm not sure all the demo scenes were updated to behave consistently between them, like different rendering paths (well basically player settings or deferred) which was a bit confusing

    That said after getting used to it perfectly well, im finding overlarge resolutions for the simulation can be a bit crashy but you dont really need resolutions like that

    Been getting a tad obsessed with this lat few days cause i really want the volcano perfect,omly thing really buggering that is if youre using quite high values for vorticity and viscous parameters then the emiting can look a bit hectic, theres ways round though and the final result of the afternoon really had me impressed - left it to conform with the boundary but be large enough an effect to spread along the 'ceiling' and the sunlight passing through gaps in the 'umbrella', illuminating the central pillar, that was special stuf. Bit burned out on it till after some sleep but i think im getting close to getting exactly what i want, so cheers! If i had only one tinybugbear there was as the fluid reached the top of its bounds it would 'umrella' in a way i found really nice but tended not to do it consistenly, but rather 'pulse'

    I don't really 'get' the issues others are having though, so long as dx11 is on its all dandy

    You go t me enthused in the idea of it shadowing the ground now, that would be a sight to see, and i'll show off a final result (im fairly sure it will look pretty nice) soonish, just want to promo a lot of guys stuff at the same time, thats said if you wanna see progress ill make a video when im more conscious
     
  27. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Ok, so I tested Fluidity on an empty project and after I set the project's rendering path to Deferred the self-shadow example scene worked fine (it was pink in Forward mode, as you know).

    So I got back to my game's project and (again) deleted the Fluidity folder from the Assets directory. Then I imported Fluidity, making sure the project settings were the same as the empty one (in terms of DX11 and rendering path) but it still doesn't work.

    Which probably means one thing: the previous version of Fluidity might have left something somewhere (outside of the Fluidity folder) which interferes with the new version. Would you have any idea what that could be, Alex?
     
  28. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    There's nothing outside of the Fluidity folder. Are you using linear space lighting? There seems to be a problem with that.
     
  29. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Yes, here are my project's settings:



    Are there settings anywhere else that need to be changed?
     
  30. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Ah, there's a bug with linear lighting and Forward rendering in this version of Fluidity. I fixed them both late last evening. :( Sorry about that!
     
  31. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Oh, well I guess we'll just wait for the next version to show up on the Asset Store then... Thanks.

    And since Lazygun was mentioning the lack of API documentation; is that something you're working on implementing at the moment?
     
  32. BigStar-I2R

    BigStar-I2R

    Joined:
    Dec 10, 2012
    Posts:
    1
    ....
     
    Last edited: Feb 13, 2014
  33. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Just submitted an update to the store. Fixes the bugs with forward rendering and linear colour space! :)
     
  34. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Lovely! Will get on that soon. As said I want to show off all these assets i'm accruing in a very nice way and that will definitely help
     
  35. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I recently read Patapom's (the creator of Nuaj) paper on realtime volumetric rendering and wondered how much relevance you might think it could have to this (i'm imagining, in fact, that it's already using it to a degree for self shadowing and density, for ground shadows i have something in a book i might try to implement as i also found a really nice start to advanced article on shadow mapping), one thing it covers is using fractional brownian motion, which seems to suit the noise type i was wondering about when using it to add detail to the volume, using a lower frequency 3d texture to break up tiling and wondered your thoughts on this too. I'm going to stop asking for stuff and try it myself as its about time i did that sort of thing and you've provided all the tools needed, i suppose i just wondered if i'm going in the right direction

    I'll add that i'm absolutely loving this, it's starting to do exactly what I want it to do and will be starting to script it for behaviour so the main plume and several instances can nicely emulating a churning ash belching volcano, it's looking beautiful and it's also running much more quickly than I thought it would, 200-300fps while showing impressive detail even up close, just finding the noise breakup a bit unsuitable as it tiles very obviously and by animation i guess i meant more if the noise has a 'phase' or something similar, rather like max's fractal and turbulence noise, rather than animating its offset
     
    Last edited: Feb 23, 2014
  36. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    sorry if this has been covered.. is it possible to attach a volume to a moving object, with an attached emitter?
    I want to have an object emmit fluid as it moves but having a huge room volume seems expensive.
    Most important is that the fluid moves realistically, the fluid trailing behind. I replicated what was done in the demo but it looked odd.
    It doesn't really move as if the fluid is moving in space, its like space shrunk down to fit the fluid, not allow ing much dynamic behavior.
    Does that make sense? Also, whats more expensive, multiple volumes or a big room volume?
     
  37. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Wow, the flametrower and the pyroclastic cloud are probably the most AAA A A + stuff I've seen for unity.
     
  38. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Certainly. See how I set up the flamethrower demo for this. In Fluidity we call this concept translating grids.
     
  39. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    I updated to the latest version and am having issues...The fluid draws all wrong, its offset and draws in front of everything else, mesh included. I'm using it with the Rift..it clips off the entire fluid as I move my head..
    The only version Ive been able to get tp work correctly with the rift is an old one.

    Also, The flamethrower video is brutal. Its so fast with no annotations or speech, very tough to follow along...the viewer has to pause it and track your mouse. Do you have a demo scene file you could share with the flamethrower as a prefab on on model... doesn't need to be the bots demo. looks amazing, really like to use it in my game as a fire source in the world, not really as a flamethrower.
    Thanks!
     
    Last edited: Mar 29, 2014
  40. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Is it possible to send me a quick repro project?
     
  41. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    I've added some annotations to the flaming bots tutorial video, you're right it's a bit brutal! Sorry!

     
  42. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    I updated again from scratch, this time only updating the four files that needed to be, the shaders.
    Is that good enough? seems to be working fine

    Update: I found the part that breaks it for me when I update it...its almost like it puts the fluid on a plane thats floating in the scene...
    Fluidity/Resources/Shaders/fluidity.cginc
     
    Last edited: Mar 29, 2014
  43. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Here's what I'm seeing, updated on top, working on the bottom... Thanks

    $broken.jpg
     
  44. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Okay, just to clarify you have managed to get it working? Or not?
     
  45. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    yes, If I leave out the shaders: Fluidity/Resources/Shaders/fluidity.cginc
    I assume I need these? they weren't listed as new during the update. Yes, Im working, I wanted to be fully updated.

    there's an image of how its broken here
    https://www.dropbox.com/s/qymwvhxed45roee/broken.jpg
     
  46. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    What's your method for importing the new version of Fluidity into your project?
     
  47. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    go to the asset store, update, import, leave everything selected, import.
    I also tried throwing out the entire fluidity folder and importing the new version from scratch, same result.
     
  48. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Sounds about right. Is it broken only on rift? I don't have one, that's why I was asking you to send me a repro project.
     
  49. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Yes, happens without the rift cameras, using a standard cam.
     
  50. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Hello, seems you dont like PMs, but the gist of it, regarding Fluidity working with candela was that the candela guys said to me:

    From here http://forum.unity3d.com/threads/208...r-Unity/page17

    'fluidity is a volumetric effect using DX11 and compute shaders, as we have mentioned, Candela looks at Diffuse Alpha and the Specular Alpha Channels for modulation and Color/Depth Buffer, It is much easier for other third party packages to add custom integration to Candela SSRR than the other way around. Perhaps you can contact the developer of Fluidity to integrate Candela SSRR support. Please note, you can of course still use Candela SSRR toget with Fluidity in the scene however they will not reflect until Fluidity writes it's results to the depth color buffer.'

    I am completely ignorant of this magic so i'm not sure how well that goes or if it's necessarily true, it is however a damn shame if these things cant work together. Would you have any response to that, that would help me enlighten them? If not, are there any ideas you have that would get around Candela not reflecting Fluidity? They're both currently somewhat unique products, they're also both extremely good (especially on the eyes), imo, so one way or another i suppose i'll try get them working, apply my brain and wotnot