Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Fluidity - A DirectX 11 Competition Entry

Discussion in 'Made With Unity' started by smb02dunnal, Jan 18, 2013.

  1. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    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

    Joined:
    Jun 19, 2010
    Posts:
    293
    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

    Joined:
    Dec 26, 2012
    Posts:
    39
    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

    Joined:
    May 5, 2012
    Posts:
    439
    Thanks!

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

    cemnahit

    Joined:
    Dec 26, 2012
    Posts:
    39
    Fixed, thanks :)
     
  6. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    Really nice!
     
  7. smb02dunnal

    smb02dunnal

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

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439

    Thanks!
     
  9. Metakid

    Metakid

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

    Deleted User

    Guest

    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

    Joined:
    Sep 30, 2010
    Posts:
    523
    Yup yup, and our wouldn't need 680s running in SLI to run properly :p
     
  12. Deleted User

    Deleted User

    Guest

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

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    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

    Joined:
    May 5, 2012
    Posts:
    439
    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

    Joined:
    Nov 4, 2012
    Posts:
    193
    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

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

    Toasttify

    Joined:
    Mar 27, 2012
    Posts:
    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

    Joined:
    Dec 9, 2010
    Posts:
    2,663
    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

    Joined:
    Dec 21, 2012
    Posts:
    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

    Joined:
    May 5, 2012
    Posts:
    439
    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

    Joined:
    May 5, 2012
    Posts:
    439
    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

    Joined:
    Jul 2, 2012
    Posts:
    639
    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

    Joined:
    Dec 9, 2010
    Posts:
    2,663
    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

    Joined:
    May 5, 2012
    Posts:
    439
    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

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

    That's most excellent to hear.
     
  26. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439


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

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    I have to test this!!! (if I'm on my dx11 pc and not at my S***ty mac )
     
  28. VeganApps

    VeganApps

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

    gl33mer

    Joined:
    May 24, 2010
    Posts:
    281
    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

    Joined:
    May 5, 2012
    Posts:
    439
    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

    Joined:
    May 5, 2012
    Posts:
    439
  32. RC-1290

    RC-1290

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

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    This is amazing!
     
  34. pvloon

    pvloon

    Joined:
    Oct 5, 2011
    Posts:
    591
    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

    Joined:
    Sep 20, 2012
    Posts:
    15
    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

    Joined:
    Apr 23, 2013
    Posts:
    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

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

    Zeblote

    Joined:
    Feb 8, 2013
    Posts:
    1,102
    Yes
    Do that
     
  39. Play_Edu

    Play_Edu

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

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    630
    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

    Joined:
    May 5, 2012
    Posts:
    439
    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

    Joined:
    Mar 4, 2013
    Posts:
    630
    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

    Joined:
    May 5, 2012
    Posts:
    439
    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

    Joined:
    Mar 4, 2013
    Posts:
    630
  45. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    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

    Joined:
    May 5, 2012
    Posts:
    439
    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

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    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

    Joined:
    May 5, 2012
    Posts:
    439
    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

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

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    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?