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. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    630
    I thought i'd overestimate the translation :p And if your question hasn't been answered yet maybe you could post the question over at shader labs and get some more knowledgeable opinions :) haha
     
  2. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    To be honest, I know it's outside of the realms of Unity just now... Not without some serious work, the special lightprobes I could probably do myself, but it would mean custom shaders for everything that would use them, and that's not something I am prepared to do...
     
  3. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Would collisions interest anyone? If so good, cause collisions with primitives is in!
     
  4. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    630
    They definitely do! So would it be possible to approximate the shape of a person with primitives and have the fire deform around it?
     
  5. akabane

    akabane

    Joined:
    Apr 26, 2007
    Posts:
    143
    Yay, collisions! Exactly one of the steps I wanted to see...any video? :)
    Great work by the way!
    I have a dreeeeeam:
    -advect velocity from unity objects to the grid, so we can influence and direct the motion of the fluid without relying on colliders (that have different behaviour anyway)
    -Having some control over other variables (or they still have to be implemented?), like confinement on the velocity grid to have more natural swirls without having to overdo turbulence, and oh yes! Turbulence influence control over velocity, density, temperature and age fields...could it be done? :D

    I'm all over this once it's out with collisions etc..

    Keep up the wonderful job!
     
  6. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    630
    The ps4 game deep down has some very cool fire effects and i'm pretty sure they implement in a similar way. I was wondering if your system could handle a dragon spitting fire like seen in this gameplay video here
    http://www.twitch.tv/feed_rss/b/463384489 starting at 03:29:00
     
  7. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Yes*

    *Dragon not included
     
  8. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    A little progress update;

    - Switched to tree based fluid. This allows for more resolution and overall better quality without costing so much.
    - Vorticity confinement.
    - Global affectors, these can have multiple methods of interaction with one or all your fluid simulations, the API is simple, just drop script on gameObject, and the rest is taken care of (ie. it will automatically detect which simulations require interaction based on radius etc...)
    - Occlusion culling, no point in updating simulations/renderers that can't be seen. (option to ignore culling is there)
    - Quality settings.
    - General performance updates and new, faster, better quality rendering system.
     
  9. MHD-Salka

    MHD-Salka

    Joined:
    Mar 19, 2013
    Posts:
    72
    Dude just release the source code already :p

    Is this officially the first approach to do physics based fluid simulation in real time? do you know of any other projects that tried something like this approach? i've never seen something this awesome before....and it runs like a charm on my crappy gtx 460....this is a true next gen technology...congrats
     
  10. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    The wait is almost over, I promise :!:

    In the mean time here's a new demo:
    Fluid Instancing

    This demo showcases some of the new features I've been implementing.
    • Instancing
    • Texture emitters (if you look closely at the start, the systems are emitting from a radioactive symbol)
    • Render masking (so you don't just have to use a box to encapsulate fluid systems, in this case it's a simple cylinder with a smooth falloff)

    There are other new features, maybe another demo shortly...
     
  11. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    And here's another demo:
    Fluid Vorticity

    This one shows off again the new texture emitters and the vorticity confinement simulation.
     
  12. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    I've just put the finishing touches on the last feature for this. Should hopefully be able to post a new demo tonight :)
     
  13. Cryonics

    Cryonics

    Joined:
    Sep 30, 2013
    Posts:
    11
    Truly awe-inspiring. I've been following this project for quite some time now, and have been dieing to get my hands on it. It's great to see that you are continuing work and preparing for a release.
    I'm just a <poor> computer science student, so I'd appreciate it if you keep it affordable. That being said, I hope you make a million dollars and get to hang out with moviestars (unlikely as it may seem).
    Congrats on getting my first post sir. ;)
     
  14. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Thanks for that, good to finally hear from you. I was a student not to long ago so I know how you feel. Although, when there was something cool I needed to buy, I saved up for it and lived off 5p tescos noodles for a couple months :) I'm so thankful for my job, I don't want to go back on the extra value noodle diet :D

    You have raised an excellent point though, what's everyones opinion on price?

    In other news, it doesn't look like I'll be posting that demo tonight, Breaking Bad got the best of me. Tomorrow should do it though.
     
  15. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    As promised here is a new demo... I've also organized the other links into one post as well.

    This one is my personal favourite and it demonstrates some of the things you can do with effectors.

    Effector Demo
    Vorticity Demo
    Instancing Demo
     
    Last edited: Oct 2, 2013
  16. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    I've just finished my last round of optimization on the system, and I'm getting fairly happy with the state it's in.

    To show you what I mean by this, I have updated the Instancing demo (see comment above). Now, with the latest upgrades, I have 164 fluid systems being rendered in the same scene, at the same time. Each with 2nd order correction and vorticity confinement. And we are quite happily chirping along at 60 fps.

    Getting close to finished now. I am in the process of generating docs and asset store images.
     
  17. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Getting close to release now. I will be doing an asset store submit at the weekend! :D
     
  18. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    630
    Can't wait!
     
  19. MHD-Salka

    MHD-Salka

    Joined:
    Mar 19, 2013
    Posts:
    72
    Can you post a new youtube demo with all the new features? i don't have access to a dx11 rig right now
     
  20. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Yeah sure! I will upload one next week.
     
  21. sashahush

    sashahush

    Joined:
    Sep 5, 2012
    Posts:
    75
    So with this system you can create volumentric clouds?
    amazing, when will this be out?
     
  22. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    I submitted my application to the asset store on Sunday just past, so hopefully I will hear something today :D

    Yes you can create clouds using the system, infact, with the asset, I have included a generic version of my fluid ray marcher, which integrates raymarched volumes into the scene (with depth sorting and the like). So anyone can use it as a framework for doing any ray marching (like clouds, or even explosions :) ) inside Unity fast!
     
  23. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    Hi,
    I'm very interested in this asset, but it would be cool to have some complete overview of all the features that are already implemented and what future improvements we could expect. So I could better decide if I should buy it. (.. well I guess I will buy it anyway ;-)
     
  24. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439

    You're absolutely right, I plan on doing this very shortly! In the mean time i will just tell you.

    Just now you can:
    • Create fluid systems and sort/render them in the scene amongst other rasterized geometry.
    • Complete control of simulations, grid resolution, low quality mode, 2nd order correction, vorticity confinement, pressure iterations, vorticity scale, emission force, reaction speed.
    • Choice of emitter modes, either emit from sphere or from a user defined 2d texture.
    • Fluid instancing, re use the same simulation multiple times with different rendering parameters, using this you can render 100's of simulations at a fraction of the cost.
    • Culling and rendering level of detail.
    • A generic raymarching framework that you can use to render any 3d texture and for it to be completely integrated in the scene.
    • Collision spheres.
    • Temporary emitters, emit up to 4 different colour gradients in the same volume, each from seperate emitters.
    • Global rendering controls and quality settings.
    • Link lights to simulation.
    • Fully documented source code.

    And in the near future I look to add:
    • World scene collisions, ie. voxelize the scene and collide
    • More effector types, turbulence, wind zones, repulsors, attractors.
    • More advanced temperature model which allows for more realistic rendering of fire/smoke.
     
    Last edited: Oct 21, 2013
  25. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
  26. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    Sounds great! Any additional emitters? Like emit from a mesh/vertices?
     
  27. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Yeah sure, I've been experimenting with this already.
     
  28. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    630
  29. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Well you can consider yourself 95 dollars better off, or something like that, as i took the plunge - looking forwards to the new features!

    Only real question i have is the smoke from a fire simulation being boxed in by the volumes, which would be great inside a room but not outside, how would i let the smoke travel further? Is it to do with changing the volumes or painting a mask?
     
  30. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Without the ability to render into a 3D texture (which I don't think you can do in Unity yet) the only way to do this would be hacky and inefficient. Hence why some of the features I have planned, which use voxel representation of the world, are shelved.

    Do we get this ability in 4.3 anyone know?
     
  31. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439

    Thanks alot!

    Yeah, that's unfortunately the limitation of this particular technique. Would it be acceptable if I provided an option to turn off collisions with the volume?
     
  32. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Sure, either that or have some kind of adjustablefalloff space within which the effect can fade out or 'lose energy' - the issue is most priminent at the top as the smoke hits a clear 'ceiling' where if it were to be able to naturally fade out as it travels upwards would be more suitable for outside use

    I'm not sure what the performance implications are for removing the collisions for the volume are, i imagined the masks were there to control this, like painting a mask as such near the top where it was like a white dome would have the top of the simulation fade out in that shape
     
  33. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Yeah, the render masks are what this kind of problem is supposed to alleviate, but they only work in a prism like shape pointing up the volume. So while they should work rather well from the sides, the top is still an issue.

    Have you tried just lowering the force of the fluid so that it doesn't hit the roof?
     
  34. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I mean basically, sure, so long as the effect can still collide with intersecting objects and forces. I'd love to play around with it in a variety of ways and see which works best, its obviously a very capable asset that i'm having a lot of fun with, just may need some tweaking before i can use it for my intended use fully

    I must reiterate that it is absolutely beautiful and incredibly impressive though, and versatile, making waterfalls with it was easy as infernos
     
  35. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Thanks for your kind words! I will be putting what you require into the next update :)
     
  36. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Ahh yep I tried that but that in turn lowered the smoke propagation in your main fire preset which if youd imagine a large fire burning fume-heavy material like rubber woud be a problem because the smoke woiuld still hit the 'roof' when you'd want it belching into the sky (This could actuallly be something of awe with something like this at that scale, perfect time to twitch on my oculus hah). I should play with it more really
     
  37. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Funny you should mention oculus, I am currently working with a developer to get fluid working on oculus!
     
  38. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Well if you need any second opinions I would be extremely grateful to see this happen - that really would be something! I know TriDef Ignition Beta, one of the 'hacks' for retrofitting older games can check for z position based on shader analysis rather than model matrices so maybe some equivalent can be found for some part of the fluid simulation, the cells location or something? (Sorry i'm a bit of a newbie at this stuff) Or would that be me not understanding it or be too coarse?
     
  39. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    I can generate the view rays needed to render the fluid from the view-projection matrix. Just seem to of hit a small problem with the rays having a slight offset, should be fixable though.

    Sure, I will let you try this as soon as it's ready, just send me an email (should be in the docs).
     
  40. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    And in the near future I look to add:
    • World scene collisions, ie. voxelize the scene and collide
    • More effector types, turbulence, wind zones, repulsors, attractors.
    • More advanced temperature model which allows for more realistic rendering of fire/smoke.
    • Lighting!! Opacity mapping and world shadows.
    • Mesh emitters!
     
  41. Mario_jmc_3d

    Mario_jmc_3d

    Joined:
    Oct 19, 2013
    Posts:
    15
    Very good try :)
     
  42. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    Just bought this asset and it rocks!
    But it's a little to heavy for my graphics card (Readon 7750) to get a decent framerate at a high screen resolution. Have to play with different settings to get the right balance between performance and quality.

    My only note right now: For people from the western hemisphere(like me) it's a little counterintuitive that the colorgradient goes from right to left in time. Birth color should be left and death on the right.

    Like lazygunn said:
     
  43. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Yeah, you're possibly right about the colour gradient, it made sense at the time for me because the graph goes 0 to 1 (0 being dead and 1 being alive), but I can definitely see where you're coming from! Next release :D

    BTW new forum thread, in the correct section, this thread is a bit old and was really created for the competition.
    http://forum.unity3d.com/threads/206438-Fluidity-NextGen-Fluid-Dynamics-RELEASED
     
  44. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    What is cheaper, multiple Fluid volumes in a space or a large volume? I have fluid attached to an object on a path, in a medium sized space