Fluidity - A DirectX 11 Competition Entry

Discussion in 'Showcase' started by smb02dunnal, Jan 18, 2013.

  1. smb02dunnal

    smb02dunnal

    Member

    Joined:
    May 5, 2012
    Messages:
    397
    See my second entry here : http://forum.unity3d.com/threads/166944-Pyroclastic-Puffs-DX11-Comp-Entry



    I would like to share with you all my DX11 competition entry. It's called Fluidity.

    As you might of guessed from the title, its a fluid simulation. Most of the heavy work is done inside the compute shader (IE. all of the physics and ray-marching) with the odd exception, such as depth composition and sorting.

    Multiple simulations can be run (although I only expose controls for the main attraction in the GUI) and multiple renderers can be run (for example, the four small fluid emitters in the center all share the same simulation, but each have their own renderer). Also, simulations can be linked to motion or animation (like the fluid emitter that orbits the scene).

    Also, as a little bonus, I have added in my voronoi destruction stuff to show how the raymarch rendering works in a dynamic environment.

    It's something I have been working on for a while but this competition has really pushed me to get it finished and looking great! And I'm fairly pleased with the results, so without further delay (and without getting too technical), here is my finished build :

    View attachment $Fluidity.zip



    And for the hardware impaired, here is a video :




    I hope you like it! I'm happy to answer any questions you have.

    Thanks.
    Last edited: Jan 22, 2013
  2. jesta

    jesta

    Member

    Joined:
    Jun 19, 2010
    Messages:
    260
    This is great. I'm amazed by most of the submissions for the dx11 contest. Imagine combining all of our efforts into one game! A game with super realistic fluids, millions of particles, advanced lighting, "constructing" geometry, advanced displacement maps, and inifnite terrains :D.
  3. cemnahit

    cemnahit

    Member

    Joined:
    Dec 26, 2012
    Messages:
    29
    Looks good solid fluid effects :) good luck!

    One problem that i downloaded your exe file 2 times but zip file is damaged, can you check it out?
  4. smb02dunnal

    smb02dunnal

    Member

    Joined:
    May 5, 2012
    Messages:
    397
    Thanks!

    Sorry to hear, try this link instead, if it works I'll update the unity one.
    Fluidity.zip
  5. cemnahit

    cemnahit

    Member

    Joined:
    Dec 26, 2012
    Messages:
    29
    Fixed, thanks :)
  6. kenshin

    kenshin

    Member

    Joined:
    Apr 21, 2010
    Messages:
    688
    Really nice!
  7. smb02dunnal

    smb02dunnal

    Member

    Joined:
    May 5, 2012
    Messages:
    397
    There's no reason why this cant happen in my opinion :) !
  8. smb02dunnal

    smb02dunnal

    Member

    Joined:
    May 5, 2012
    Messages:
    397

    Thanks!
  9. Metakid

    Metakid

    New Member

    Joined:
    Nov 24, 2012
    Messages:
    36
    I'm also blown away by all the submissions, and totally agree with you, imagine what could be achieved by joining forces!
  10. n00body

    n00body

    Member

    Joined:
    Dec 17, 2010
    Messages:
    157
    Put all all our stuff together, and we could give UE4 a run for it's money. Unity could really use its own "Elemental Demo". Though I suppose that is the point of this whole contest. :p
  11. xenius

    xenius

    Member

    Joined:
    Sep 30, 2010
    Messages:
    197
    Yup yup, and our wouldn't need 680s running in SLI to run properly :p
  12. n00body

    n00body

    Member

    Joined:
    Dec 17, 2010
    Messages:
    157
    Well to be fair, we aren't trying to do full on Voxel Cone Tracing in Unity. Yet... :p
  13. xenius

    xenius

    Member

    Joined:
    Sep 30, 2010
    Messages:
    197
    You planning on sharing/selling that vornoi destruction module (is that happening dynamically in unity, or is that phys-baked from another package?) I'd buy it in a hot second (assuming its generating new UVs)
  14. smb02dunnal

    smb02dunnal

    Member

    Joined:
    May 5, 2012
    Messages:
    397
    It is dynamic, based on mouse click ray. It's something I worked on a while ago. No UV though. Shouldn't be too complicated to add though... Maybe I will do this at some point!
  15. Aabel

    Aabel

    Member

    Joined:
    Nov 4, 2012
    Messages:
    161
    Well this amazing. Downloaded the demo and had lots of fun with it! any chance we will see either of these technologies in the asset store?
  16. gizm0san

    gizm0san

    New Member

    Joined:
    Jul 6, 2012
    Messages:
    14
    really impressive particle system demo! had a lot of fun with it!
  17. Toasttify

    Toasttify

    Member

    Joined:
    Mar 27, 2012
    Messages:
    143
    Super awesome, I really hope after the contest is over a lot of the participants put their projects on the asset store, would be amazing to look around at how they did things.
  18. Mauri

    Mauri

    Member

    Joined:
    Dec 9, 2010
    Messages:
    535
    I've downloaded the demo, but sadly the screen is entirely pink/magenta. The gui is visible however.
    Odd: I have a dx11 supporting card (since i can run unity in dx11-mode or games with dx11 without problems)..
  19. Temporaro

    Temporaro

    New Member

    Joined:
    Dec 21, 2012
    Messages:
    27
    This is the most amazing thing I have ever seen on these forums. This blows the Unity DX11 explosions out of the water. Will this be released on the asset store?
  20. smb02dunnal

    smb02dunnal

    Member

    Joined:
    May 5, 2012
    Messages:
    397
    Can you post the log file to me? I'd be more than happy to fix it for you!

    I'm sure you know where to find it, but just in case, look in the fluidity_Data folder (next to the executable) and locate the output_log.txt file. Then just PM the contents to me. I will fix it tomorrow for you (as it's a Friday, and programming after a few beers is never a good idea, really).

    PS. Think I just found a bug on the forums, the mrgreen smiley doesn't seem to work in the post preview. ;) (At least for me it doesn't)
    Last edited: Jan 19, 2013
  21. smb02dunnal

    smb02dunnal

    Member

    Joined:
    May 5, 2012
    Messages:
    397
    Thanks alot!

    I also entered an updated version of the explosions into the contest as well! (It runs very smoothly now :D) Stay tuned for a video and example of that also!

    I was thinking of going open source for this one! Maybe in time, releasing a couple, more efficient/professional tools to make integrating this kind of thing into Unity super easy for anyone interested!
  22. RC-1290

    RC-1290

    Member

    Joined:
    Jul 2, 2012
    Messages:
    584
    This is awesome. My pc is shaking when it tries the render all the glorious detail, but it's definitely worth it.
  23. Mauri

    Mauri

    Member

    Joined:
    Dec 9, 2010
    Messages:
    535
    Figured out that it was my own fault! In my laptop (Lenovo IdeaPad Y570), I have two cards: Intel HD Graphics Family and NVIDIA Geforce GT 555M. I just needed to tell your demo via NVIDIA Controlpanel, which card it should use. It runs fine now, BUT: When the "Jaccobi Iterations" are on 10, the FPS is a bit low. :/

    Overall a really good demo. Good job :)
  24. smb02dunnal

    smb02dunnal

    Member

    Joined:
    May 5, 2012
    Messages:
    397
    I developed a great deal of this project at work (after hours of course ;)) so I had a fairly beefy PC at my disposal :D

    Good to hear you got it working though!
  25. Temporaro

    Temporaro

    New Member

    Joined:
    Dec 21, 2012
    Messages:
    27
    I'm not an alot, but you're welcome.

    That's most excellent to hear.
  26. smb02dunnal

    smb02dunnal

    Member

    Joined:
    May 5, 2012
    Messages:
    397


    Maybe with just the fluid though. There are lots more things I want to do with the destruction ;)
  27. fffMalzbier

    fffMalzbier

    Member

    Joined:
    Jun 14, 2011
    Messages:
    996
    I have to test this!!! (if I'm on my dx11 pc and not at my shitty mac )
  28. DynamicHead 1

    DynamicHead 1

    Member

    Joined:
    Jun 30, 2006
    Messages:
    234
    This fire fountain is a very hot! I love it! I wanna warm my hands at it! :D
  29. gl33mer

    gl33mer

    Member

    Joined:
    May 24, 2010
    Messages:
    245
    Beautiful. Runs without a hitch on my pc.

    I've been dazzled.

    On a side note. The voronoi stuff has been asked for and talked about on the forums in quite a few places, it may be an asset store hit.
    Last edited: Jan 22, 2013
  30. smb02dunnal

    smb02dunnal

    Member

    Joined:
    May 5, 2012
    Messages:
    397
    Thanks,

    I am working on the voronoi stuff just now, it could do with being alot faster. I will probably have something ready in a few weeks at most. Perhaps even add the ability to pre-break objects in the editor so that it could run on mobile devices.
  31. smb02dunnal

    smb02dunnal

    Member

    Joined:
    May 5, 2012
    Messages:
    397
  32. RC-1290

    RC-1290

    Member

    Joined:
    Jul 2, 2012
    Messages:
    584
    I was surprised this project wasn't mentioned in the blog post.
  33. janpec

    janpec

    Member

    Joined:
    Jul 16, 2010
    Messages:
    3,340
    This is amazing!
  34. p v loon

    p v loon

    Member

    Joined:
    Oct 5, 2011
    Messages:
    418
    Very cool that you are bringing the voronoi destruction to the asset store! If you ever plan to bring the smoke / fluid simulation to the asset store as well, count me in!

    also, RC-1290 is right, this should have been mentioned in the blog!
  35. aoinekostudios

    aoinekostudios

    New Member

    Joined:
    Sep 20, 2012
    Messages:
    11
    Love this! It's great to finally start seeing what DX11 can do in Unity.

    Amazed how fast the calculations are.
    Last edited: Apr 23, 2013
  36. scheingirl

    scheingirl

    New Member

    Joined:
    Apr 23, 2013
    Messages:
    3
    Pretty cool stuff! So its quite a time ago now, so I would like to ask you mentioned to go open source with this one? I'm interested in the fluid stuff, since I never did it before, and its quite hard to get into it as newbie (spended already a loooot of time with DX - Unity probls)...
    At least it would help me a lot, if you can tell me more about the implementation, did you make the fluid simulation all in Unity and its Compute Shaders? Or did you use a C++ plugin to achieve that? May you can give me some hints or sell it anywhere? That would be awesome!
    Thanks in advance and keep up the great work! :)
  37. SilentDeveloper

    SilentDeveloper

    Member

    Joined:
    Jun 5, 2013
    Messages:
    24
    Your Pyroclastic Puffs entry was impressive alone, this is really outstanding work, fantastic job, you really deserve to win :p
  38. Zeblote

    Zeblote

    Member

    Joined:
    Feb 8, 2013
    Messages:
    667
    Yes
    Do that
  39. Play_Edu

    Play_Edu

    Member

    Joined:
    Jun 10, 2012
    Messages:
    541
    it's like 3dsmax fumefx. awesssssm work but when you release this pkg
  40. blueivy

    blueivy

    Member

    Joined:
    Mar 4, 2013
    Messages:
    322
    I'd really like to have this technology and I hope you haven't forgotten about it. I'd buy it for a large sum of cash if your put it for sell on the asset store as is or just open source it I just really need this tech.
  41. smb02dunnal

    smb02dunnal

    Member

    Joined:
    May 5, 2012
    Messages:
    397
    To be honest... I kinda have forgotten about this. Bit of a shame. I've made some pretty impressive stuff with it though, just as little side projects; a cool flamethrower for a little game I'm working on, and as a turbulence field for a million particle system (this works really nice as the Achilles heel of this technique is the ray marching).

    But, maybe I will have a look at getting this store ready if so many people are interested.

    What should be the asking price if I provide an easy to use interface for this technology?
  42. blueivy

    blueivy

    Member

    Joined:
    Mar 4, 2013
    Messages:
    322
    I think everyone would agree that they'd pay A LOT to see this in the asset store but I suggest polling because my price range may be radically different than what someone else could afford. Or maybe offer two versions. an indie and a pro?
  43. smb02dunnal

    smb02dunnal

    Member

    Joined:
    May 5, 2012
    Messages:
    397
    What features would you like to see in such a tool?

    Do you imagine a similar system in terms of placement and authoring as Shuriken?
  44. blueivy

    blueivy

    Member

    Joined:
    Mar 4, 2013
    Messages:
    322
  45. elbows

    elbows

    Member

    Joined:
    Nov 28, 2009
    Messages:
    391
    I sent you a PM about a week ago asking if there was any way I could get my hands on this quickly. I don't need a polished store release, but I do need something more quickly than it sounds like your new plan may result in. Am I out of luck?

    In the meantime I did find a general DX11 compute shader example of this sort of simulation, but I expect to break my mind trying to convert it to Unity. Will try anyway out of desperation but if there is any way we could do a deal please contact me. Cheers, and sorry for the desperate begging tone of my post!
  46. smb02dunnal

    smb02dunnal

    Member

    Joined:
    May 5, 2012
    Messages:
    397
    I've been doing some work on this over the weekend and seem to of somehow quadrupled quality while halving computation times :D who's complaining!

    Also got rid of some rendering bugs, and made various improvements to usability.

    I'm posting a demo to show my progress and get some feedback, here's the new link: Fluidity
  47. elbows

    elbows

    Member

    Joined:
    Nov 28, 2009
    Messages:
    391
    Looking good :)

    If you update the demo again at some point, would love the ability to zoom in on the scene a bit.
  48. smb02dunnal

    smb02dunnal

    Member

    Joined:
    May 5, 2012
    Messages:
    397
    I don't see why not, I purposefully denied that functionality when I made the original demo as the camera couldn't move inside the volumes... But, now you can :D
  49. elbows

    elbows

    Member

    Joined:
    Nov 28, 2009
    Messages:
    391
    Pleased to hear that, since it was a question I meant to ask but forgot due to excitement :D
  50. smb02dunnal

    smb02dunnal

    Member

    Joined:
    May 5, 2012
    Messages:
    397
    That didn't exactly translate as well as you might of thought.

    However, opacity mapping is rather simple so that might not be such a big issue, I would only worry about the additional bandwidth requirements associated with a deep opacity map. There are other solutions, IE. I could calculate opacity directly in the raymarch by just adding some new rays, but this would make the rendering more expensive.

    What I would really be interested in doing is injecting my fluid shadows into the resolved G-buffer in deferred lighting and adding some new special lightprobes that look up the fluid colour and brightness. Does anyone know how feasible this is?